-33
.config/doom/config.el
-33
.config/doom/config.el
···
1
-
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
2
-
3
-
(setq doom-font (font-spec :family "BerkeleyMono Nerd Font" :size 14))
4
-
(add-to-list 'default-frame-alist '(height . 58))
5
-
(add-to-list 'default-frame-alist '(width . 140))
6
-
7
-
(setq doom-theme 'kanagawa)
8
-
(setq kanagawa-theme-comment-italic nil)
9
-
(setq kanagawa-theme-keyword-italic nil)
10
-
11
-
(setq display-line-numbers-type t)
12
-
13
-
(setq org-directory "~/org/")
14
-
15
-
(setq-default indent-tabs-mode nil)
16
-
(setq-default tab-width 4)
17
-
(setq c-basic-offset 4)
18
-
(setq scroll-margin 10)
19
-
20
-
(fset 'rainbow-delimiters-mode #'ignore)
21
-
22
-
(+global-word-wrap-mode +1)
23
-
24
-
(map! :desc "Next buffer" :n "L" #'next-buffer)
25
-
(map! :desc "Next buffer" :n "H" #'previous-buffer)
26
-
27
-
(setq tab-always-indent t)
28
-
(setq select-enable-clipboard nil)
29
-
30
-
(setq doom-modeline-modal-modern-icon nil)
31
-
32
-
(remove-hook 'doom-first-buffer-hook #'smartparens-global-mode)
33
-
-193
.config/doom/init.el
-193
.config/doom/init.el
···
1
-
;;; init.el -*- lexical-binding: t; -*-
2
-
3
-
;; This file controls what Doom modules are enabled and what order they load
4
-
;; in. Remember to run 'doom sync' after modifying it!
5
-
6
-
;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's
7
-
;; documentation. There you'll find a link to Doom's Module Index where all
8
-
;; of our modules are listed, including what flags they support.
9
-
10
-
;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or
11
-
;; 'C-c c k' for non-vim users) to view its documentation. This works on
12
-
;; flags as well (those symbols that start with a plus).
13
-
;;
14
-
;; Alternatively, press 'gd' (or 'C-c c d') on a module to browse its
15
-
;; directory (for easy access to its source code).
16
-
17
-
(doom! :input
18
-
;;bidi ; (tfel ot) thgir etirw uoy gnipleh
19
-
;;chinese
20
-
;;japanese
21
-
;;layout ; auie,ctsrnm is the superior home row
22
-
23
-
:completion
24
-
;;company ; the ultimate code completion backend
25
-
(corfu +orderless +icons) ; complete with cap(f), cape and a flying feather!
26
-
;;helm ; the *other* search engine for love and life
27
-
;;ido ; the other *other* search engine...
28
-
;;ivy ; a search engine for love and life
29
-
(vertico +icons) ; the search engine of the future
30
-
31
-
:ui
32
-
;;deft ; notational velocity for Emacs
33
-
doom ; what makes DOOM look the way it does
34
-
doom-dashboard ; a nifty splash screen for Emacs
35
-
;; doom-quit ; DOOM quit-message prompts when you quit Emacs
36
-
;;(emoji +unicode) ; 🙂
37
-
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
38
-
;;indent-guides ; highlighted indent columns
39
-
;;ligatures ; ligatures and symbols to make your code pretty again
40
-
;;minimap ; show a map of the code on the side
41
-
modeline ; snazzy, Atom-inspired modeline, plus API
42
-
;;nav-flash ; blink cursor line after big motions
43
-
;;neotree ; a project drawer, like NERDTree for vim
44
-
ophints ; highlight the region an operation acts on
45
-
(popup +defaults) ; tame sudden yet inevitable temporary windows
46
-
;;tabs ; a tab bar for Emacs
47
-
;;treemacs ; a project drawer, like neotree but cooler
48
-
unicode ; extended unicode support for various languages
49
-
(vc-gutter +pretty) ; vcs diff in the fringe
50
-
vi-tilde-fringe ; fringe tildes to mark beyond EOB
51
-
;;window-select ; visually switch windows
52
-
workspaces ; tab emulation, persistence & separate workspaces
53
-
;;zen ; distraction-free coding or writing
54
-
55
-
:editor
56
-
(evil +everywhere); come to the dark side, we have cookies
57
-
file-templates ; auto-snippets for empty files
58
-
;;fold ; (nigh) universal code folding
59
-
(format +onsave) ; automated prettiness
60
-
;;god ; run Emacs commands without modifier keys
61
-
;;lispy ; vim for lisp, for people who don't like vim
62
-
;;multiple-cursors ; editing in many places at once
63
-
;;objed ; text object editing for the innocent
64
-
;;parinfer ; turn lisp into python, sort of
65
-
;;rotate-text ; cycle region at point between text candidates
66
-
snippets ; my elves. They type so I don't have to
67
-
word-wrap ; soft wrapping with language-aware indent
68
-
69
-
:emacs
70
-
dired ; making dired pretty [functional]
71
-
electric ; smarter, keyword-based electric-indent
72
-
;;ibuffer ; interactive buffer management
73
-
undo ; persistent, smarter undo for your inevitable mistakes
74
-
vc ; version-control and Emacs, sitting in a tree
75
-
76
-
:term
77
-
;;eshell ; the elisp shell that works everywhere
78
-
;;shell ; simple shell REPL for Emacs
79
-
;;term ; basic terminal emulator for Emacs
80
-
;;vterm ; the best terminal emulation in Emacs
81
-
82
-
:checkers
83
-
syntax ; tasing you for every semicolon you forget
84
-
;;(spell +flyspell) ; tasing you for misspelling mispelling
85
-
;;grammar ; tasing grammar mistake every you make
86
-
87
-
:tools
88
-
;;ansible
89
-
;;biblio ; Writes a PhD for you (citation needed)
90
-
;;collab ; buffers with friends
91
-
;;debugger ; FIXME stepping through code, to help you add bugs
92
-
;;direnv
93
-
;;docker
94
-
;;editorconfig ; let someone else argue about tabs vs spaces
95
-
;;ein ; tame Jupyter notebooks with emacs
96
-
(eval +overlay) ; run code, run (also, repls)
97
-
lookup ; navigate your code and its documentation
98
-
lsp ; M-x vscode
99
-
;;magit ; a git porcelain for Emacs
100
-
;;make ; run make tasks from Emacs
101
-
;;pass ; password manager for nerds
102
-
;;pdf ; pdf enhancements
103
-
;;prodigy ; FIXME managing external services & code builders
104
-
;;terraform ; infrastructure as code
105
-
106
-
;;tmux ; an API for interacting with tmux
107
-
;;tree-sitter ; syntax and parsing, sitting in a tree...
108
-
;;upload ; map local to remote projects via ssh/ftp
109
-
110
-
:os
111
-
(:if (featurep :system 'macos) macos) ; improve compatibility with macOS
112
-
tty ; improve the terminal Emacs experience
113
-
114
-
:lang
115
-
;;agda ; types of types of types of types...
116
-
;;beancount ; mind the GAAP
117
-
(cc +lsp) ; C > C++ == 1
118
-
;;clojure ; java with a lisp
119
-
;;common-lisp ; if you've seen one lisp, you've seen them all
120
-
;;coq ; proofs-as-programs
121
-
;;crystal ; ruby at the speed of c
122
-
;;csharp ; unity, .NET, and mono shenanigans
123
-
;;data ; config/data formats
124
-
;;(dart +flutter) ; paint ui and not much else
125
-
;;dhall
126
-
;;elixir ; erlang done right
127
-
;;elm ; care for a cup of TEA?
128
-
emacs-lisp ; drown in parentheses
129
-
;;erlang ; an elegant language for a more civilized age
130
-
;;ess ; emacs speaks statistics
131
-
;;factor
132
-
;;faust ; dsp, but you get to keep your soul
133
-
;;fortran ; in FORTRAN, GOD is REAL (unless declared INTEGER)
134
-
;;fsharp ; ML stands for Microsoft's Language
135
-
;;fstar ; (dependent) types and (monadic) effects and Z3
136
-
;;gdscript ; the language you waited for
137
-
;;(go +lsp) ; the hipster dialect
138
-
;;(graphql +lsp) ; Give queries a REST
139
-
;;(haskell +lsp) ; a language that's lazier than I am
140
-
;;hy ; readability of scheme w/ speed of python
141
-
;;idris ; a language you can depend on
142
-
;;json ; At least it ain't XML
143
-
;;(java +lsp) ; the poster child for carpal tunnel syndrome
144
-
;;javascript ; all(hope(abandon(ye(who(enter(here))))))
145
-
;;julia ; a better, faster MATLAB
146
-
;;kotlin ; a better, slicker Java(Script)
147
-
;;latex ; writing papers in Emacs has never been so fun
148
-
;;lean ; for folks with too much to prove
149
-
;;ledger ; be audit you can be
150
-
;;lua ; one-based indices? one-based indices
151
-
markdown ; writing docs for people to ignore
152
-
;;nim ; python + lisp at the speed of c
153
-
;;nix ; I hereby declare "nix geht mehr!"
154
-
;;ocaml ; an objective camel
155
-
org ; organize your plain life in plain text
156
-
;;php ; perl's insecure younger brother
157
-
;;plantuml ; diagrams for confusing people more
158
-
;;purescript ; javascript, but functional
159
-
;;python ; beautiful is better than ugly
160
-
;;qt ; the 'cutest' gui framework ever
161
-
;;racket ; a DSL for DSLs
162
-
;;raku ; the artist formerly known as perl6
163
-
;;rest ; Emacs as a REST client
164
-
;;rst ; ReST in peace
165
-
;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
166
-
(rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
167
-
;;scala ; java, but good
168
-
;;(scheme +guile) ; a fully conniving family of lisps
169
-
sh ; she sells {ba,z,fi}sh shells on the C xor
170
-
;;sml
171
-
;;solidity ; do you need a blockchain? No.
172
-
;;swift ; who asked for emoji variables?
173
-
;;terra ; Earth and Moon in alignment for performance.
174
-
;;web ; the tubes
175
-
yaml ; JSON, but readable
176
-
(zig +lsp) ; C, but simpler
177
-
178
-
:email
179
-
;;(mu4e +org +gmail)
180
-
;;notmuch
181
-
;;(wanderlust +gmail)
182
-
183
-
:app
184
-
;;calendar
185
-
;;emms
186
-
;;everywhere ; *leave* Emacs!? You must be joking
187
-
;;irc ; how neckbeards socialize
188
-
;;(rss +org) ; emacs as an RSS reader
189
-
190
-
:config
191
-
;;literate
192
-
(default +bindings +smartparens))
193
-
-1
.config/doom/packages.el
-1
.config/doom/packages.el
···
1
-
(package! autothemer)
+1
.config/doom/themes/kanagawa-theme.el
.config/emacs/kanagawa-theme.el
+1
.config/doom/themes/kanagawa-theme.el
.config/emacs/kanagawa-theme.el
+217
.config/emacs/init.el
+217
.config/emacs/init.el
···
1
+
;;;;;;;;;;;
2
+
;; UTILS ;;
3
+
;;;;;;;;;;;
4
+
(defun conf-dir(path) (concat user-emacs-directory path))
5
+
6
+
;;;;;;;;;;;;;;;;;;;;
7
+
;; REROUTE CUSTOM ;;
8
+
;;;;;;;;;;;;;;;;;;;;
9
+
(setq custom-file (conf-dir "emacs.custom.el"))
10
+
(when (file-exists-p custom-file)
11
+
(load-file custom-file))
12
+
13
+
;;;;;;;;;;;;;;;;;;;;;;;;;;
14
+
;; PACKAGE REPOSITORIES ;;
15
+
;;;;;;;;;;;;;;;;;;;;;;;;;;
16
+
(require 'package)
17
+
(add-to-list 'package-archives
18
+
'("melpa" . "https://melpa.org/packages/") t)
19
+
20
+
;;;;;;;;;;;;;;;;;;;;
21
+
;; BASIC SETTINGS ;;
22
+
;;;;;;;;;;;;;;;;;;;;
23
+
(tool-bar-mode -1)
24
+
(menu-bar-mode -1)
25
+
(scroll-bar-mode -1)
26
+
(global-display-line-numbers-mode 1)
27
+
(setq inhibit-splash-screen t)
28
+
(setq initial-scratch-message nil)
29
+
(setq ring-bell-function 'ignore)
30
+
(setq backup-directory-alist '(("." . (conf-dir "backup/"))))
31
+
(setq-default indent-tabs-mode nil)
32
+
(setq-default tab-width 4)
33
+
(setq c-basic-offset 4)
34
+
(setq scroll-margin 10)
35
+
(setq select-enable-clipboard nil)
36
+
37
+
;;;;;;;;;;;;;;;;
38
+
;; APPEARANCE ;;
39
+
;;;;;;;;;;;;;;;;
40
+
(set-frame-font "TX-02 13" nil t)
41
+
(use-package autothemer
42
+
:ensure t)
43
+
(use-package cl-lib
44
+
:ensure t)
45
+
(load-file (conf-dir "kanagawa-theme.el"))
46
+
(load-theme 'kanagawa)
47
+
48
+
49
+
;;;;;;;;;;;;;;;;;
50
+
;; EVIL CONFIG ;;
51
+
;;;;;;;;;;;;;;;;;
52
+
(use-package evil
53
+
:ensure t
54
+
:init
55
+
(setq evil-want-C-u-scroll t)
56
+
(setq evil-undo-system 'undo-redo)
57
+
(setq evil-want-integration t)
58
+
(setq evil-want-keybinding nil)
59
+
(defun kill-current-buffer() (interactive) (kill-buffer (current-buffer)))
60
+
(defun kill-other-buffers()
61
+
(interactive)
62
+
(dolist (elt (buffer-list))
63
+
(when (not (eql elt (current-buffer)))
64
+
(message "Closing " (buffer-name elt))
65
+
(kill-buffer elt))))
66
+
:config
67
+
(evil-mode 1)
68
+
(evil-define-operator yank-to-plus-register (beg end &optional type register yank-handler)
69
+
"Yank characters to the + register"
70
+
:move-point nil
71
+
:repeat nil
72
+
(interactive "<R><x><y>")
73
+
(evil-yank beg end type ?+ yank-handler))
74
+
(evil-set-leader '(normal visual replace operator) (kbd "SPC"))
75
+
(evil-define-key 'normal 'global
76
+
(kbd "<leader>.") 'find-file
77
+
(kbd "<leader>bb") 'switch-to-buffer
78
+
(kbd "<leader>bs") 'consult-buffer
79
+
(kbd "<leader>bB") 'project-switch-to-buffer
80
+
(kbd "<leader>bd") 'kill-current-buffer
81
+
(kbd "<leader>bD") 'kill-buffer
82
+
(kbd "<leader>bo") 'kill-other-buffers
83
+
(kbd "<leader>SPC") 'project-find-file
84
+
(kbd "<leader>he") 'eval-buffer
85
+
(kbd "<leader>hf") 'describe-function
86
+
(kbd "<leader>hv") 'describe-variable
87
+
(kbd "<leader>cc") 'compile
88
+
(kbd "<leader>cf") 'format-all-buffer
89
+
(kbd "<leader>cF") 'format-all-region
90
+
(kbd "<leader>sg") 'consult-ripgrep
91
+
(kbd "<leader>sf") 'consult-fd
92
+
(kbd "<leader>sb") 'consult-line
93
+
(kbd "<leader>sB") 'consult-line-multi
94
+
(kbd "<leader>p") "\"+p"
95
+
(kbd "<leader>P") "\"+P"
96
+
(kbd "<leader>y") 'yank-to-plus-register
97
+
(kbd "<leader>Y") "\"+yy"
98
+
(kbd "<leader>gs") 'git-gutter:popup-hunk
99
+
(kbd "<leader>gr") 'git-gutter:revert-hunk
100
+
(kbd "<leader>gu") 'git-gutter
101
+
(kbd "<leader>mu") 'toggle-frame-maximized
102
+
(kbd "[c") 'git-gutter:previous-hunk
103
+
(kbd "]c") 'git-gutter:next-hunk
104
+
(kbd "L") 'evil-next-buffer
105
+
(kbd "H") 'evil-prev-buffer
106
+
(kbd "gC") 'comment-box
107
+
(kbd "C-h") 'evil-window-left
108
+
(kbd "C-j") 'evil-window-down
109
+
(kbd "C-k") 'evil-window-up
110
+
(kbd "C-l") 'evil-window-right))
111
+
(use-package evil-collection
112
+
:after evil
113
+
:ensure t
114
+
:config
115
+
(evil-collection-init))
116
+
(use-package evil-surround
117
+
:after evil
118
+
:ensure t
119
+
:config
120
+
(global-evil-surround-mode 1))
121
+
(use-package evil-commentary
122
+
:after evil
123
+
:ensure t
124
+
:config
125
+
(evil-commentary-mode))
126
+
(use-package evil-goggles
127
+
:ensure t
128
+
:init
129
+
(setq evil-goggles-duration 0.05)
130
+
:config
131
+
(evil-goggles-mode))
132
+
133
+
;;;;;;;;;;;;;;;;;;;;;;;
134
+
;; COMPLETION CONFIG ;;
135
+
;;;;;;;;;;;;;;;;;;;;;;;
136
+
(use-package vertico
137
+
:ensure t
138
+
:custom
139
+
(vertico-cycle t)
140
+
:config
141
+
(vertico-mode))
142
+
143
+
(use-package corfu
144
+
:ensure t
145
+
:init
146
+
(define-key corfu-map (kbd "C-n") 'corfu-next)
147
+
(define-key corfu-map (kbd "C-p") 'corfu-previous)
148
+
(define-key corfu-map (kbd "C-l") 'corfu-insert)
149
+
(define-key corfu-map (kbd "C-e") 'corfu-reset)
150
+
(setq corfu-auto t)
151
+
(global-corfu-mode))
152
+
(use-package cape
153
+
:ensure t
154
+
:bind ("C-c p" . cape-prefix-map)
155
+
:init
156
+
(add-hook 'completion-at-point-functions #'cape-dabbrev)
157
+
(add-hook 'completion-at-point-functions #'cape-file)
158
+
(add-hook 'completion-at-point-functions #'cape-keyword))
159
+
160
+
;;;;;;;;;;;;;;;;;;;;
161
+
;; LANGUAGE MODES ;;
162
+
;;;;;;;;;;;;;;;;;;;;
163
+
(use-package cmake-mode :ensure t)
164
+
(use-package toml-mode :ensure t)
165
+
(use-package zig-mode :ensure t)
166
+
(use-package rust-mode :ensure t)
167
+
(mapc 'load (file-expand-wildcards (conf-dir "local-modes/*.el")))
168
+
169
+
170
+
;;;;;;;;;;;;;;;;;;;;
171
+
;; OTHER PACKAGES ;;
172
+
;;;;;;;;;;;;;;;;;;;;
173
+
(use-package which-key
174
+
:ensure t
175
+
:config
176
+
(which-key-mode))
177
+
178
+
(use-package consult
179
+
:ensure t
180
+
:hook (completion-list-mode . consult-preview-at-point-mode)
181
+
)
182
+
183
+
(use-package hl-todo
184
+
:ensure t
185
+
:hook (prog-mode . hl-todo-mode)
186
+
:config
187
+
(setq hl-todo-highlight-punctuation ":"
188
+
hl-todo-keyword-faces
189
+
`(("TODO" warning bold)
190
+
("FIXME" error bold)
191
+
("HACK" font-lock-constant-face bold)
192
+
("REVIEW" font-lock-keyword-face bold)
193
+
("NOTE" success bold)
194
+
("DEPRECATED" font-lock-doc-face bold))))
195
+
196
+
(use-package git-gutter
197
+
:ensure t
198
+
:config
199
+
(global-git-gutter-mode +1))
200
+
201
+
(use-package language-id
202
+
:ensure t
203
+
:vc (:url "https://github.com/lassik/emacs-language-id"))
204
+
(use-package format-all
205
+
:ensure t
206
+
:after language-id
207
+
:commands format-all-mode
208
+
:hook (prog-mode . format-all-mode)
209
+
:config)
210
+
211
+
212
+
(use-package emacs
213
+
:custom
214
+
(enable-recursive-minibuffers t)
215
+
(tab-always-indent 'complete)
216
+
(read-extended-command-predicate #'command-completion-default-include-p))
217
+