-
Notifications
You must be signed in to change notification settings - Fork 0
/
emacs
111 lines (92 loc) · 3.71 KB
/
emacs
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
;;; .emacs --- emacs init
;;; Commentary:
;; emacs init file
;;; Code:
;;; uncomment this line to disable loading of "default.el" at startup
;; (setq inhibit-default-init t)
;; Make sure /usr/local/bin is at the beginning of the path
(setenv "PATH" (concat "/usr/local/bin:" (getenv "PATH"))
(add-to-list 'exec-path "/usr/local/bin"))
(setenv "GOPATH" (concat (getenv "HOME") "/go"))
;; package management
(require 'package)
;; marmalade appears to be dead
;;(add-to-list 'package-archives
;; '("marmalade" . "http://marmalade-repo.org/packages/") t)
(add-to-list 'package-archives
'("melpa" . "http://melpa.org/packages/") t)
(add-to-list 'package-archives
'("org" . "http://orgmode.org/elpa/") t) ; Org-mode's repository
(setq package-check-signature nil)
(package-initialize)
;; Uncomment to refresh packages cache -- slows startup
(when (not package-archive-contents)
(package-refresh-contents))
;; NOTE: to upgrade packages, M-x package-refresh-contents M-X list-packages Ux
;; Install needed packages
(defun ensure-package-installed (&rest packages)
"Assure every package is installed, ask for installation if it’s not.
PACKAGES contains the package to install if not already installed
Return a list of installed packages or nil for every skipped package."
(mapcar
(lambda (package)
;; (package-installed-p 'evil)
(if (package-installed-p package)
nil
(if (y-or-n-p (format "Package %s is missing - install it? " package))
(package-install package)
package)))
packages))
;; make sure to have downloaded archive description.
;; Or use package-archive-contents as suggested by Nicolas Dudebout
(or (file-exists-p package-user-dir)
(package-refresh-contents))
; removed `flymake-easy `flymake-puppet `flymake-ruby -- moving to flycheck
(ensure-package-installed `cedet `dash `color-theme-sanityinc-solarized
`dockerfile-mode `better-defaults
`elpy
`exec-path-from-shell
`flycheck
`go-mode `go-autocomplete `go-guru
`json-mode `magit 'transient 'forge `markdown-mode `lua-mode `yaml-mode
`groovy-mode `terraform-mode)
;; enable flycheck everywhere
(global-flycheck-mode)
;; enable visual feedback on selections
;(setq transient-mark-mode t)
;; Make next/prev line behave logically
(setq line-move-visual nil)
;; default to better frame titles
(setq frame-title-format
(concat "%b - emacs@" (system-name)))
;; default to unified diffs
(setq diff-switches "-u")
;; always end a file with a newline
;(setq require-final-newline 'query)
;;; uncomment for CJK utf-8 support for non-Asian users
;; (require 'un-define)
(load-file (concat (getenv "HOME") "/.emacs.d/init.el"))
(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.
'(case-fold-search t)
'(current-language-environment "Latin-1")
'(default-input-method "latin-1-prefix")
'(focus-follows-mouse t)
'(global-font-lock-mode t nil (font-lock))
'(load-home-init-file t t)
'(package-selected-packages
(quote
(better-defaults transient transient-dwim forge terraform-mode groovy-mode elpy-enable yaml-mode markdown-mode magit lua-mode json-mode go-mode flycheck-gometalinter dockerfile-mode color-theme-sanityinc-solarized cedit)))
'(query-user-mail-address nil)
'(user-mail-address "[email protected]"))
(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.
'(default ((t (:size "12pt")))))
(provide 'emacs)
;;; emacs ends here