-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.el
188 lines (139 loc) · 4.59 KB
/
init.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
(defconst my-local-dir (expand-file-name "local/" user-emacs-directory))
(defconst my-lisp-dir (expand-file-name "lisp/" user-emacs-directory))
(defconst my-cache-dir (expand-file-name "cache/" user-emacs-directory))
(add-to-list 'load-path my-lisp-dir)
(add-to-list 'load-path (expand-file-name "core/" user-emacs-directory))
(add-to-list 'load-path (expand-file-name "modules/" user-emacs-directory))
(require 'init-bootstrap-straight)
(require 'init-gc)
(require 'init-ui)
(require 'init-editor)
(require 'init-keybindings)
(require 'init-email)
(require 'init-files)
(require 'init-completion)
(require 'module-completion)
(require 'module-org)
(require 'module-git)
(require 'module-dev)
(require 'module-ai)
(require 'module-go)
(require 'module-terraform)
;; MOUSE
(setq mouse-autoselect-window nil)
(setq mouse-yank-at-point t)
(setq make-pointer-invisible nil)
;; direnv
(use-package direnv :straight t
:init
(direnv-mode))
(use-package flycheck :straight t
:hook (emacs-lisp . flycheck-mode))
(use-package flyspell
:commands (flyspell-mode flyspell-prog-mode)
:after ispell
:hook ((text-mode . turn-on-flyspell)
(prog-mode . flyspell-prog-mode)))
(use-package ag :straight t
:config
(defun mr/ag-project-with-thing-at-point ()
(interactive)
(let ((thing (thing-at-point 'symbol)))
(ag-project thing))))
;;
;; Languages
;;
(use-package nix-mode :straight t
:config
(defun nix-update () (interactive)
(let ((default-directory "/sudo::"))
(compile "nixos-rebuild switch --flake '/home/bag/src/nixos/src#'")))
:bind (:map nix-mode-map ("C-c C-c" . nix-update)))
;; Stuff
(add-hook 'after-save-hook
'executable-make-buffer-file-executable-if-script-p)
(use-package yaml-ts-mode
:mode "\\.ya?ml\\'")
(use-package highlight-indent-guides :straight t
:config
(setq highlight-indent-guides-method 'character)
:hook (yaml-ts-mode . highlight-indent-guides-mode))
(use-package jsonnet-mode :straight t)
(use-package python
:init
(setq-default indent-tabs-mode nil)
:config
(setq python-indent-offset 4)
:hook
(python-mode . (lambda ()
(setq-local compile-command (concat "python " buffer-file-name))))
:bind (:map python-mode-map
("C-c C-c" . compile)))
(use-package rust-ts-mode
:mode "\\.rs\\'"
:hook
(rust-ts-mode . (lambda ()
(setq-local compile-command "cargo test -- --nocapture")))
:bind (:map rust-ts-mode-map
("C-c C-c" . compile)))
(use-package sudo-edit :straight t)
(use-package elisp
:bind (:map emacs-lisp-mode-map
("C-c C-c" . eval-buffer)))
(use-package tramp
:config
(add-to-list 'tramp-methods
'("gcssh"
(tramp-login-program "gcloud")
(tramp-login-args (("compute ssh --tunnel-through-iap") ("%h") ("--ssh-flag='-l %u'")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/bash")
(tramp-remote-shell-args ("-c"))
(tramp-default-port 22))))
(use-package ledger-mode :straight t)
(use-package markdown
:hook
(markdown-mode . visual-line-mode)
(markdown-mode . flyspell-mode))
(use-package copy-as-format :straight t)
(use-package use-package-chords :straight t
:init (key-chord-mode 1))
(use-package "window"
:chords ((" 0" . delete-window)
(" 1" . delete-other-windows)
(" 2" . split-window-below)
(" 3" . split-window-right)))
(use-package csv-mode :straight t)
(use-package server
:config
(unless (server-running-p)
(server-start)))
(use-package rego-mode :straight t)
(defun insert-quotes (&optional arg)
(interactive "P")
(insert-pair arg ?\" ?\"))
(setq compilation-read-command nil)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(auth-source-save-behavior nil)
'(org-trello-current-prefix-keybinding "C-c o" nil (org-trello)))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
(use-package pdf-tools :straight t)
(use-package treesit-fold
:straight (treesit-fold :type git :host github :repo "emacs-tree-sitter/treesit-fold")
:init
(global-treesit-fold-mode)
:bind
("C-x f c" . treesit-fold-close)
("C-x f o" . treesit-fold-open)
("C-x f a c" . treesit-fold-close-all)
("C-x f a o" . treesit-fold-open-all))
(use-package pass :straight t)