-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.el
158 lines (138 loc) · 3.51 KB
/
init.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
;; Packages
(package-initialize)
(setq use-package-always-ensure t)
(unless (assoc-default "melpa" package-archives)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t))
(unless (package-installed-p 'use-package)
(package-install 'use-package))
(setq use-package-verbose t)
(setq use-package-always-ensure t)
(require 'use-package)
;; Backups
(setq backup-directory-alist '(("." . "~/.emacs.d/backups"))
delete-old-versions t
version-control t
kept-new-versions 10
kept-old-versions 5
vc-make-backup-files t)
;; Fonts
(add-to-list 'default-frame-alist '(font . "Inconsolata"))
;; UI
(tool-bar-mode -1)
(display-time-mode 1)
(scroll-bar-mode -1)
;; Winner mode for layout change
(winner-mode 1)
;; Copy shell variables
(use-package exec-path-from-shell
:init
(exec-path-from-shell-initialize)
)
;; Undo tree
(use-package undo-tree
:init
(undo-tree-mode)
)
;; Project management
(use-package projectile
:config
(projectile-mode)
)
(use-package magit
:bind
("C-x g" . magit-status)
)
;; Linum mode for linenumbers
(use-package linum
:init
(add-hook 'prog-mode-hook #'linum-on)
)
;; Paren mode
(use-package paren
:init
(add-hook 'prog-mode-hook #'show-paren-mode)
(add-hook 'prog-mode-hook #'electric-pair-mode)
)
;; Theme
(use-package doom-themes
:init
(progn
(require 'doom-themes)
(setq doom-themes-enable-bold t
doom-themes-enable-italic t))
:config
(load-theme 'doom-one t)
)
;; Helm
(use-package helm
:diminish helm-mode
:init
(require 'helm-config)
(setq helm-quick-update t)
(helm-mode)
(use-package helm-projectile
:config
(helm-projectile-on)
)
:bind
(("C-x C-b" . helm-buffers-list)
("C-x b" . helm-buffers-list)
("C-x C-f" . helm-find-files)
("M-x" . helm-M-x)
(:map helm-map
("TAB" . helm-execute-persistent-action)))
)
(use-package company
:init
(add-hook 'prog-mode-hook 'company-mode)
:config
(use-package company-statistics
:config
(company-statistics-mode)
)
(use-package company-go
:init
(add-to-list 'company-backends 'company-go)
)
(setq company-minimum-prefix-length 1)
(setq company-idle-delay 0.1)
(setq company-echo-delay 0)
)
(use-package flycheck
:init
(global-flycheck-mode)
)
;; Go mode
(use-package go-mode
:init
(defun add-save-hook-go ()
(add-hook 'before-save-hook 'gofmt-before-save nil 'local))
(setq gofmt-command "goimports")
(use-package go-eldoc
:init
(add-hook 'go-mode-hook 'go-eldoc-setup))
(use-package go-dlv)
(use-package go-guru)
:hook
(go-mode . add-save-hook-go)
)
;; Dockerfile
(use-package dockerfile-mode
:init
(add-to-list 'auto-mode-alist '("Dockerfile\\'" . dockerfile-mode)))
(use-package yaml-mode)
(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.
'(global-undo-tree-mode t)
'(package-selected-packages
(quote
(go-guru helm-projectile undo-tree projectile magit exec-path-from-shell go-eldoc flycheck company-go company-statistics company-mode company yaml-mode go-dlv smooth-scrolling linum-mode doom-themes helm use-package))))
(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.
)