-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.el
138 lines (112 loc) · 3.08 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
;;; init.el --- Emacs configuration
;;; Commentary:
;; - Load base custom configuration.
;; - Install a bunch of packages.
;;; Code:
;; Record customizations from `Customize` at this path instead of init.el.
(setq custom-file (concat user-emacs-directory "custom.el"))
(load custom-file)
;; These are Ed's base customization that are emacs centric.
(load (concat user-emacs-directory "base-custom.el"))
(require 'diminish)
;; I love these Solarized themes
(use-package solarized-theme
:ensure t
:init
(load-theme 'solarized-light t))
;; We always need magit.
(use-package magit
:ensure t
:bind ("C-c m s" . magit-status)
:init
(add-hook 'git-commit-setup-hook 'git-commit-turn-on-flyspell))
;; And flycheck
(use-package flycheck
:ensure t
:init
(global-flycheck-mode)
:diminish
(flycheck-mode . " Ⓢ"))
;; Ensure I can spell
(use-package flyspell
:ensure t
:defer t
:init
(add-hook 'prog-mode-hook 'flyspell-prog-mode)
(add-hook 'text-mode-text 'flyspell-mode))
;; Markdown is also useful.
(use-package markdown-mode
:ensure t
:mode "\\.md\\'")
;; Ensure we have smartparens. A good replacement for paredit
(use-package smartparens
:ensure t
:init
(smartparens-global-mode)
(show-smartparens-global-mode)
:config
(require 'smartparens-config)
:diminish
(smartparens-mode . " ⓟ"))
;; Fixup OSX path
(use-package exec-path-from-shell
:ensure t
:if (eq system-type 'darwin)
:config
(add-to-list 'exec-path-from-shell-variables "GOPATH")
(exec-path-from-shell-initialize))
;; golang can be usefull sometimes.
(defun go-get (package)
"Use `go get' to install Go package PACKAGE."
(call-process "go" nil nil nil "get" package))
;;(setq font-lock-global-modes (not 'go-mode))
(use-package go-mode
:ensure t
:mode "\\.go\\'"
:init
;; This maybe slow, but whatever
(go-get "github.com/rogpeppe/godef")
(go-get "golang.org/x/tools/cmd/...")
(go-get "github.com/golang/lint/golint")
(setq gofmt-command "goimports") ;; goimports better than gofmt.
(add-hook 'before-save-hook 'gofmt-before-save)
:bind
(("M-." . godef-jump)
("M-," . pop-tag-mark))
:config
;; Go lint
(load-file "$GOPATH/src/github.com/golang/lint/misc/emacs/golint.el")
;; Install autocomplete for go
(use-package company-go
:ensure t
:diminish
(company-mode . " Ⓐ")
:init
(add-hook 'go-mode-hook (lambda ()
(set (make-local-variable 'company-backends) '(company-go))
(company-mode))))
;; Mini-buffer documentation.
(use-package go-eldoc
:ensure t
:init
(add-hook 'go-mode-hook 'go-eldoc-setup)
:diminish eldoc-mode)
;; Install go-guru package
(use-package go-guru
:ensure t
:commands go-guru-hl-identifier-mode
:init
(add-hook 'go-mode-hook #'go-guru-hl-identifier-mode)))
;; Rust
(use-package rust-mode
:mode "\\.rs\\'")
;; Docker
(use-package dockerfile-mode
:mode "Dockerfile.\\'")
;; YAML Files
(use-package yaml-mode
:mode "\\.ya?ml\\'")
;; Terraform
(use-package terraform-mode
:mode "\\.tf\\'")
;;; init.el ends here