-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.el
532 lines (472 loc) · 19.2 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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
;; =================================================================================================
;;
;; Filename: config.el
;; Author: G S Derber
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or (at
;; your option) any later version.
;;
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;
;; =================================================================================================
;; Provide a useful error trace if loading this monster fails.
(setq debug-on-error t)
;;;;; Global Settings ;;;;;
(savehist-mode 1)
(setq-default display-time-24hr-format 't
display-time-day-and-date 't
display-time-mode 't
;;size-indication-mode t
scroll-bar-mode 'right
)
;; Miscellaneous settings
;; All settings clicked in the Options menu are saved here by Emacs.
;;(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.
;; '(column-number-mode t)
;; '(cookie-file "/usr/share/games/fortunes/startrek")
;; '(line-number-mode t)
;; '(display-battery-mode t)
;; '(display-time-default-load-average t)
;; '(display-time-mail-file (quote none))
;;'(indicate-buffer-boundaries (quote ((t . right) (top . left))))
;;'(inhibit-startup-screen t)
;;'(indicate-empty-lines t)
;;'(save-place t nil (saveplace))
;;'(show-paren-mode t) ;; Show matched Parens
;;'(text-mode-hook (quote (turn-on-auto-fill text-mode-hook-identify)))
;;'(uniquify-buffer-name-style (quote forward) nil (uniquify))
;; Backup Settings
;;'(backup-directory-alist '(("." . "~/.emacs.d/backups")))
;;'(delete-old-versions -1)
;;'(version-control t)
;;'(vc-make-backup-files t)
;;'(auto-save-file-name-transforms '((".*" "~/.emacs.d/auto-save-list/" t)))
;; http://www.wisdomandwonder.com/wp-content/uploads/2014/03/C3F.html
;;'(savehist-file "~/.emacs.d/savehist")
;;'(history-length t)
;;'(history-delete-duplicates t)
;;'(savehist-save-minibuffer-history 1)
;;'(savehist-additional-variables
;; '(kill-ring
;; search-ring
;; regexp-search-ring))
;; '(package-selected-packages
;; (quote
;; (which-key undo-tree hydra evil-unimpaired async aggressive-indent adaptive-wrap ace-window)))
;; End Sentences with 2 spaces
;;'(sentence-end-double-space t)
;; ;; ORG
;; ;; Files and Directories
;; ;;'(org-journal-date-format "%e %b %Y (%A)")
;; ;;'(org-journal-time-format "")
;; '(org-archive-location "~/Documents/Org/archive.org")
;; ;; Agenda Settings
;; '()
;; '(org-agenda-show-all-dates t)
;; '(org-agenda-start-on-weekday nil)
;; '(org-agenda-include-diary t)
;; '(org-agenda-skip-deadline-if-done t)
;; '(org-agenda-skip-scheduled-if-done t)
;; '(org-agenda-skip-timestamp-if-done t)
;; '(org-reverse-note-order t)
;; '(org-agenda-sorting-strategy '((agenda time-up ts-up habit-down priority-down category-keep)
;; (todo priority-down category-keep)
;; (tags priority-down category-keep)
;; (search category-keep)))
;; ;; Logging / Habit Tracking
;; '(org-log-into-drawer "LOGBOOK")
;; '(org-log-done-with-time t)
;; '(org-log-states-order-reversed t)
;; '(org-log-redeadline t)
;; '(org-log-reschedule '(time))
;; '(org-log-redeadline '(time))
;; '(org-fast-tag-selection-single-key (quote expert))
;; '(org-use-fast-todo-selection t)
;; '(org-treat-S-cursor-todo-selection-as-state-change nil)
;; ;; Todo Settings
;; '(org-enforce-todo-dependencies t)
;; '(org-enforce-todo-checkbox-dependencies t)
;; '(org-deadline-warning-days 14)
;; ;; Prepare for export backends
;; '(org-export-backends '(org latex icalendar html ascii))
;;)
;; Org Mode
(setq org-directory "~/Documents/Org/"
org-agenda-files (list org-directory)
org-agenda-ndays 14)
;;(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.
;; )
(setq-default fill-column 100)
;;(setq global-font-lock-mode t) ; Enable syntax-highlighting
;;(setq font-lock-maximum-decoration t)
(setq indent-tabs-mode nil) ; Use spaces instead of tabs for indentation.
(setq tab-width 4) ; Set tab width to 4
(setq default-tab-width 4) ; Required by graphviz-dot-mode
(setq transient-mark-mode t) ;where's that selection?
(setq mouse-yank-at-point t) ;paste at point NOT at cursor
;;(setq next-line-add-newlines nil) ;no newlines if I cursor past EOF.
(setq require-final-newline 't) ; Always newline at end of file
;;(setq minibuffer-max-depth nil) ;enable multiple minibuffers:
;I didn't understand this for a long time - if you don't set this,
;you can't do things like search the minibuffer history with M-s
;(cause that requires another minibuffer)
(setq browse-url-browser-function ;call netscape on URLs.
(quote browse-url-firefox))
;; Neotree settings:
;; (when (display-graphic-p)
;; (setq neo-theme icons)
;; (setq neo-vc-integration face)
;; )
;;(setq browse-url-new-window-p t) ;open a fresh netscape window.
;;(if (boundp 'running-xemacs)
;; (progn
;; ;make the modeline time display show up on dark background.
;; (setq display-time-display-time-foreground "tomato")
;; ;I put my mail in a non-standard location.
;; (setq display-time-mail-file (expand-file-name "~/nsmail/Inbox"))
;; ; Make sure delete key always deletes forward in cc mode.
;; (setq delete-key-deletes-forward t)
;; )
;;)
;; ORG MODE
;;(setq org-agenda-files (list "~/Documents/Org/work.org"
;; "~/Documents/Org/personal.org"))
;; Todo Options
;; (setq org-todo-state-tags-triggers
;; '(("CANCELLED" ("CANCELLED" . t))
;; ("WAITING" ("WAITING" . t))
;; ("HOLD" ("WAITING") ("HOLD" . t))
;; (done ("WAITING") ("HOLD"))
;; ("TODO" ("WAITING") ("CANCELLED") ("HOLD"))
;; ("NEXT" ("WAITING") ("CANCELLED") ("HOLD"))
;; ("DONE" ("WAITING") ("CANCELLED") ("HOLD"))))
;; (setq org-todo-keywords
;; '(;; Sequent for TODOs
;; (sequence "TODO(t@/!)" "WAITING(w@/!)" "DELEGATED(d@/!)" "HOLD(h@/!)" "FEEDBACK(f@/!)" "VERIFY(v@/!)" "|" "DONE()" "DELEGATED()" "Cancelled()")
;; ;; Sequence for Bugs
;; (sequence "NEW(n!)" "CONFIRMED" "ASSIGNED" "IN PROGRESS" "|" "INVALID" "COMPLETE" "VERIFIED" "CLOSED")
;; ;; Sequence for PURCHASES
;; ;;(sequence "IDENTIFICATION(p@/!)" "RESEARCH(j@/!)" "PURCHASE()" "TRANSIT(u@/!)" | "RECEIVED()")
;; ;; Sequence for
;; ;;(sequence "GIFT(h@/!)" "SELL(k@/!)" "LOANED(n@/!)" "|" "UNWANTED(a@/!)" "OWN(o@/!)" "GIFTED(g@/!)" "SOLD(c@/!)" "DISCARDED(q@/!)")
;; ;; Sequence for MULTIMEDIA
;; ;;(sequence "CONSUME(r@/!)" "SUBSCRIBE(b@/!)" "CONSUMING(l@/!)" "SHARE(s@/!)" "|" "IGNORED(i@/!)" "REFERENCE(f@/!)")
;; ;; Sequence for EVENTS
;; (sequence "VISIT(v@/!)" "|" "DIDNOTGO(z@/!)" "MEETING(m@/!)" "VISITED(y@/!)")))
;; ;; Setting Colours (faces) for todo states to give clearer view of work
;; (setq org-todo-keyword-faces
;; '(("TODO" :foreground "red" :weight bold)
;; ("NEXT" :foreground "blue" :weight bold)
;; ("DONE" :foreground "forest green" :weight bold)
;; ("WAITING" :foreground "orange" :weight bold)
;; ("HOLD" :foreground "magenta" :weight bold)
;; ("CANCELLED" :foreground "forest green" :weight bold)
;; ("MEETING" :foreground "forest green" :weight bold)
;; ("PHONE" :foreground "forest green" :weight bold)))
;; ;;
;; ;; (setq org-super-agenda-groups
;; ;; '( ;; Each group has an implicit boolean OR operator between its selectors.
;; ;; (:name "Today" ; Optionally specify section name
;; ;; :time-grid t ; Items that appear on the time grid
;; ;; )
;; ;; (:name "Important" :priority "A")
;; ;; (:priority<= "B"
;; ;; ;; Show this section after "Today" and "Important", because
;; ;; ;; their order is unspecified, defaulting to 0. Sections
;; ;; ;; are displayed lowest-number-first.
;; ;; :order 1)
;; ;; (:name "Habits" :habit t :order 2)
;; ;; (:name "Shopping" :tag "Besorgung" :order 3)
;; ;; ;; Boolean AND group matches items that match all subgroups
;; ;; ;; :and (:tag "shopping" :tag "@town")
;; ;; ;; Multiple args given in list with implicit OR
;; ;; ;; :tag ("food" "dinner"))
;; ;; ;; :habit t
;; ;; ;; :tag "personal")
;; ;; (:name "Started" :todo "STARTED" :order 5)
;; ;; ;;(:name "Space-related (non-moon-or-planet-related)"
;; ;; ;; ;; Regexps match case-insensitively on the entire entry
;; ;; ;; :and (:regexp ("space" "NASA")
;; ;; ;; ;; Boolean NOT also has implicit OR between selectors
;; ;; ;; :not (:regexp "moon" :tag "planet")))
;; ;; (:name "BWG" :tag "@BWG" :order 7)
;; ;; (:todo "WAITING" :order 9) ; Set order of this section
;; ;; (:name "read" :tag "2read" :order 15)
;; ;; ;; Groups supply their own section names when none are given
;; ;; (:todo ("SOMEDAY" "WATCHING")
;; ;; ;; Show this group at the end of the agenda (since it has the
;; ;; ;; highest number). If you specified this group last, items
;; ;; ;; with these todo keywords that e.g. have priority A would be
;; ;; ;; displayed in that group instead, because items are grouped
;; ;; ;; out in the order the groups are listed.
;; ;; :order 25)
;; ;; (:name "reward"
;; ;; :tag ("reward" "lp")
;; ;; :order 100)
;; ;; ;; After the last group, the agenda will display items that didn't
;; ;; ;; match any of these groups, with the default order position of 99
;; ;; ))
;; ;; Hooks
;; (with-eval-after-load 'org
;; (add-hook 'org-after-todo-statistics-hook 'org-summary-todo)
;; (add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
;; (add-to-list 'auto-mode-alist '("\\.org.gpg$" . org-mode))
;; (add-to-list 'auto-mode-alist '("\\.ref$" . org-mode))
;; (add-to-list 'auto-mode-alist '("\\.ref.gpg$" . org-mode))
;; (add-to-list 'auto-mode-alist '("\\.nnotes$" . org-mode))
;; (add-to-list 'auto-mode-alist '("\\.nnotes.gpg$" . org-mode))
;; )
;; (with-eval-after-load 'org-agenda
;; (require 'org-projectile)
;; (mapcar '(lambda (file)
;; (when (file-exists-p file)
;; (push file org-agenda-files)))
;; (org-projectile-todo-files)))
;;(setq-default dotspacemacs-configuration-layers '(
;; (keyboard-layout :variables kl-layout 'dvorak)))
;; Don't truncate lines in vertically split windows (suggested by Jeff).
;;(setq truncate-partial-width-windows nil)
;; uptimes
(setq emacs-load-start-time (current-time))
;;(add-hook 'font-lock-mode-hook 'hc-highlight-tabs)
;;(add-hook 'font-lock-mode-hook 'hc-highlight-hard-spaces)
;;(add-hook 'font-lock-mode-hook 'hc-highlight-trailing-whitespace)
;;(add-hook 'after-change-major-mode-hook 'fci-mode)
;; Add hooks for various modes
;; (with-eval-after-load 'cc-mode
;; (add-hook 'cc-mode-hook 'fci-mode))
;; (with-eval-after-load 'shell-mode
;; (add-hook 'shell-mode-hook 'fci-mode))
;; (with-eval-after-load 'conf-mode
;; (add-hook 'conf-mode-hook 'fci-mode))
;; (with-eval-after-load 'python-mode
;; (add-hook 'python-mode-hook 'fci-mode))
;; (with-eval-after-load 'yaml-mode
;; (add-hook 'yaml-mode-hook 'fci-mode))
;; (with-eval-after-load 'emacs-lisp-mode
;; (add-hook 'emacs-lisp-mode-hook 'fci-mode))
;; (with-eval-after-load 'php-mode-hook
;; (add-hook 'php-mode-hook 'fci-mode))
;; (with-eval-after-load 'html-mode
;; (add-hook 'html-mode-hook 'fci-mode))
;; (with-eval-after-load 'nxml-mode
;; (add-hook 'nxml-mode-hook 'fci-mode))
;; (with-eval-after-load 'graphviz-dot-mode
;; (add-hook 'graphviz-dot-mode-hook 'fci-mode))
;; (with-eval-after-load 'prog-mode
;; add-hook 'prog-mode-hook 'fci-mode)
;; Header
;;(autoload 'auto-update-file-header "header2")
;;(add-hook 'write-file-hooks 'auto-update-file-header)
;; To have Emacs add a file header whenever you create a new file in
;; some mode, put this in your init file (~/.emacs):
;;(autoload 'auto-make-header "header2")
;;(add-hook 'emacs-lisp-mode-hook 'auto-make-header)
;;(add-hook 'c-mode-common-hook 'auto-make-header)
;;(elpy-enable)
;;(require 'epa-file)
;;(epa-file-enable)
;; Fix for broken daemon mode
;;(defun signal-restart-server ()
;; "Handler for SIGUSR1 signal, to (re)start an emacs server.
;;
;;Can be tested from within emacs with:
;; (signal-process (emacs-pid) 'sigusr1)
;;
;;or from the command line with:
;;$ kill -USR1 <emacs-pid>
;;$ emacsclient -c
;;"
;; (interactive)
;; (server-force-delete)
;; (server-start))
;;)
;;(define-key special-event-map [sigusr1] 'signal-restart-server)
;; Server Settings
(require 'server)
(unless (server-running-p)
(server-start))
;;(add-to-list 'auto-mode-alist '(".*_EDITMSG\\'" . log-entry-mode))
(add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))
(add-to-list 'auto-mode-alist '("ssh*_config" . conf-mode))
(add-to-list 'auto-mode-alist '("screenrc" . conf-mode))
(add-to-list 'auto-mode-alist '("\\.cnf\\'" . conf-mode))
(add-to-list 'auto-mode-alist '(".profile" . shell-script-mode))
(add-to-list 'auto-mode-alist '("profile" . shell-script-mode))
;; Development Environment
(setq-default git-magit-status-fullscreen nil)
;;(require 'git-commit)
(setq global-git-commit-mode t
auth-sources '("~/.authinfo.gpg"))
(setq magit-repository-directories
'(("~/Documents/Development/" . 2) ("~/Documents/Org" . 2)))
(setq forge-topic-list-limit '(100 . 0))
;; Graphic UI Environment
(when (display-graphic-p)
;; Sudoku Settings
(setq sudoku-level 'medium)
(setq sudoku-style 'unicode)
(setq sudoku-autoinsert-mode nil)
)
;; Ansible Environment
(when (executable-find "ansible")
(when (file-exists-p "~/.vault_pass.txt")
(setq ansible-vault-password-file "~/.vault_pass.txt")
(add-hook 'ansible-vault-mode-hook 'fci-mode)))
;; Custom Layouts
(spacemacs|define-custom-layout "@Drbr-Ansible"
:binding "pa"
:body
(find-file "~/.ansible/collections/ansible_collections/bloodymage/autonomy/")
(spacemacs/treemacs-project-toggle)
(winum-select-window-1)
(display-fill-column-indicator-mode)
(split-window-right)
(magit-status-here)
(winum-select-window-1)
)
(spacemacs|define-custom-layout "@Drbr-AnsibleInventories"
:binding "pA"
:body
(find-file "~/.ansible/inventories/")
(spacemacs/treemacs-project-toggle)
(winum-select-window-1)
(display-fill-column-indicator-mode)
(split-window-right)
(magit-status-here)
(winum-select-window-1)
)
(spacemacs|define-custom-layout "@Drbr-EmacsLayer"
:binding "pd"
:body
(find-file "~/.emacs.d/private/drbr")
(spacemacs/treemacs-project-toggle)
(winum-select-window-1)
(display-fill-column-indicator-mode)
(split-window-right)
(magit-status-here)
(winum-select-window-1)
)
(spacemacs|define-custom-layout "@Drbr-HomeAssistantConfig"
:binding "ph"
:body
(find-file "~/Documents/Development/homeassistant_config/configuration.yaml")
(spacemacs/treemacs-project-toggle)
(winum-select-window-1)
(display-fill-column-indicator-mode)
(split-window-right)
(magit-status-here)
(winum-select-window-1)
)
(spacemacs|define-custom-layout "@Drbr-Org"
:binding "O"
:body
(let ((agenda-files (org-agenda-files)))
(if agenda-files
(find-file (first agenda-files))
(user-error "Error: No agenda files configured, nothing to display.")))
(split-window-right)
(org-agenda-list 14)
(winum-select-window-1)
)
(spacemacs|define-custom-layout "@Drbr-trader-development"
:binding "ptd"
:body
(find-file "~/Documents/Development/trader/development")
(spacemacs/treemacs-project-toggle)
(winum-select-window-1)
(display-fill-column-indicator-mode)
(split-window-right)
(magit-status-here)
(winum-select-window-1)
)
(spacemacs|define-custom-layout "@Drbr-trader-release"
:binding "ptr"
:body
(find-file "~/Documents/Development/trader/release")
(spacemacs/treemacs-project-toggle)
(winum-select-window-1)
(display-fill-column-indicator-mode)
(split-window-right)
(magit-status-here)
(winum-select-window-1)
)
(spacemacs|define-custom-layout "@Drbr-trader-stable"
:binding "pts"
:body
(find-file "~/Documents/Development/trader/stable")
(spacemacs/treemacs-project-toggle)
(winum-select-window-1)
(display-fill-column-indicator-mode)
(split-window-right)
(magit-status-here)
(winum-select-window-1)
)
(spacemacs|define-custom-layout "@Drbr-strategy01-develop"
:binding "ps1d"
:body
(find-file "~/Documents/Development/strategy01/devel")
(spacemacs/treemacs-project-toggle)
(winum-select-window-1)
(display-fill-column-indicator-mode)
(split-window-right)
(magit-status-here)
(winum-select-window-1)
)
(spacemacs|define-custom-layout "@Drbr-strategy01-stable"
:binding "ps1s"
:body
(find-file "~/Documents/Development/strategy01/stable")
(spacemacs/treemacs-project-toggle)
(winum-select-window-1)
(display-fill-column-indicator-mode)
(split-window-right)
(magit-status-here)
(winum-select-window-1)
)
(spacemacs|define-custom-layout "@Drbr-strategy01-release"
:binding "ps1r"
:body
(find-file "~/Documents/Development/strategy01/release")
(spacemacs/treemacs-project-toggle)
(winum-select-window-1)
(display-fill-column-indicator-mode)
(split-window-right)
(magit-status-here)
(winum-select-window-1)
)
(spacemacs|define-custom-layout "@Drbr-games-sudoku"
:binding "Gs"
:body
(sudoku)
)
(spacemacs|define-custom-layout "@Drbr-games-tetris"
:binding "Gt"
:body
(tetris)
)
(spacemacs|define-custom-layout "@Drbr-xkcd"
:binding "fx"
:body
(xkcd)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; config.el ends here