git.fiddlerwoaroof.com
Browse code

chore(emacs): minor quality of life improvements

Ed Langley authored on 07/12/2019 07:39:53
Showing 1 changed files
... ...
@@ -6,7 +6,8 @@
6 6
 (let ((my-theme-path (expand-file-name "~/.emacs.d/themes/")))
7 7
   (add-to-list 'load-path my-theme-path)
8 8
   (add-to-list 'custom-theme-load-path my-theme-path)
9
-  (load-theme 'fwoar-zenburn t))
9
+  (when (display-graphic-p)
10
+    (load-theme 'fwoar-zenburn t)))
10 11
 
11 12
 (progn (setq default-frame-alist
12 13
              '((vertical-scroll-bars . nil)
... ...
@@ -14,11 +15,6 @@
14 15
                (bottom-divider-width . 2)))
15 16
        (modify-all-frames-parameters default-frame-alist))
16 17
 
17
-(let ((my-theme-path (expand-file-name "~/.emacs.d/themes/")))
18
-  (add-to-list 'load-path my-theme-path)
19
-  (add-to-list 'custom-theme-load-path my-theme-path)
20
-  (load-theme 'fwoar-zenburn t))
21
-
22 18
 (when (fboundp 'tool-bar-mode)
23 19
   (tool-bar-mode 0))
24 20
 (when (fboundp 'scroll-bar-mode)
... ...
@@ -34,6 +30,40 @@
34 30
 
35 31
 (cold-boot)
36 32
 
33
+(use-package company
34
+  :config
35
+  ;; keybindings
36
+  (progn (define-key company-active-map (kbd "C-c h") 'company-quickhelp-manual-begin)
37
+         (define-key company-active-map (kbd "M-.") 'company-show-location)
38
+         (define-key company-active-map (kbd "\C-d") 'company-show-doc-buffer)
39
+         (define-key company-active-map (kbd "(") (kbd "RET SPC ("))
40
+         (define-key company-active-map (kbd "{") (kbd "RET SPC {"))
41
+         (define-key company-active-map (kbd "[") (kbd "RET [")))
42
+
43
+  (setq company-backends
44
+        '((company-clang
45
+           company-bbdb
46
+           company-nxml
47
+           company-css
48
+           company-xcode
49
+           company-cmake
50
+           company-capf
51
+           company-slime)
52
+          company-files
53
+          (company-dabbrev-code
54
+           company-gtags
55
+           company-etags
56
+           company-keywords)
57
+          company-oddmuse
58
+          company-dabbrev)))
59
+
60
+(use-package company-posframe
61
+  :ensure t
62
+  :after company
63
+  :config
64
+  (add-hook 'company-mode-hook (lambda () (company-posframe-mode 1))))
65
+
66
+
37 67
 (use-package jeison
38 68
   :ensure t)
39 69
 
... ...
@@ -76,6 +106,7 @@
76 106
 
77 107
 (use-package org-projectile
78 108
   :ensure t
109
+  :after company
79 110
   :config
80 111
   (progn
81 112
     (org-projectile-per-project)
... ...
@@ -106,37 +137,6 @@
106 137
   :config
107 138
   (define-key evil-insert-state-map (kbd "C-c ,") 'emmet-expand-line))
108 139
 
109
-(use-package company
110
-  :config
111
-  ;; keybindings
112
-  (progn (define-key company-active-map (kbd "C-c h") 'company-quickhelp-manual-begin)
113
-         (define-key company-active-map (kbd "(") (kbd "RET SPC ("))
114
-         (define-key company-active-map (kbd "{") (kbd "RET SPC {"))
115
-         (define-key company-active-map (kbd "[") (kbd "RET [")))
116
-
117
-  (setq company-backends
118
-        '(company-clang
119
-          company-bbdb
120
-          company-nxml
121
-          company-css
122
-          company-xcode
123
-          company-cmake
124
-          company-capf
125
-          company-slime
126
-          company-files
127
-          (company-dabbrev-code
128
-           company-gtags
129
-           company-etags
130
-           company-keywords)
131
-          company-oddmuse
132
-          company-dabbrev)))
133
-
134
-(use-package company-posframe
135
-  :ensure t
136
-  :after company
137
-  :config
138
-  (add-hook 'company-mode-hook (lambda () (company-posframe-mode 1))))
139
-
140 140
 (use-package lisp-skeletons
141 141
   :config
142 142
   (add-hook 'skeleton-end-hook 'skeleton-make-markers)
... ...
@@ -204,7 +204,8 @@
204 204
 (use-package prettier-js
205 205
   :ensure t
206 206
   :init
207
-  (add-hook 'js2-mode-hook 'prettier-js-mode))
207
+  (add-hook 'js2-mode-hook 'prettier-js-mode)
208
+  (add-hook 'css-mode 'prettier-js-mode))
208 209
 
209 210
 (use-package tide
210 211
   :ensure t
... ...
@@ -222,13 +223,13 @@
222 223
  (use-package tern
223 224
    :config
224 225
    (add-hook 'js-mode-hook (lambda () (tern-mode t)))
225
-   (add-hook 'js2-mode-hook (lambda () (tern-mode t)))))
226
+   (add-hook 'js2-mode-hook (lambda () (tern-mode t))))
226 227
 
227
-(use-package company-tern
228
-  :ensure t
229
-  :config
230
-  (add-to-list 'company-backends 'company-tern)
231
-  (setq company-tooltip-align-annotations t))
228
+ (use-package company-tern
229
+   :ensure t
230
+   :config
231
+   (add-to-list 'company-backends 'company-tern)
232
+   (setq company-tooltip-align-annotations t)))
232 233
 
233 234
 (use-package jest
234 235
   :ensure t
... ...
@@ -467,7 +468,7 @@ With a prefix ARG invalidates the cache first."
467 468
       (delete-window)
468 469
     (treemacs-select-window)))
469 470
 
470
-(defun no-line-numbers ()
471
+(defun fwoar--no-line-numbers ()
471 472
   (display-line-numbers-mode -1))
472 473
 (use-package treemacs
473 474
   :ensure t
... ...
@@ -475,7 +476,7 @@ With a prefix ARG invalidates the cache first."
475 476
   (setq treemacs-is-never-other-window t)
476 477
   (global-set-key (kbd "s-e") 'fwoar--activate-treemacs)
477 478
   (global-set-key (kbd "s-1") 'fwoar--activate-treemacs)
478
-  (add-hook 'treemacs-mode-hook 'no-line-numbers)
479
+  (add-hook 'treemacs-mode-hook 'fwoar--no-line-numbers)
479 480
   )
480 481
 
481 482
 (use-package treemacs-evil