-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinit.el
186 lines (157 loc) · 5.2 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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
;;; For browsing Emacs's C source. This must be set early.
(setq source-directory "~/Programming/Tools/emacs")
(setq load-prefer-newer t)
;;; Make package downloading a bit more secure.
(setq tls-checktrust 'ask)
(add-to-list 'load-path "~/.emacs.d/config")
(require 'ublt-util)
(defvar ublt/packages
'(use-package
dash
textmate
keyfreq
org org-bullets
ox-reveal ; reveal.js slides from org-mode
adaptive-wrap
;; TODO: Use & combine with eproject
projectile ; Project management
emms ; Music
exec-path-from-shell ; Uhm, f*ck shell
pabbrev ; TODO: Find better alternative
;; Appearance
rainbow-mode
highlight-symbol idle-highlight-mode
;; Sometimes (e.g. in terminals)
solarized-theme
zenburn-theme
monokai-theme
;; Code folding
hideshowvis
;; Languages
flycheck
edts ;erlang
haskell-mode quack
adoc-mode
ess
markdown-mode yaml-mode
less-css-mode scss-mode
clojure-mode cider clj-refactor
scala-mode
elisp-slime-nav lisp-extra-font-lock
cask-mode
typescript-mode
php-mode php-boris
elpy flycheck-pyflakes ;python
web-mode
emmet-mode ; html/css editing
go-mode
dockerfile-mode
protobuf-mode
systemd
inf-mongo))
(pcase (getenv "EMACS_PACKAGE_MANAGER")
("package.el"
(progn
;; Package repositories.
(require 'package)
(dolist (source '(("org" . "https://orgmode.org/elpa/")
("melpa-stable" . "https://stable.melpa.org/packages/")
("melpa" . "https://melpa.org/packages/")
("elpy" . "https://jorgenschaefer.github.io/packages/")
))
(add-to-list 'package-archives source t))
;; Prefer stable packages.
(setq package-archive-priorities '(("melpa-stable" . 1)
("melpa" . 2)))
;; Pin `elpy' and `org'.
(when (boundp 'package-pinned-packages)
(setq package-pinned-packages
'((elpy . "elpy")
(org . "org"))))
;; Some packages mess up `package-archives'. This fixes that.
(defvar ublt/package-archives package-archives)
(add-hook 'after-init-hook (lambda () (setq package-archives ublt/package-archives)))
(package-initialize)
(when (not package-archive-contents)
(package-refresh-contents))
(dolist (p ublt/packages)
(ublt/package-install p))
(require 'use-package)
(require 'use-package-ensure)
(setq
;; Since we have to use `:straight' `nil' for some packages when using `straight.el'.
use-package-ignore-unknown-keywords t
;; We don't want to declare a package twice.
use-package-always-ensure t)))
(_
(progn
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 5))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
(straight-use-package 'use-package)
;; We don't want to declare a package twice.
(setq straight-use-package-by-default t)
(dolist (p ublt/packages)
(straight-use-package p)))))
(setq use-package-verbose t
;; For `use-package-report' to work.
use-package-compute-statistics t)
;;; Path to stuffs that come from single files
(ublt/add-path "single-file-modes")
(ublt/set-up 'exec-path-from-shell
(exec-path-from-shell-initialize))
;;; General usability
(require 'ublt-misc)
(require 'ublt-dvorak)
(require 'ublt-appearance)
(require 'ublt-navigation)
(require 'ublt-editing)
;;; Personal stuff
(ublt/set-up 'ublt-communication)
(ublt/set-up 'ublt-organization)
;;; More stuff
;;; Vim emulation
(require 'ublt-evil)
;;; File management
(require 'ublt-dired)
;;; Completion/narrowing interfaces
(require 'ublt-helm)
;;; git
(require 'ublt-git)
;;; Code linters.
(require 'ublt-flycheck)
;;; Languages support ------------------------------------------------
(require 'ublt-programming)
(require 'ublt-factor)
(require 'ublt-erlang)
(require 'ublt-haskell)
(require 'ublt-sql)
(require 'ublt-web)
(require 'ublt-markups)
(require 'ublt-lisp)
(require 'ublt-python)
(require 'ublt-ruby)
(require 'ublt-js)
(require 'ublt-devops)
(require 'ublt-rust)
(ublt/set-up 'ublt-mix-modes)
(setq custom-file "~/.emacs.d/custom.el")
(condition-case err
(load custom-file)
(error (message "Error loading custom file")))
;; Interops (with Terminal, Conkeror...) -----------------------------
(condition-case err
(unless (server-running-p)
(server-start))
(error (message "Could not start server")))
;;; Here because something above explicitly set it to nil.
(setq ring-bell-function 'ignore)