Added rust modes to emacs, changed theme to one-theme, changed scripts
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
5
emacs/.emacs.d/snippets/c++-mode/inline_comment
Normal file
5
emacs/.emacs.d/snippets/c++-mode/inline_comment
Normal file
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: inline comment template
|
||||
# key: /*!
|
||||
# --
|
||||
/*!< $0 */
|
||||
@@ -2,8 +2,13 @@
|
||||
# name: template
|
||||
# key: template
|
||||
# --
|
||||
#include <stdio>
|
||||
#include <iostream>
|
||||
|
||||
/**
|
||||
@brief
|
||||
|
||||
@result
|
||||
*/
|
||||
int main(int argc, char *argv[]){
|
||||
$0
|
||||
}
|
||||
10
emacs/.emacs.d/snippets/c-mode/fun_comment
Normal file
10
emacs/.emacs.d/snippets/c-mode/fun_comment
Normal file
@@ -0,0 +1,10 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: function template
|
||||
# key: /**
|
||||
# --
|
||||
/**
|
||||
@brief $0
|
||||
|
||||
@param[in]
|
||||
@result
|
||||
*/
|
||||
@@ -4,6 +4,11 @@
|
||||
# --
|
||||
#include <stdio.h>
|
||||
|
||||
/**
|
||||
@brief
|
||||
|
||||
@result
|
||||
*/
|
||||
int main(int argc, char *argv[]){
|
||||
$0
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
5
emacs/.emacs.d/snippets/org-mode/righttack
Normal file
5
emacs/.emacs.d/snippets/org-mode/righttack
Normal file
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: righttack
|
||||
# key: |-
|
||||
# --
|
||||
⊢$0
|
||||
5
emacs/.emacs.d/snippets/rust-mode/println
Normal file
5
emacs/.emacs.d/snippets/rust-mode/println
Normal file
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: println!
|
||||
# key: println
|
||||
# --
|
||||
println!("$0");
|
||||
Reference in New Issue
Block a user