forked from myTerminal/super-emacs
-
Notifications
You must be signed in to change notification settings - Fork 2
/
packages-custom.el
52 lines (43 loc) · 1.71 KB
/
packages-custom.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
;; Place your customizations to 'config-packages.el' here.
;; Future updates to super-emacs will very less likely change this file so that
;; your customizations can remain free of merge conflicts.
(defvar se/packages-custom-standard
'(;; Related to golang
;; Required for highlighting, indentation etc. It is major mode for Go.
(go-mode melpa "dominikh/go-mode.el" t)
;; LSP support for Emacs.
(lsp-mode melpa "emacs-lsp/lsp-mode" t)
;; Higher level UI modules for LSP Mode.
(lsp-ui melpa "lsp-ui" t)
;; YASnippet is a template expansion system.
(yasnippet melpa "yasnippet" t)
;; Magit got git magic
(magit melpa "magit" t)
;; Git-gutter
(git-gutter melpa "git-gutter" t)
;; Nice theme
(immaterial-theme github "petergardfjall/emacs-immaterial-theme" t)
))
(mapc 'se/install-package-with-quelpa
se/packages-custom-standard)
;; Set the default theme
(load-theme 'immaterial-dark t)
;; Automatically enable linum-mode for all programming modes
(add-hook 'prog-mode-hook 'linum-mode)
;; Default git-gutter for files in git repositories
(global-git-gutter-mode +1)
;; Company mode
(setq company-idle-delay 0)
(setq company-minimum-prefix-length 1)
;; Go - lsp-mode
;; Set up before-save hooks to format buffer and add/delete imports.
(defun lsp-go-install-save-hooks ()
(add-hook 'before-save-hook #'lsp-format-buffer t t)
(add-hook 'before-save-hook #'lsp-organize-imports t t))
(add-hook 'go-mode-hook #'lsp-go-install-save-hooks)
;; Start LSP Mode and YASnippet mode
(add-hook 'go-mode-hook #'lsp-deferred)
(add-hook 'go-mode-hook #'yas-minor-mode)
;; Use spaces rather than tabs for Rust
(add-hook 'rust-mode-hook
(lambda () (setq indent-tabs-mode nil)))