-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.el
261 lines (228 loc) · 7.33 KB
/
config.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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
;; Place your private configuration here! Remember, you do not need to run 'doom
;; sync' after modifying this file!
;;; this needs to be first, otherwise any error in our config will reset recentf
(require 'recentf)
(after! recentf
;;;
;; (customize-set-variable 'recentf-auto-cleanup 3600)
;; Cleanup each time Emacs has been idle that number of seconds.
(customize-set-variable 'recentf-auto-cleanup 'never)
;; We do the cleanup ourselves.
;;;
(setq recentf-max-saved-items 50000)
(recentf-load-list)
;; @seeAlso [[./autoload/night-recentf.el]]
)
;;;
(defmacro mycomment (&rest a)
t)
(defmacro comment (&rest body)
"Comment out one or more s-expressions."
nil)
;;;
(defun night/nop (&rest dummy))
;;;
(message "TERM: %s" (getenv "TERM"))
;;;
(require 'cl-extra)
(require 's)
(require 'f)
(require 'server)
(setq server-socket-dir (concat (getenv "HOME") "/tmp/.emacs-servers"))
;; This directory is created by [help:server-ensure-safe-dir] automatically.
;; see also `server-name`
(defun night/server-name-set-auto ()
(interactive)
(setq server-name (let ((sn (getenv "emacs_night_server_name")))
(cond
((and sn (not (cl-equalp sn "")))
sn)
(t "server"))))
server-name
;;;
;; (or
;; (and (boundp 'server-name) server-name (not (cl-equalp server-name "")) server-name)
;; (getenv "EMACS_SERVER_NAME")
;; (getenv "EMACS_SERVER_NAME"))
)
(night/server-name-set-auto)
(defun night/server-alt1-p ()
(interactive)
(and (boundp 'server-name)
(s-ends-with-p "_alt1" server-name)))
(defun night/darwin-p ()
(interactive)
(cl-equalp (symbol-name system-type) "darwin"))
(defun night/local-p ()
(interactive)
(or
(night/darwin-p)))
(defun night/remote-p ()
(interactive)
(not (night/local-p)))
(defun night/pino-p ()
(interactive)
(cl-equalp (system-name) "Pinocchio"))
(defun night/lilf-p ()
(interactive)
(cl-equalp (system-name) "lilf.ir"))
(defun night/t31-p ()
(interactive)
(cl-equalp (system-name) "t31-gpu13"))
(defun night/t21-p ()
(interactive)
(cl-equalp (system-name) "t21-gpu6"))
(defun night/m17-p ()
(interactive)
(cl-equalp (system-name) "m17"))
(defun night/m15-p ()
(interactive)
(cl-equalp (system-name) "m15"))
(defun night/c0-p ()
(interactive)
(cl-equalp (system-name) "Taher"))
(defun night/system-name ()
(cond
;; ((night/local-p) "Local")
((night/pino-p) "Pino")
((night/t31-p) "T31")
((night/t21-p) "T21")
(t (system-name))))
(when (not (server-running-p))
(cond
((night/server-alt1-p)
;; (night/unadvice #'ivy--switch-buffer-action)
(advice-add #'ivy--switch-buffer-action :after #'night/irc-maybe-show-count-ni))
;; @note +irc--ivy-switch-to-buffer-action will also call ivy--switch-buffer-action
)
(server-start))
;;;
;; Some functionality uses this to identify you, e.g. GPG configuration, email
;; clients, file templates and snippets.
(setq user-full-name "Fereidoon"
user-mail-address "rudiwillalwaysloveyou@gmail.com")
;; Doom exposes five (optional) variables for controlling fonts in Doom. Here
;; are the three important ones:
;;
;; + `doom-font'
;; + `doom-variable-pitch-font'
;; + `doom-big-font' -- used for `doom-big-font-mode'; use this for
;; presentations or streaming.
;;
;; They all accept either a font-spec, font string ("Input Mono-12"), or xlfd
;; font string. You generally only need these two:
;; (setq doom-font (font-spec :family "monospace" :size 29))
(setq doom-font (font-spec :family "Fira Mono" :size 29))
;; There are two ways to load a theme. Both assume the theme is installed and
;; available. You can either set `doom-theme' or manually load a theme with the
;; `load-theme' function. This is the default:
(progn
(require 'doom-themes-ext-org) ;; @workaround for upstream bugs
(require 'solarized-theme)
(require 'humanoid-themes)
(require 'kaolin-themes)
;; (require 'spacemacs-theme)
(require 'apropospriate-theme)
(require 'darktooth-theme)
(require 'rebecca-theme)
(require 'solo-jazz-theme)
(require 'github-theme)
(require 'night-owl-theme)
(require 'colorless-themes)
(require 'leuven-theme)
(require 'base16-theme)
(require 'anti-zenburn-theme)
(require 'moe-theme)
(require 'poet-theme)
(require 'zaiste-theme)
(require 'modus-themes)
(require 'ef-themes)
(require 'material-theme)
(require 'tao-theme)
(require 'organic-green-theme)
(require 'color-theme-sanityinc-tomorrow))
(cond
((night/lilf-p)
(setq night-theme
'ef-frost
))
((night/pino-p)
(setq night-theme
'modus-operandi-deuteranopia
))
((night/t31-p)
(setq night-theme
'modus-operandi-tinted
))
((night/t21-p)
(setq night-theme
'modus-operandi-tinted
))
((night/m15-p)
(setq night-theme
'sanityinc-tomorrow-day
))
((night/m17-p)
(setq night-theme
'ef-day
))
((night/c0-p)
(setq night-theme
'ef-cyprus
))
(;; nil
(night/server-alt1-p)
;; (setq night-theme 'doom-one-light)
;; [[id:c0713162-d1bd-46fc-9ef4-f5495d7ff16f][doom/bugs, issues:@upstreamBug hlissner/doom-emacs#5629 {BUG} Some themes fail to build]]
(setq night-theme 'solarized-selenized-white)
;; (setq night-theme 'tsdh-light)
;; (setq night-theme 'solarized-light)
)
((display-graphic-p)
(setq night-theme
'modus-operandi-tritanopia
;; 'kaolin-light
;; 'solarized-selenized-white
;; 'doom-one-light
;; 'humanoid-light
;; 'doom-nord-light (has some bad color choices for orgmode)
;; 'doom-ayu-light
;; 'doom-one-light
))
(t
(setq night-theme
'modus-operandi-tritanopia
;; 'kaolin-light
)
;; (setq night-theme 'solarized-light)
;; (setq night-theme 'solarized-selenized-light) ;; @good
;; (setq night-theme 'doom-solarized-light) ; subtly different
))
(setq doom-theme night-theme)
;; If you use `org' and don't want your org files in the default location below,
;; change `org-directory'. It must be set before org loads!
(setq org-directory (concat (getenv "cellar") "/notes/org"))
(setq night/roam-p nil)
;; This determines the style of line numbers in effect. If set to `nil', line
;; numbers are disabled. For relative line numbers, set this to `relative'.
(setq display-line-numbers-type 'relative)
;; Here are some additional functions/macros that could help you configure Doom:
;;
;; - `load!' for loading external *.el files relative to this one
;; - `use-package' for configuring packages
;; - `after!' for running code after a package has loaded
;; - `add-load-path!' for adding directories to the `load-path', relative to
;; this file. Emacs searches the `load-path' when you load packages with
;; `require' or `use-package'.
;; - `map!' for binding new keys
;;
;; To get information about any of these functions/macros, move the cursor over
;; the highlighted symbol at press 'K' (non-evil users must press 'C-c g k').
;; This will open documentation for it, including demos of how they are used.
;;
;; You can also try 'gd' (or 'C-c g d') to jump to their definition and see how
;; they are implemented.
;; #spacemacs config imported
(setq evil-respect-visual-line-mode nil)
(load! "night-loader.el")