-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser-config.el
152 lines (125 loc) · 4.94 KB
/
user-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
(setq max-specpdl-size 3000)
(load (dsppath "theme.el"))
(load (dsppath "shell.el"))
(with-eval-after-load 'lsp-mode
(load (dsppath "lsp.el")))
(with-eval-after-load 'clojure-mode
(load (dsppath "clojure.el")))
(with-eval-after-load 'carp-mode
(require 'inf-carp-mode)
(add-to-list 'evil-lisp-safe-structural-editing-modes
'inf-carp-mode)
;; (remove-hook 'carp-mode-hook #'inf-carp-mode)
)
;;
;; Magit
;;;;;;;;;;;;;;;;;;;;;;;;;;
;; performance
;; https://magit.vc/manual/magit/Performance.html#Committing-Performance-1
;; (add-hook 'server-switch-hook 'magit-commit-diff)
;; https://jakemccrary.com/blog/2020/11/14/speeding-up-magit/
;; (add-hook 'magit-status-sections-hook 'magit-insert-tags-header)
;; (add-hook 'magit-status-sections-hook 'magit-insert-status-headers)
;; (add-hook 'magit-status-sections-hook 'magit-insert-unpushed-to-pushremote)
;; (add-hook 'magit-status-sections-hook 'magit-insert-unpulled-from-pushremote)
;; (add-hook 'magit-status-sections-hook 'magit-insert-unpulled-from-upstream)
;; (add-hook 'magit-status-sections-hook 'magit-insert-unpushed-to-upstream-or-recent)
;;
;; Projectile
;;;;;;;;;;;;;;;;;;;;;;;;
(setq-default projectile-indexing-method 'hybrid)
(when (eq system-type 'windows-nt)
;; requires https://lib.rs/crates/coreutils
(setq projectile-git-submodule-command "git submodule --quiet foreach 'echo $displaypath' | coreutils tr '\\n' '\\0'"))
;;
;; Solve the problem of deadly slow autocomplete when using semantic mode
;; https://github.com/syl20bnr/spacemacs/issues/1907
;; https://github.com/syl20bnr/spacemacs/issues/11058#issuecomment-407269954
;;;;;;;;;;;;;;;;;;;;;
(defun et/semantic-remove-hooks ()
(remove-hook 'completion-at-point-functions
'semantic-analyze-completion-at-point-function)
(remove-hook 'completion-at-point-functions
'semantic-analyze-notc-completion-at-point-function)
(remove-hook 'completion-at-point-functions
'semantic-analyze-nolongprefix-completion-at-point-function))
(add-hook 'semantic-mode-hook #'et/semantic-remove-hooks)
;;;;;;;;;;
;;
;; rebindings
;;
(global-set-key (kbd "M-3")
'(lambda ()
(interactive)
(insert "£")))
(global-set-key (kbd "M-8")
'(lambda ()
(interactive)
(insert "•")))
(define-key winum-keymap (kbd "M-0") nil)
(define-key winum-keymap (kbd "M-1") nil)
(define-key winum-keymap (kbd "M-2") nil)
(define-key winum-keymap (kbd "M-3") nil)
(define-key winum-keymap (kbd "M-4") nil)
(define-key winum-keymap (kbd "M-5") nil)
(define-key winum-keymap (kbd "M-6") nil)
(define-key winum-keymap (kbd "M-7") nil)
(define-key winum-keymap (kbd "M-8") nil)
(define-key winum-keymap (kbd "M-9") nil)
(define-key global-map (kbd "<magnify-up>") nil)
(define-key global-map (kbd "<magnify-down>") nil)
(with-eval-after-load 'treemacs-mode
(define-key treemacs-mode-map [mouse-1] #'treemacs-single-click-expand-action)
(setq treemacs-collapse-dirs 7)
(defun my-treemacs-ignore-pred (filename absolute-path)
(or (string-equal filename "__pycache__")
(string-equal filename ".cpcache")
(string-equal filename ".pytest_cache")))
(add-to-list 'treemacs-ignored-file-predicates #'my-treemacs-ignore-pred))
;;
;; Editing
;;;;;;;;;;;;;;;;;;;;;;;;;
(spacemacs/toggle-evil-safe-lisp-structural-editing-on-register-hooks)
(setq-default evil-escape-key-sequence nil)
;; disable the annoying completion sometimes when hitting TAB
(setq tab-always-indent t)
;; Disable obnoxious auto-highlight-syntax
(remove-hook 'prog-mode-hook 'auto-highlight-symbol-mode)
;;
;; Emacs text rendering optimizations
;; https://200ok.ch/posts/2020-09-29_comprehensive_guide_on_handling_long_lines_in_emacs.html
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Only render text left to right
(setq-default bidi-paragraph-direction 'left-to-right)
(if (version<= "27.1" emacs-version)
(progn
;; Disable Bidirectional Parentheses Algorithm
(setq bidi-inhibit-bpa t)
;; So long mode when Emacs thinks a file would affect performance
(global-so-long-mode 1)))
;; Files with known long lines
;; SPC f l to open files literally to disable most text processing
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; End of: Emacs text rendering optimizations
;;
;; Override Spacemacs defaults
;;
;; Set new location for file bookmarks, SPC f b
;; Default: ~/.emacs.d/.cache/bookmarks
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq bookmark-default-file "~/.spacemacs.d/bookmarks")
;;
;; Set new location for recent save files
;; Default: ~/.emacs.d/.cache/recentf
(setq recentf-save-file "~/.spacemacs.d/recentf")
;;
;; native line numbers taking up lots of space?
(setq-default display-line-numbers-width nil)
;;
;; RUST
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;(add-hook 'toml-mode-hook #'spacemacs//activate-smartparens)
;;
;; LEDGER
;;;;;;;;;;;;;;;;;
;(add-hook 'ledger-mode-hook #'spacemacs//activate-smartparens)