Added rust modes to emacs, changed theme to one-theme, changed scripts

This commit is contained in:
TuDatTr
2021-03-02 12:23:16 +01:00
parent a56233db18
commit 4732690351
16 changed files with 105 additions and 61 deletions

View File

@@ -182,30 +182,47 @@
(ansible 1))
#+END_SRC
*** [[https://github.com/flycheck/flycheck-rust][flycheck-rust]]
=Better Rust/Cargo support for Flycheck=
#+BEGIN_SRC emacs-lisp
(use-package flycheck-rust)
#+END_SRC
*** [[https://github.com/rust-lang/rust-mode][rust-mode]]
=Emacs configuration for Rust=
#+BEGIN_SRC emacs-lisp
(use-package rust-mode)
#+END_SRC
*** [[https://github.com/kwrooijen/cargo.el][cargo.el]]
#+BEGIN_SRC emacs-lisp
(use-package cargo)
#+END_SRC
* Appearance
This section is for appearance customization. Either via packages or manually.
** [[https://github.com/kuanyui/moe-theme.el][moe-theme]]
=A customizable colorful eye-candy theme for Emacser. Moe, moe, kyun!=
** [[https://github.com/balajisivaraman/emacs-one-themes][emacs-one-themes]]
=A port of the Vim/Atom One Dark and Light themes to Emacs=
#+begin_src emacs-lisp
(use-package moe-theme
:config
(moe-dark))
#+end_src
##+begin_src emacs-lisp
# (use-package one-themes
# :init
# (load-theme 'one-dark t))
##+end_src
** Transparent Emacs
** Transparent Emacs (Commented out)
#+begin_comment
Makes the default color of the background of emacs the same as the terminals color.
This is kind of a janky solution, but it works.
#+begin_src emacs-lisp
(add-hook 'window-setup-hook
'(lambda ()
(if not (display-graphic-p)
(set-face-background 'default "unspecified-bg"))))
(add-hook 'window-setup-hook
'(lambda ()
(if not (display-graphic-p)
(set-face-background 'default "unspecified-bg"))))
#+end_src
#+end_comment
** Menubar
Remove the menu-bar at the top of the screen for better immersion.
@@ -229,7 +246,7 @@
#+END_SRC
* Mode Configuration
** Org-Mode
** Org-mode
Enable org-bullets and hide leading stars.
#+begin_src emacs-lisp
@@ -239,6 +256,12 @@
(setq org-pretty-entities t)
(setq org-src-fontify-natively t)))
#+end_src
Enable utf8x on latex output
#+begin_src emacs-lisp
(setq org-latex-inputenc-alist '(("utf8" . "utf8x")))
#+end_src
*** Keybindings
#+begin_src emacs-lisp
@@ -260,17 +283,28 @@
(setq org-src-tab-acts-natively t)
#+end_src
** C-Mode
** C-mode
#+begin_src emacs-lisp
(add-hook 'c-mode-hook
(lambda ()
(display-line-numbers-mode 1)))
#+end_src
** C++-Mode
** C++-mode
#+begin_src emacs-lisp
(add-hook 'c++-mode-hook
(lambda ()
(display-line-numbers-mode 1)))
#+end_src
** rust-mode
cargo.el
#+begin_src emacs-lisp
(add-hook 'rust-mode-hook 'cargo-minor-mode)
#+end_src
flycheck-rust
#+begin_src emacs-lisp
(add-hook 'flycheck-mode-hook #'flycheck-rust-setup)
#+end_src

View File

@@ -7,7 +7,7 @@
;; If there is more than one, they won't work right.
'(auth-source-save-behavior nil)
'(package-selected-packages
'(ansible yasnippet use-package theme-magic rainbow-mode rainbow-delimiters ox-twbs ox-reveal ox-hugo org-bullets no-littering moe-theme magit ivy-prescient htmlize god-mode go-mode flycheck evil-collection diminish counsel company auctex)))
'(flycheck-rust ansible yasnippet use-package theme-magic rainbow-mode rainbow-delimiters ox-twbs ox-reveal ox-hugo org-bullets no-littering moe-theme magit ivy-prescient htmlize god-mode go-mode flycheck evil-collection diminish counsel company auctex)))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: inline comment template
# key: /*!
# --
/*!< $0 */

View File

@@ -2,8 +2,13 @@
# name: template
# key: template
# --
#include <stdio>
#include <iostream>
/**
@brief
@result
*/
int main(int argc, char *argv[]){
$0
}

View File

@@ -0,0 +1,10 @@
# -*- mode: snippet -*-
# name: function template
# key: /**
# --
/**
@brief $0
@param[in]
@result
*/

View File

@@ -4,6 +4,11 @@
# --
#include <stdio.h>
/**
@brief
@result
*/
int main(int argc, char *argv[]){
$0
}

View File

@@ -4,10 +4,10 @@
# expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region 'nil))
# --
CC = gcc
SRC = \$(wildcard *.c)
SRC = \$(wildcard src/*.c)
OBJ = \$(SRC:.c=.o)
CFLAGS =
RM = rm
RM = rm -f
TARGET = $1
all: \$(TARGET)

View File

@@ -4,16 +4,16 @@
# expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region 'nil))
# --
CXX = g++
SRC = \$(wildcard *.cpp)
SRC = \$(wildcard src/*.cpp)
OBJ = \$(SRC:.cpp=.o)
CFLAGS =
RM = rm
CXXFLAGS = --std=c++11
RM = rm -f
TARGET = $1
all: \$(TARGET)
\$(TARGET): \$(OBJ)
\$(CXX) \$(CFLAGS) -o \$@ \$^
\$(CXX) \$(CXXFLAGS) -o \$@ \$^
clean:
\$(RM) \$(TARGET) \$(OBJ)

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: righttack
# key: |-
# --
⊢$0

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: println!
# key: println
# --
println!("$0");