mirror of
https://github.com/elkowar/dots-of-war.git
synced 2024-11-06 03:12:24 +00:00
asdf
This commit is contained in:
parent
88999b818b
commit
63c8662070
1 changed files with 117 additions and 129 deletions
|
@ -1,14 +1,26 @@
|
||||||
|
|
||||||
#+TITLE: Emacs Config
|
#+TITLE: Emacs Config
|
||||||
|
|
||||||
* General Settings
|
* General Settings
|
||||||
|
|
||||||
|
=cl-lib= adds a few things from common-lisp emulation, adding things like =cl-loop=
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package cl-lib)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** Sane defaults
|
||||||
|
|
||||||
Typing =:ensure t= everywhere is very bothersome so I'd rather *not* do that.
|
Typing =:ensure t= everywhere is very bothersome so I'd rather *not* do that.
|
||||||
|
This automatically adds =:ensure t= everyhwere!
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(require 'use-package-ensure)
|
(require 'use-package-ensure)
|
||||||
(setq use-package-always-ensure t)
|
(setq use-package-always-ensure t)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Don't create all the custom things.
|
Don't create all the custom things.
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
@ -54,16 +66,11 @@ UTF-8 is good and should be the default for everything.
|
||||||
(prefer-coding-system 'utf-8)
|
(prefer-coding-system 'utf-8)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
Which key makes Emacs self documenting.
|
Disable the bell, as the audible bell is highly anoying and pointless
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
|
||||||
(use-package which-key
|
|
||||||
:config
|
|
||||||
(setq which-key-idle-delay 0.25)
|
|
||||||
(which-key-mode 1))
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(setq visible-bell 1)
|
||||||
|
#+end_src
|
||||||
** Restart emacs
|
** Restart emacs
|
||||||
|
|
||||||
Restarting emacs from within emacs!
|
Restarting emacs from within emacs!
|
||||||
|
@ -84,7 +91,7 @@ Clipboard shit is fucked, so this is necessary to unfuck.
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Store recent files
|
** Store recent files
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(recentf-mode 1)
|
(recentf-mode 1)
|
||||||
(setq recentf-max-menu-items 25)
|
(setq recentf-max-menu-items 25)
|
||||||
|
@ -92,6 +99,17 @@ Clipboard shit is fucked, so this is necessary to unfuck.
|
||||||
;; (run-at-time nil (* 5 60) 'recentf-save-list)
|
;; (run-at-time nil (* 5 60) 'recentf-save-list)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
** Which-key
|
||||||
|
|
||||||
|
Which key makes Emacs self documenting.
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(use-package which-key
|
||||||
|
:config
|
||||||
|
(setq which-key-idle-delay 0.25)
|
||||||
|
(which-key-mode 1))
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
** VTerm
|
** VTerm
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
@ -99,7 +117,7 @@ Clipboard shit is fucked, so this is necessary to unfuck.
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* Looks
|
* Looks
|
||||||
** tab width
|
** indentation
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq-default tab-width 4)
|
(setq-default tab-width 4)
|
||||||
|
@ -108,11 +126,9 @@ Clipboard shit is fucked, so this is necessary to unfuck.
|
||||||
|
|
||||||
** Font
|
** Font
|
||||||
|
|
||||||
I prefer Source Code Pro for now.
|
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(add-to-list 'default-frame-alist
|
(add-to-list 'default-frame-alist
|
||||||
'(font . "xos4 Terminus"))
|
'(font . "Iosevka Medium"))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** COMMENT Line numbers
|
** COMMENT Line numbers
|
||||||
|
@ -150,6 +166,34 @@ Ugly.
|
||||||
(fringe-mode '(10 . 10))
|
(fringe-mode '(10 . 10))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
** Line-wrapping
|
||||||
|
Line wrapping is confusing, more than anything else.
|
||||||
|
Thus, let's disable it!
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(setq-default truncate-lines 1)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** Org-mode codeblocks
|
||||||
|
|
||||||
|
Let's make org-mode codeblocks look good!
|
||||||
|
|
||||||
|
For this, we first set the code-block background and make it extend to the full width.
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(set-face-attribute 'org-block nil
|
||||||
|
:background "#1d2021"
|
||||||
|
:extend t)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
Additionally, we make the top and bottom lines of the block smaller and darker.
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(cl-loop for face in '(org-block-begin-line org-block-end-line) do
|
||||||
|
(set-face-attribute face nil
|
||||||
|
:foreground "#504945"
|
||||||
|
:background "#1a1d1e"
|
||||||
|
:height 0.8
|
||||||
|
:extend t))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
** COMMENT Mode-line
|
** COMMENT Mode-line
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
@ -174,7 +218,7 @@ Ugly.
|
||||||
(telephone-line-mode t))
|
(telephone-line-mode t))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** doom-modeline
|
** COMMENT doom-modeline
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
|
||||||
|
@ -195,10 +239,7 @@ Ugly.
|
||||||
(highlight-parentheses-mode 1))
|
(highlight-parentheses-mode 1))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
* Ivy
|
||||||
* TODO NAME THIS
|
|
||||||
|
|
||||||
** Ivy
|
|
||||||
|
|
||||||
Ivy for completing stuff, etc. is huge.
|
Ivy for completing stuff, etc. is huge.
|
||||||
|
|
||||||
|
@ -214,27 +255,16 @@ Ugly.
|
||||||
("M-x". counsel-M-x))
|
("M-x". counsel-M-x))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** flx
|
|
||||||
|
|
||||||
Flx does fancy fuzzy matching with good sorting
|
Flx does fancy fuzzy matching with good sorting
|
||||||
|
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package flx
|
(use-package flx)
|
||||||
:config
|
|
||||||
)
|
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
* Projectile
|
* Projectile
|
||||||
|
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package projectile
|
(use-package projectile :config (projectile-mode t))
|
||||||
:config
|
(use-package counsel-projectile :after projectile counsel)
|
||||||
(projectile-mode t))
|
|
||||||
(use-package counsel-projectile
|
|
||||||
:after projectile counsel
|
|
||||||
:config)
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
|
@ -249,44 +279,43 @@ fix the naming for which-key
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package general
|
(use-package general
|
||||||
:config
|
:config
|
||||||
(general-evil-setup)
|
(general-evil-setup)
|
||||||
(general-def
|
(general-def
|
||||||
:states '(normal motion)
|
:states '(normal motion)
|
||||||
"SPC" nil)
|
"SPC" nil)
|
||||||
|
|
||||||
(general-create-definer elk-noleader-def
|
(general-create-definer elk-noleader-def
|
||||||
:states '(normal motion)
|
:states '(normal motion)
|
||||||
:keymaps 'override)
|
:keymaps 'override)
|
||||||
(general-create-definer elk-leader-def
|
(general-create-definer elk-leader-def
|
||||||
:prefix "SPC"
|
:prefix "SPC"
|
||||||
:states '(normal motion)
|
:states '(normal motion)
|
||||||
:keymaps 'override)
|
:keymaps 'override)
|
||||||
(elk-leader-def
|
(elk-leader-def
|
||||||
"a" 'org-agenda
|
"a" 'org-agenda
|
||||||
"s" 'org-store-link
|
"s" 'org-store-link
|
||||||
"t" '((lambda () (interactive) (org-capture nil "t")) :wk "org-capture whatever")
|
"t" '((lambda () (interactive) (org-capture nil "t")) :wk "org-capture whatever")
|
||||||
"f" '(counsel-find-file :wk "open a file")
|
"f" '(counsel-find-file :wk "open a file")
|
||||||
"1" 'delete-other-windows
|
"1" 'delete-other-windows
|
||||||
"0" 'delete-window
|
"0" 'delete-window
|
||||||
"p" '(:keymap projectile-command-map :wk "Project")
|
"p" '(:keymap projectile-command-map :wk "Project")
|
||||||
)
|
)
|
||||||
|
|
||||||
(which-key-add-key-based-replacements "SPC y" "Emacs stuff")
|
(which-key-add-key-based-replacements "SPC y" "Emacs stuff")
|
||||||
(elk-leader-def
|
(elk-leader-def
|
||||||
:prefix "SPC y"
|
:prefix "SPC y"
|
||||||
"c" '((lambda () (interactive) (find-file "~/.emacs.d/config.org")) :wk "open config.org")
|
"c" '((lambda () (interactive) (find-file "~/.emacs.d/config.org")) :wk "open config.org")
|
||||||
"r" '((lambda () (interactive) (load-file "~/.emacs.d/init.el")) :wk "reload config.org")))
|
"r" '((lambda () (interactive) (load-file "~/.emacs.d/init.el")) :wk "reload config.org")))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|
||||||
* Window management
|
* Window management
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(which-key-add-key-based-replacements "SPC b" "Window management")
|
(which-key-add-key-based-replacements "SPC b" "Window management")
|
||||||
(elk-leader-def
|
(elk-leader-def
|
||||||
:prefix "SPC b"
|
:prefix "SPC b"
|
||||||
"c" '(delete-window :wk "close window")
|
"c" '(kill-buffer-and-window :wk "close window and buffer")
|
||||||
|
"w" '(delete-window :wk "close window")
|
||||||
"f" '(counsel-buffer-or-recentf :wk "Switch to file")
|
"f" '(counsel-buffer-or-recentf :wk "Switch to file")
|
||||||
"b" '(counsel-switch-buffer :wk "Switch buffer")
|
"b" '(counsel-switch-buffer :wk "Switch buffer")
|
||||||
"o" '(counsel-switch-buffer-other-window :wk "Switch buffer in other window")
|
"o" '(counsel-switch-buffer-other-window :wk "Switch buffer in other window")
|
||||||
|
@ -296,8 +325,7 @@ fix the naming for which-key
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
* Editing
|
* Editing
|
||||||
|
** evil-mode
|
||||||
** =evil-mode=
|
|
||||||
|
|
||||||
Emacs is lacks a good editor.
|
Emacs is lacks a good editor.
|
||||||
|
|
||||||
|
@ -344,28 +372,26 @@ Emacs is lacks a good editor.
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package evil-surround
|
(use-package evil-surround
|
||||||
:ensure t
|
|
||||||
:after evil
|
:after evil
|
||||||
:config
|
:config
|
||||||
(global-evil-surround-mode t))
|
(global-evil-surround-mode t))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
** Undo-tree
|
** Undo-tree
|
||||||
|
|
||||||
Undo tree is based.
|
Undo tree is based.
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package undo-tree
|
(use-package undo-tree
|
||||||
:init
|
|
||||||
:config
|
:config
|
||||||
(global-undo-tree-mode t)
|
(global-undo-tree-mode t)
|
||||||
(setq undo-tree-auto-save-history t))
|
(setq undo-tree-auto-save-history t)
|
||||||
|
(push '("." . "~/.emacs.d/undo-tree-history") undo-tree-history-directory-alist))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|
||||||
** ace-jump
|
** ace-jump
|
||||||
|
|
||||||
|
Jump through the code faster than ever before!
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package ace-jump-mode)
|
(use-package ace-jump-mode)
|
||||||
|
@ -373,19 +399,10 @@ Undo tree is based.
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Multicursor
|
** Multicursor
|
||||||
|
Install the package and set up some binds!
|
||||||
Install the package
|
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
|
||||||
(use-package evil-mc
|
|
||||||
:config
|
|
||||||
(evil-mc-mode 1))
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
|
|
||||||
And set up some keybinds!
|
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
(use-package evil-mc :config (evil-mc-mode 1))
|
||||||
|
|
||||||
(which-key-add-key-based-replacements "SPC d" "Multicursor")
|
(which-key-add-key-based-replacements "SPC d" "Multicursor")
|
||||||
(elk-leader-def
|
(elk-leader-def
|
||||||
:prefix "SPC d"
|
:prefix "SPC d"
|
||||||
|
@ -398,27 +415,15 @@ And set up some keybinds!
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* Git integration
|
* Git integration
|
||||||
|
|
||||||
** Diff-hl gitgutter
|
** Diff-hl gitgutter
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package diff-hl
|
(use-package diff-hl :config (diff-hl-mode t))
|
||||||
:init
|
|
||||||
:config
|
|
||||||
(diff-hl-mode t))
|
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|
||||||
** Magit
|
** Magit
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package magit
|
(use-package magit)
|
||||||
:init
|
(use-package evil-magit)
|
||||||
:config
|
|
||||||
(rainbow-delimiters-mode t))
|
|
||||||
(use-package evil-magit
|
|
||||||
:init
|
|
||||||
:config
|
|
||||||
(rainbow-delimiters-mode t))
|
|
||||||
|
|
||||||
(which-key-add-key-based-replacements "SPC g" "Git shit")
|
(which-key-add-key-based-replacements "SPC g" "Git shit")
|
||||||
(elk-leader-def
|
(elk-leader-def
|
||||||
|
@ -426,39 +431,28 @@ And set up some keybinds!
|
||||||
"s" '(magit-status :wk "status"))
|
"s" '(magit-status :wk "status"))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
* Code stuff
|
* Code stuff
|
||||||
** general builtin stuff
|
** general builtin stuff
|
||||||
|
|
||||||
enable highlighting matching parentheses
|
enable highlighting matching parentheses
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(show-paren-mode 1)
|
(show-paren-mode 1)
|
||||||
(setq show-paren-delay 0)
|
(setq show-paren-delay 0)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
let's also turn lambdas into _actual_ lambdas:
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(global-prettify-symbols-mode t)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
** Rainbow everything!
|
** Rainbow everything!
|
||||||
|
because rainbows are fabulous!
|
||||||
because rainbows are fancy!
|
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package rainbow-delimiters
|
(use-package rainbow-delimiters :config (rainbow-delimiters-mode t))
|
||||||
:init
|
(use-package rainbow-blocks :config (rainbow-blocks-mode t))
|
||||||
:config
|
|
||||||
(rainbow-delimiters-mode t))
|
|
||||||
|
|
||||||
(use-package rainbow-blocks
|
|
||||||
:init
|
|
||||||
:config
|
|
||||||
(rainbow-blocks-mode t))
|
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
** Nerdcommenter
|
** Nerdcommenter
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package evil-nerd-commenter)
|
(use-package evil-nerd-commenter)
|
||||||
(which-key-add-key-based-replacements "SPC c" "Commenting")
|
(which-key-add-key-based-replacements "SPC c" "Commenting")
|
||||||
|
@ -468,14 +462,9 @@ because rainbows are fancy!
|
||||||
"c" '(evilnc-copy-and-comment-lines :wk "copy and comment"))
|
"c" '(evilnc-copy-and-comment-lines :wk "copy and comment"))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
* Language support
|
* Language support
|
||||||
|
|
||||||
** LSP-mode
|
** LSP-mode
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
|
||||||
(use-package lsp-mode
|
(use-package lsp-mode
|
||||||
:hook (;; replace XXX-mode with concrete major-mode(e. g. python-mode)
|
:hook (;; replace XXX-mode with concrete major-mode(e. g. python-mode)
|
||||||
(rustic . lsp)
|
(rustic . lsp)
|
||||||
|
@ -489,7 +478,6 @@ because rainbows are fancy!
|
||||||
(use-package dap-mode)
|
(use-package dap-mode)
|
||||||
;; (use-package dap-LANGUAGE) to load the dap adapter for your language
|
;; (use-package dap-LANGUAGE) to load the dap adapter for your language
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Rust
|
** Rust
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
@ -497,7 +485,6 @@ because rainbows are fancy!
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Lisp
|
** Lisp
|
||||||
|
|
||||||
*** parinfer
|
*** parinfer
|
||||||
|
|
||||||
Install the plugin
|
Install the plugin
|
||||||
|
@ -527,6 +514,7 @@ Also, let's integrate it with out bar:
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(defun update-parinfer-mode-status (x)
|
(defun update-parinfer-mode-status (x)
|
||||||
(setq global-mode-string (format "fuck: %s %s" x parinfer--mode)))
|
(setq global-mode-string (format "%s" x parinfer--mode)))
|
||||||
(add-hook 'parinfer-switch-mode-hook 'update-parinfer-mode-status)
|
(add-hook 'parinfer-switch-mode-hook 'update-parinfer-mode-status)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue