blob: c703702a05d978bb78617caeff34cc54c5eecc9d (
plain)
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
|
;;; td-common.el --- common configuration -*- lexical-binding: t; -*-
;;; Code:
(use-package async
:ensure t
:config
(async-bytecomp-package-mode 1))
(use-package avy
:ensure t
:bind (("C-'" . avy-goto-char-timer))
:custom
(avy-timeout-seconds 0.25))
(use-package consult
:ensure t
:demand t
:bind (("C-s" . consult-ripgrep)
("C-M-l" . consult-imenu)
("C-M-j" . consult-buffer)
("C-x C-b" . consult-buffer)
:map minibuffer-local-map
("C-r" . consult-history)))
(use-package consult-dir
:ensure t
:bind (("C-x C-d" . consult-dir)
:map vertico-map
("C-x C-d" . consult-dir)
("C-x C-j" . consult-dir-jump-file))
:custom
(consult-dir-project-list-function nil))
(use-package doom-modeline
:ensure t
:init
(doom-modeline-mode 1)
:custom
(doom-modeline-height 10)
(doom-modeline-buffer-encoding nil)
(doom-modeline-modal-icon nil))
(use-package eat
:ensure t
:bind (("C-x E" . eat))
:custom
(eat-enable-autoline-mode t))
(use-package ef-themes
:ensure t
:config
;; By default start with a light theme.
(load-theme 'ef-day t))
(use-package embark
:ensure t
:bind (("C-." . embark-act)
("M-." . embark-dwim)
("C-h B" . embark-bindings))
:config
;; Remove mixed indicator to prevent popup from being displayed automatically.
(delete #'embark-mixed-indicator embark-indicators)
(add-to-list 'embark-indicators 'embark-minimal-indicator)
;; Use embark to show command prefix help.
(setq prefix-help-command #'embark-prefix-help-command))
(use-package embark-consult
:ensure t
:after embark)
(use-package helpful
:ensure t
:custom
(counsel-describe-function-function #'helpful-callable)
(counsel-describe-variable-function #'helpful-variable)
:bind
([remap describe-function] . helpful-function)
([remap describe-command] . helpful-command)
([remap describe-symbol] . helpful-symbol)
([remap describe-variable] . helpful-variable)
([remap describe-key] . helpful-key))
(use-package marginalia
:ensure t
:after vertico
:custom
(marginalia-annotators '(marginalia-annotators-heavy
marginalia-annotators-light
nil))
:config
(marginalia-mode))
(use-package no-littering
:ensure t
:demand t
:config
;; Set custom-file to a file that won't be tracked by git.
(setq custom-file
(let ((custom-file "custom.el"))
(if (boundp 'server-socket-dir)
(expand-file-name custom-file server-socket-dir)
(no-littering-expand-etc-file-name custom-file))))
(when (file-exists-p custom-file)
(load custom-file t))
;; Don't litter project folders with backup files.
(let ((backup-dir (no-littering-expand-var-file-name "backup/")))
(make-directory backup-dir t)
(setq backup-directory-alist
`(("\\`/tmp/" . nil)
("\\`/dev/shm/" . nil)
("." . ,backup-dir))))
;; Tidy up auto-save files.
(setq auto-save-default nil)
(let ((auto-save-dir (no-littering-expand-var-file-name "auto-save/")))
(make-directory auto-save-dir t)
(setq auto-save-file-name-transforms
`(("\\`/[^/]*:\\([^/]*/\\)*\\([^/]*\\)\\'" ,(concat temporary-file-directory "\\2") t)
("\\`\\(/tmp\\|/dev/shm\\)\\([^/]*/\\)*\\(.*\\)\\'" "\\3")
("." ,auto-save-dir t)))))
(use-package savehist
:ensure t
:init
(savehist-mode))
(use-package vertico
:ensure t
:demand t
:bind (:map vertico-map
("C-j" . vertico-next)
("C-k" . vertico-previous)
("C-f" . vertico-exit-input)
:map minibuffer-local-map
("M-h" . vertico-directory-up))
:custom
(vertico-cycle t)
:config
(require 'vertico-directory)
(vertico-mode))
(use-package which-key
:ensure t
:defer 0
:diminish which-key-mode
:config
(setq which-key-idle-delay 0.5)
(which-key-mode))
(provide 'td-common)
;;; td-common.el ends here
|