-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.el
182 lines (139 loc) · 6.42 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
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
;; Place your private configuration here! Remember, you do not need to run 'doom
;; sync' after modifying this file!
;; Some functionality uses this to identify you, e.g. GPG configuration, email
;; clients, file templates and snippets.
(setq user-full-name "Dom Parry"
user-mail-address "[email protected]")
;; 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:
;; Fira Code Setup
(setq doom-font (font-spec :family "Fira Code" :size 13)
doom-variable-pitch-font (font-spec :family "Fira Code" :size 13)
doom-big-font (font-spec :family "Fira Code" :size 14))
;; (setq-default line-spacing 1)
(let ((alist '((33 . ".\\(?:\\(?:==\\|!!\\)\\|[!=]\\)")
(35 . ".\\(?:###\\|##\\|_(\\|[#(?[_{]\\)")
(36 . ".\\(?:>\\)")
(37 . ".\\(?:\\(?:%%\\)\\|%\\)")
(38 . ".\\(?:\\(?:&&\\)\\|&\\)")
(42 . ".\\(?:\\(?:\\*\\*/\\)\\|\\(?:\\*[*/]\\)\\|[*/>]\\)")
(43 . ".\\(?:\\(?:\\+\\+\\)\\|[+>]\\)")
(45 . ".\\(?:\\(?:-[>-]\\|<<\\|>>\\)\\|[<>}~-]\\)")
(46 . ".\\(?:\\(?:\\.[.<]\\)\\|[.=-]\\)")
;; (46 . ".\\(?:\\(?:\\.[.<]\\)\\|[.=-]\\)")
(47 . ".\\(?:\\(?:\\*\\*\\|//\\|==\\)\\|[*/=>]\\)")
(48 . ".\\(?:x[a-zA-Z]\\)")
(58 . ".\\(?:::\\|[:=]\\)")
(59 . ".\\(?:;;\\|;\\)")
(60 . ".\\(?:\\(?:!--\\)\\|\\(?:~~\\|->\\|\\$>\\|\\*>\\|\\+>\\|--\\|<[<=-]\\|=[<=>]\\||>\\)\\|[*$+~/<=>|-]\\)")
(61 . ".\\(?:\\(?:/=\\|:=\\|<<\\|=[=>]\\|>>\\)\\|[<=>~]\\)")
(62 . ".\\(?:\\(?:=>\\|>[=>-]\\)\\|[=>-]\\)")
(63 . ".\\(?:\\(\\?\\?\\)\\|[:=?]\\)")
;; (63 . ".\\(?:\\(\\?\\?\\)\\|[:=?]\\)")
(91 . ".\\(?:]\\)")
(92 . ".\\(?:\\(?:\\\\\\\\\\)\\|\\\\\\)")
(94 . ".\\(?:=\\)")
(119 . ".\\(?:ww\\)")
(123 . ".\\(?:-\\)")
(124 . ".\\(?:\\(?:|[=|]\\)\\|[=>|]\\)")
(126 . ".\\(?:~>\\|~~\\|[>=@~-]\\)"))))
(dolist (char-regexp alist)
(set-char-table-range composition-function-table (car char-regexp)
`([,(cdr char-regexp) 0 font-shape-gstring]))))
;; Maximize screen on start
(add-hook 'window-setup-hook 'toggle-frame-maximized t)
(setq-default evil-escape-key-sequence "fd")
(setq! evil-want-Y-yank-to-eol nil)
(when IS-MAC
(map! "s-x" #'kill-region))
(doom-themes-neotree-config)
(setq doom-themes-neotree-file-icons t)
;; JS config
(setq js-indent-level 2
js2-basic-offset 2)
(setq +set-eslint-checker nil)
(after! lsp-ui
;; for whatever reason, this was running twice.
(setq lsp-ui-sideline-show-hover t)
(when (not +set-eslint-checker)
(progn
(setq +set-eslint-checker t)
(flycheck-add-mode 'javascript-eslint 'web-mode)
(flycheck-add-next-checker 'lsp-ui '(warning . javascript-eslint)))))
(defun enable-minor-mode (my-pair)
"Enable minor mode if filename match the regexp. MY-PAIR is a cons cell (regexp . minor-mode)."
(if (buffer-file-name)
(if (string-match (car my-pair) buffer-file-name)
(funcall (cdr my-pair)))))
(add-hook 'web-mode-hook #'(lambda ()
(enable-minor-mode
'("\\.jsx?\\'" . prettier-js-mode))))
(use-package! cider
:after clojure-mode
:config
(set-lookup-handlers! 'cider-mode nil))
(use-package! clj-refactor
:after clojure-mode
:config
(set-lookup-handlers! 'clj-refactor-mode nil))
(setq lsp-eldoc-enable-hover nil) ; disable lsp-mode showing eldoc during symbol at point
(setq cljr-add-ns-to-blank-clj-files nil) ; disable clj-refactor adding ns to blank files
(after! web-mode
(add-hook 'web-mode-hook #'flycheck-mode)
(setq web-mode-markup-indent-offset 2 ;; Indentation
web-mode-code-indent-offset 2
web-mode-enable-auto-quoting nil ;; disbale adding "" after an =
web-mode-auto-close-style 2))
(after! web-mode
(remove-hook 'web-mode-hook #'+javascript-init-lsp-or-tide-maybe-h)
(add-hook 'web-mode-local-vars-hook #'+javascript-init-lsp-or-tide-maybe-h))
(after! smartparens
(map! (:map smartparens-mode-map
"C->" #'sp-backward-slurp-sexp
"C-." #'sp-forward-slurp-sexp
"C-<" #'sp-backward-barf-sexp
"C-," #'sp-forward-barf-sexp)))
;; 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:
(setq doom-theme 'doom-monokai-machine)
;; 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 "~/org/")
;; 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)
;; Projecticle Setup
(setq projectile-root-top-down-recurring t)
(setq projectile-indexing-method 'alien
projectile-project-search-path '("~/Code/"))
;; So Long only for very long lines
(setq so-long-threshold 2000)
;; 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.
(setq lsp-ui-sideline-show-code-actions nil)
(setq +format-with-lsp nil)
(setq-default enable-local-variables t)