aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjason2017-06-21 16:54:09 -0600
committerjason2017-06-21 16:54:09 -0600
commitfc88f9781a415e163874b503ed61711d4b7be0be (patch)
tree9b39854e584dc368162545748880a10ca0cb4602
parent6a045908c60c5fabe654803cf162029725a3726e (diff)
downloaddotemacs-fc88f9781a415e163874b503ed61711d4b7be0be.tar.gz
dotemacs-fc88f9781a415e163874b503ed61711d4b7be0be.zip
Update the config to a 'literate programming' style
-rw-r--r--.gitignore13
-rw-r--r--README.rst22
-rw-r--r--config.org393
-rw-r--r--init.el218
-rw-r--r--local-lib/autocompletion-conf.el30
-rw-r--r--local-lib/persp-conf.el38
-rw-r--r--local-lib/powerline-conf.el96
-rw-r--r--local-lib/projectile-conf.el16
-rw-r--r--local-lib/python-conf.el16
-rw-r--r--local-lib/rust-conf.el32
-rw-r--r--local-lib/version-control-conf.el16
11 files changed, 428 insertions, 462 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..894dbb4
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,13 @@
1# Files and directories generated and managed by Emacs
2auto-save-list
3.org-id-locations
4backups/
5elpa/
6recentf
7savehist
8
9persp-confs/
10projectile-bookmarks.eld
11
12# Emacs, other packages, etc, modify the init.el so let that be managed locally
13init.el \ No newline at end of file
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..b53bfaf
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,22 @@
1####################
2Jason's Emacs Config
3####################
4
5I use org-babel to create a literate config file. If you would just like to browse the config you can do so here:
6
7If you are looking to just blindly install and use it then clone this repository and load ``config.org`` at the top of your init file.
8
9.. code:: shell
10
11 git clone git@beehive.io:jason/dotemacs.git ~/.emacs.d
12 cat > ~/.emacs.d/init.el <<EOF
13 (defconst emacs-start-time (current-time))
14 (require 'org)
15 (org-babel-load-file "~/.emacs.d/config.org")
16
17 (add-hook 'after-init-hook
18 (lambda ()
19 (message "Emacs loaded in %.3fs"
20 (/ (- (zzq/time-to-msec (current-time)) (zzq/time-to-msec emacs-start-time)) 1000.0))))
21 EOF
22
diff --git a/config.org b/config.org
new file mode 100644
index 0000000..de4a8ba
--- /dev/null
+++ b/config.org
@@ -0,0 +1,393 @@
1* Startup
2*** Defaults
3#+BEGIN_SRC emacs-lisp
4(setq
5 ;; Hide the default startup screen
6 inhibit-startup-screen t
7 ;; Define where to store recovery files
8 backup-directory-alist '(("." . "~/.emacs.d/backups"))
9 ;; Use version numbers for backups.
10 version-control t
11 ;; Number of newest versions to keep.
12 kept-new-versions 10
13 ;; Number of oldest versions to keep.
14 kept-old-versions 0
15 ;; Don't ask to delete excess backup versions.
16 delete-old-versions -1
17 ;; Copy all files, don't rename them.
18 backup-by-copying t
19 ;; Make backups files under version control.
20 vc-make-backup-files t
21 ;; Don't confirm following when opening a symlink
22 vc-follow-symlinks t)
23
24;; Save minibuffer command history
25(savehist-mode +1)
26(setq savehist-save-minibuffer-history +1
27 savehist-file "~/.emacs.d/savehist")
28(setq savehist-additional-variables
29 '(kill-ring
30 search-ring
31 regexp-search-ring))
32
33;; Automatically close parens when opening them
34(electric-pair-mode 1)
35;; Show matched parens
36(show-paren-mode t)
37;; Let y and n be good enough for yes and no questions
38(fset 'yes-or-no-p 'y-or-n-p)
39;; Auto-refresh files changed on the file system
40(global-auto-revert-mode 1)
41
42#+END_SRC
43
44Use UTF-8 as the default encoding
45
46#+BEGIN_SRC emacs-lisp
47(set-language-environment "UTF-8")
48(set-default-coding-systems 'utf-8)
49#+END_SRC
50
51I primarily use OS's that favor unix line endings, but occasionally I use
52Windows. This forces the buffers to be utf-8 with unix line endings by default.
53
54#+BEGIN_SRC emacs-lisp
55(setq default-buffer-file-coding-system 'utf-8-unix)
56#+END_SRC
57
58Transient-mark-mode makes a region active only when it is highlighted.
59Delete-selection-mode allows you to overwrite regions with what you're typing,
60pasting, etc. This mimics the behavior of other editors.
61
62#+BEGIN_SRC emacs-lisp
63(transient-mark-mode 1)
64(delete-selection-mode 1)
65#+END_SRC
66
67Trim trailing whitespace in my all of my files. If it turns out there is a
68filetype that should include trailing whitespace I will whitelist it.
69
70#+BEGIN_SRC emacs-list
71(add-hook 'write-file-hooks
72 '(lambda ()
73 (delete-trailing-whitespace)))
74#+END_SRC
75*** Look and Feel
76#+BEGIN_SRC emacs-lisp
77;; Hide the toolbar
78(tool-bar-mode -1)
79;; Hide the scrollbar
80(scroll-bar-mode -1)
81;; no beep
82(setq ring-bell-function 'ignore
83 visible-bell nil)
84
85;; display the full file path in the titlebar
86(setq frame-title-format
87 (list (format "%s %%S: %%j " (system-name))
88 '(buffer-file-name "%f" (dired-directory dired-directory "%b"))))
89#+END_SRC
90
91Start Emacs full screen by default.
92#+BEGIN_SRC emacs-lisp
93(toggle-frame-maximized)
94#+END_SRC
95
96Winner mode tracks your window layouts so you can cycle between them with
97=C-c <left-arrow>= and =C-c <right-arrow>=. It is extra handy when some other
98mode ruins your current window layout.
99
100#+BEGIN_SRC emacs-lisp
101(winner-mode 1)
102#+END_SRC
103*** Local Elisp Code
104Add directories where I store elisp code to the load path
105
106#+BEGIN_SRC emacs-lisp
107(add-to-list 'load-path "~/.emacs.d/local-lib/")
108#+END_SRC
109
110Include my custom functions
111
112#+BEGIN_SRC emacs-lisp
113(require 'zzq-funcs)
114#+END_SRC
115
116Usernames and passwords are stored in a non-published file
117#+BEGIN_SRC emacs-lisp
118(load "~/.emacs.d/secrets" t)
119#+END_SRC
120*** Keybindings
121By default Emacs binds ~C-x k~ to ~kill-buffer~ which asks for the buffer you
122want to close. 99.9% of the time I want to kill the buffer that is active so
123make that the default behavior
124
125#+BEGIN_SRC emacs-lisp
126(global-set-key (kbd "C-x k") 'kill-this-buffer)
127#+END_SRC
128
129~ibuffer~ is a better buffer list utility so redefine the default buffer list
130to it.
131
132#+BEGIN_SRC
133;; Use ibuffer for the buffer list
134(global-set-key (kbd "C-x C-b") 'ibuffer)
135#+END_SRC
136* Package Initalization
137Define the package repositories
138
139#+BEGIN_SRC emacs-lisp
140(setq package-archives '(
141 ("elpa" . "http://elpa.gnu.org/packages/")
142 ;; For org-mode
143 ("org" . "http://orgmode.org/elpa/")
144 ;; melpa builds git repositories and can be unstable
145 ("melpa" . "http://melpa.org/packages/")
146 ;; marmalade has version uploaded by the maintainers
147 ;; ("marmalade" . "https://marmalade-repo.org/packages/")
148 ;; melpa-stable builds from git tags but may be missing dependencies
149 ;; ("melpa-stable" . "https://stable.melpa.org/packages/")
150 ))
151(package-initialize)
152#+END_SRC
153
154I use jweigly's [[https://github.com/jwiegley/use-package][use-package]] to manage packages so it needs to be installed.
155
156#+BEGIN_SRC emacs-lisp
157;; Packages are managed by the use-package package, so we need to make sure it's installed
158(unless (package-installed-p 'use-package)
159 (package-refresh-contents)
160 (package-install 'use-package))
161(eval-when-compile
162 (require 'use-package))
163;; slight optimization for use-package's :bind directive
164(require 'bind-key)
165#+END_SRC
166* Themes
167[[https://github.com/synic/jbeans-emacs][jbeans]] is a jellybeans.vim clone maintained by synic
168
169#+BEGIN_SRC emacs-lisp
170(require 'jbeans-theme)
171(load-theme 'jbeans t)
172#+END_SRC
173* Auto-completion
174I use [[https://company-mode.github.io/][company-mode]] for autocompletion.
175
176#+BEGIN_SRC emacs-lisp
177(use-package company
178 :ensure t
179 :init
180 (setq
181 ;; Display the suggestion popup quickly
182 company-idle-delay 0.4
183 ;; Display the suggestion popup after 1 character
184 company-minimum-prefix-length 1)
185 :config
186 (add-hook 'company-mode-hook '(lambda ()
187 (progn
188 ;; I prefer to use TAB instead of RETURN to finish completion
189 (define-key company-active-map [return] nil)
190 (define-key company-active-map [tab] 'company-complete-selection)))))
191#+END_SRC
192
193[[https://github.com/expez/company-quickhelp][Company-quickhelp]] displays documentation in a popup next to the match list
194
195#+BEGIN_SRC emacs-lisp
196(use-package company-quickhelp
197 :ensure t
198 :config
199 (add-hook 'company-mode-hook '(lambda ()
200 (progn
201 (company-quickhelp-mode)))))
202#+END_SRC
203* Version Control
204Use [[https://magit.vc/][magit]] to supplement emacs built in version control system
205
206#+BEGIN_SRC emacs-lisp
207(use-package magit
208 :ensure t
209 :commands (magit-status magit-blame magit-log-buffer-file)
210 :bind (("C-c v s" . magit-status)
211 ("C-c v B" . magit-blame)
212 ("C-c v L" . magit-log-buffer-file)))
213#+END_SRC
214* Packages
215** org-mode
216**** Setup
217Start org-indent-mode. This displays a single indented star instead of many
218stars in org-mode headings.
219
220#+BEGIN_SRC emacs-lisp
221(setq org-startup-indented t
222 org-src-fontify-natively t)
223#+END_SRC
224**** Key Bindings
225Define the keybindings for org-mode related things
226
227| Key | Function | Description |
228|-----+------------+-----------------------------|
229| F12 | org-agenda | Display the org-agenda menu |
230| | | |
231
232#+BEGIN_SRC emacs-lisp
233(global-set-key (kbd "<f12>") 'org-agenda)
234#+END_SRC
235**** Agenda
236Rather than using ~C-[~ and ~C-]~ for adding files to the agenda manually this
237defines directories that include all org files in the agenda.
238#+BEGIN_SRC emacs-lisp
239(setq org-agenda-files '("~/org/"))
240#+END_SRC
241**** HTMLize
242Styles source code blocks when exporting an org file to HTML
243
244#+BEGIN_SRC emacs-lisp
245(use-package htmlize
246 :ensure t)
247#+END_SRC
248** Paradox
249[[https://github.com/Malabarba/paradox/][Paradox]] is a better emacs package manager.
250
251#+BEGIN_SRC emacs-lisp
252(use-package paradox
253 :ensure t
254 :config
255 (paradox-enable))
256#+END_SRC
257** avy
258[[https://github.com/abo-abo/avy][avy]] is a quick way to jump around buffers
259
260#+BEGIN_SRC emacs-lisp
261(use-package avy
262 :ensure t
263 :bind (("C-:" . avy-goto-line)))
264#+END_SRC
265** which-key
266[[https://github.com/justbur/emacs-which-key][which-key]] displays a pop up with key binding hints as you press them
267
268#+BEGIN_SRC emacs-lisp
269(use-package which-key
270 :ensure t
271 :diminish which-key-mode
272 :init
273 (setq which-key-special-keys nil
274 which-key-use-C-h-commands t
275 which-key-echo-keystrokes 0.02
276 which-key-max-description-length 32
277 which-key-sort-order 'which-key-key-order-alpha)
278 :config
279 (which-key-mode))
280#+END_SRC
281** ivy/swiper
282[[https://github.com/abo-abo/swiper][Ivy]], swiper, and counsel are a framework for autocompleting emacs things
283#+BEGIN_SRC emacs-lisp
284(use-package ivy
285 :ensure t
286 :pin elpa
287 :diminish ivy-mode
288 :bind (("C-s" . swiper)
289 ("M-x" . counsel-M-x)
290 ("C-x C-f" . counsel-find-file))
291 :init
292 (setq
293 ;; Remove the ^ prefix
294 ivy-initial-inputs-alist nil
295 ;; Display recently opened files when switching buffers
296 ivy-use-virtual-buffers t
297 ;; Use ivy for magit
298 magit-completing-read-function 'ivy-completing-read
299 ;; Use ivy for projectile
300 projectile-completion-system 'ivy)
301 :config
302 (ivy-mode 1))
303#+END_SRC
304** persp-mode
305[[https://github.com/Bad-ptr/persp-mode.el][persp-mode]] enables "workspaces" within Emacs. This is similar to how a window
306manager might have several desktops
307
308#+BEGIN_SRC emacs-lisp
309(use-package persp-mode
310 :ensure t
311 :bind (([f8] . persp-switch))
312 :init
313 (setq persp-nil-name "Home"
314 persp-auto-resume-time 0)
315 ;; Adding this so that capturing process is not interrupted with annoying
316 ;; prompts "Kill and Close" etc.
317 (setq persp-kill-foreign-buffer-action nil
318 ;; increase the default name length
319 persp-lighter '(:eval (format (propertize " #%.10s"
320 'face (let ((persp (get-current-persp)))
321 (if persp
322 (if (persp-contain-buffer-p (current-buffer) persp)
323 'persp-face-lighter-default
324 'persp-face-lighter-buffer-not-in-persp)
325 'persp-face-lighter-nil-persp)))
326 (safe-persp-name (get-current-persp)))))
327 :config
328 ;; Set the persp-mode keymap prefix to <F9>, p
329 (persp-set-keymap-prefix (kbd "<f9> p"))
330 (persp-mode 1))
331#+END_SRC
332** powerline
333[[https://github.com/milkypostman/powerline][powerline]] is a prettier mode line for emacs
334
335#+BEGIN_SRC emacs-lisp
336(use-package powerline
337 :ensure t
338 :init
339 (setq powerline-default-separator 'wave
340 powerline-display-mule-info nil)
341 :config
342 (powerline-default-theme))
343#+END_SRC
344** projectile
345[[https://github.com/bbatsov/projectile][projectile]] adds some features around projects, for example finding only files
346that are in the current project (defined by a .git directory).
347
348#+BEGIN_SRC emacs-lisp
349(use-package projectile
350 :ensure t
351 :diminish projectile-mode
352 :config
353 (projectile-global-mode))
354#+END_SRC
355* Languages
356** Python
357Elpy does a great job of supporting Python so I just use that.
358
359#+BEGIN_SRC emacs-lisp
360(add-to-list 'package-archives
361 '("elpy" . "http://jorgenschaefer.github.io/packages/"))
362
363(use-package elpy
364 :ensure t
365 :config
366 (elpy-enable))
367#+END_SRC
368** Rust
369Installation:
370- Install Rust: https://www.rust-lang.org/en-US/install.html
371- Install Racer: https://github.com/racer-rust/racer
372- Install the Rust source: =rustup component add rust-src= This goes to:
373 ~/.multirust/toolchains/[toolchain]/lib/rustlib/src/rust/src
374- Define the =RUST_SRC_PATH= environment var to the source directory
375
376#+BEGIN_SRC emacs-lisp
377(use-package rust-mode
378 :ensure t
379 :commands (rust-mode))
380
381(use-package cargo
382 :ensure t
383 :commands (cargo-minor-mode))
384
385(use-package racer
386 :ensure t
387 :commands (racer-mode))
388
389(add-hook 'rust-mode-hook (lambda ()
390 (racer-mode)
391 (cargo-minor-mode)))
392(add-hook 'racer-mode-hook #'company-mode)
393#+END_SRC
diff --git a/init.el b/init.el
deleted file mode 100644
index a1669b8..0000000
--- a/init.el
+++ /dev/null
@@ -1,218 +0,0 @@
1;;; init.el --- emacs start up
2;; Author: jason <jason@zzq.org>
3;; Created: 15 Jun 2017
4;; Version: 2
5;; Keywords:
6;; X-URL: https://beehive.io/jason/emacs.d/
7;;; Commentary:
8;;
9;;; Code:
10(defconst emacs-start-time (current-time))
11(setq inhibit-startup-screen t ;; Hide the default startup screen
12 savehist-file "~/.emacs.d/savehist"
13 ;; Define where to store recovery files
14 backup-directory-alist '(("." . "~/.emacs.d/backups"))
15 ;; Use version numbers for backups.
16 version-control t
17 ;; Number of newest versions to keep.
18 kept-new-versions 10
19 ;; Number of oldest versions to keep.
20 kept-old-versions 0
21 ;; Don't ask to delete excess backup versions.
22 delete-old-versions -1
23 ;; Copy all files, don't rename them.
24 backup-by-copying t
25 ;; Make backups files under version control.
26 vc-make-backup-files t
27 ;; Don't confirm following when opening a symlink
28 vc-follow-symlinks t)
29
30(setq package-archives '(("elpa" . "http://elpa.gnu.org/packages/")
31 ;; For org-mode
32 ("org" . "http://orgmode.org/elpa/")
33 ;; melpa builds git repositories and can be unstable
34 ("melpa" . "http://melpa.org/packages/")
35 ;; marmalade has maintainers upload versions
36 ;; ("marmalade" . "https://marmalade-repo.org/packages/")
37 ;; melpa-stable builds from git tags but may be missing dependencies
38 ;; ("melpa-stable" . "https://stable.melpa.org/packages/")
39 ;; Elpy packages for the Python language
40 ;; ("elpy" . "https://jorgenschaefer.github.io/packages/")
41 ))
42
43;; Initializes installed packages
44(package-initialize)
45
46;; Packages are managed by the use-package package, so we need to make sure it's installed
47(unless (package-installed-p 'use-package)
48 (package-refresh-contents)
49 (package-install 'use-package))
50(eval-when-compile
51 (require 'use-package))
52;; slight optimization for use-package's :bind directive
53(require 'bind-key)
54
55;; Add local library to the load path
56(add-to-list 'load-path "~/.emacs.d/local-lib/")
57;; Usernames and passwords are stored in a file that isn't sync'd to VC
58(load "~/.emacs.d/secrets" t)
59
60;; My misc functions
61(require 'zzq-funcs)
62
63(add-hook 'after-init-hook
64 (lambda ()
65 (progn
66 ;; Maximize the frame on startup
67 (toggle-frame-maximized)
68 ;; Always ensure packages are installed if they are defined with use-package
69 ;; (setq use-package-always-ensure t)
70
71 ;; Set default encoding to UTF-8
72 (set-language-environment "UTF-8")
73 (set-default-coding-systems 'utf-8)
74 (setq default-buffer-file-coding-system 'utf-8-unix)
75 ;; Hide the toolbar
76 (tool-bar-mode -1)
77 ;; Hide the scrollbar
78 (scroll-bar-mode -1)
79 ;; no beep and no blinking cursor
80 (setq ring-bell-function 'ignore
81 visible-bell nil
82 ;; display the full file path in the titlebar
83 frame-title-format
84 (list (format "%s %%S: %%j " (system-name))
85 '(buffer-file-name "%f" (dired-directory dired-directory "%b"))))
86
87 ;; Show matched parens
88 (show-paren-mode t)
89 ;; Allow undoing/redoing of window layouts with C-c left/right arrows
90 (winner-mode 1)
91 ;; Let y and n be good enough for yes and no questions
92 (fset 'yes-or-no-p 'y-or-n-p)
93 ;; Auto-refresh files changed on the file system
94 (global-auto-revert-mode 1)
95 ;; Save commands and their history
96 (savehist-mode +1)
97 (setq savehist-save-minibuffer-history +1)
98 (setq savehist-additional-variables
99 '(kill-ring
100 search-ring
101 regexp-search-ring))
102 ;; Allow mouse support in xterm
103 (xterm-mouse-mode 1)
104 ;; Automatically close parens when opening them
105 (electric-pair-mode 1)
106 ;; Ovewrite selected regions with what you're typing/pasting/etc
107 (delete-selection-mode 1)
108 ;; A region is only active when it is highlighted (mimics other editors)
109 (transient-mark-mode 1)
110 ;; Kill the current buffer by default
111 (global-set-key (kbd "C-x k") 'kill-this-buffer)
112 ;; Use ibuffer for the buffer list
113 (global-set-key (kbd "C-x C-b") 'ibuffer)
114 ;;;;;;;;;;;
115 ;; Hooks ;;
116 ;;;;;;;;;;;
117 (add-hook 'write-file-hooks
118 '(lambda ()
119 ;; delete trailing whitespace from all files
120 (delete-trailing-whitespace)))
121 ;;;;;;;;;;;;
122 ;; Themes ;;
123 ;;;;;;;;;;;;
124 (use-package jbeans-theme
125 :ensure t
126 :config
127 (load-theme 'jbeans))
128 ;;;;;;;;;;;;;;
129 ;; Packages ;;
130 ;;;;;;;;;;;;;;
131 ;; paradox - A better emacs package manager
132 (use-package paradox
133 :ensure t
134 :config
135 ;; Use paradox as the default package manager
136 (paradox-enable))
137 ;; which-key - Displays a pop up with hints when pushing key bindings
138 (use-package which-key
139 :ensure t
140 :diminish which-key-mode
141 :init
142 (setq which-key-special-keys nil
143 which-key-use-C-h-commands t
144 which-key-echo-keystrokes 0.02
145 which-key-max-description-length 32
146 which-key-sort-order 'which-key-key-order-alpha)
147 :config
148 (which-key-mode))
149 ;; Ivy, swiper, and counsel for autocompleting emacs things
150 (use-package ivy
151 :ensure t
152 :pin elpa
153 :diminish ivy-mode
154 :bind (("C-s" . swiper)
155 ("M-x" . counsel-M-x)
156 ("C-x C-f" . counsel-find-file))
157 :init
158 ;; Remove the ^ prefix
159 (setq ivy-initial-inputs-alist nil
160 ;; Display recently opened files when switching buffers
161 ivy-use-virtual-buffers t
162 ;; Use ivy for magit
163 magit-completing-read-function 'ivy-completing-read
164 ;; Use ivy for projectile
165 projectile-completion-system 'ivy)
166 :config
167 (ivy-mode 1))
168 ;; avy - A quick way to jump around buffers
169 (use-package avy
170 :ensure t
171 :bind (("C-:" . avy-goto-line)))
172
173 ;; Other packages
174 ;; autocompletion - auto-completion for programming languages
175 (require 'autocompletion-conf)
176 ;; persp - virtual workspaces
177 (require 'persp-conf)
178 ;; powerline - prettier modeline
179 (require 'powerline-conf)
180 ;; projectile - utilities for working with projects
181 (require 'projectile-conf)
182 (require 'version-control-conf)
183
184 ;; Languages
185 (require 'python-conf)
186 (require 'rust-conf)
187
188 (message "Emacs loaded in %.3fs"
189 (/ (- (zzq/time-to-msec (current-time)) (zzq/time-to-msec emacs-start-time)) 1000.0))
190 ))) ;; End progn/lambda/add-hook after-init-hook
191
192(custom-set-variables
193 ;; custom-set-variables was added by Custom.
194 ;; If you edit it by hand, you could mess it up, so be careful.
195 ;; Your init file should contain only one such instance.
196 ;; If there is more than one, they won't work right.
197 '(custom-safe-themes
198 (quote
199 ("64f2981274fd8740b794bce9feee7949ed87b88fc0b4654bd98594e1aa81abcd" default)))
200 '(package-selected-packages
201 (quote
202 (elpy magit racer cargo rust-mode company-quickhelp company projectile persp-mode avy ivy powerline which-key paradox use-package jbeans-theme)))
203 '(paradox-github-token t)
204 '(safe-local-variable-values
205 (quote
206 ((eval let
207 ((virtualenv "~/.virtualenvs/eb"))
208 (setq-local pythonic-environment virtualenv)
209 (my/advise-pythonic-activate virtualenv)))))
210 '(show-paren-mode t)
211 '(tool-bar-mode nil))
212
213(custom-set-faces
214 ;; custom-set-faces was added by Custom.
215 ;; If you edit it by hand, you could mess it up, so be careful.
216 ;; Your init file should contain only one such instance.
217 ;; If there is more than one, they won't work right.
218 '(default ((t (:family "Inconsolata" :foundry "PfEd" :slant normal :weight normal :height 98 :width normal)))))
diff --git a/local-lib/autocompletion-conf.el b/local-lib/autocompletion-conf.el
deleted file mode 100644
index 0b5d200..0000000
--- a/local-lib/autocompletion-conf.el
+++ /dev/null
@@ -1,30 +0,0 @@
1;;; autocompletion-conf.el --- configuration for language auto-complete
2;; Author: jason <jason@zzq.org>
3;; Created: 16 Jun 2017
4;;; Commentary:
5;;
6;; Configures the auto-completion framework (company-mode)
7;;
8;;; Code:
9(use-package company
10 :ensure t
11 :init
12 (setq
13 ;; Display the suggestion popup quickly
14 company-idle-delay 0.4
15 ;; Display the suggestion popup after 1 character
16 company-minimum-prefix-length 1)
17 :config
18 (add-hook 'company-mode-hook '(lambda ()
19 (progn
20 ;; I prefer to use TAB instead of RETURN to finish completion
21 (define-key company-active-map [return] nil)
22 (define-key company-active-map [tab] 'company-complete-selection)))))
23;; Display documentation in a popup
24(use-package company-quickhelp
25 :ensure t
26 :config
27 (add-hook 'company-mode-hook '(lambda ()
28 (progn
29 (company-quickhelp-mode)))))
30(provide 'autocompletion-conf)
diff --git a/local-lib/persp-conf.el b/local-lib/persp-conf.el
deleted file mode 100644
index f875440..0000000
--- a/local-lib/persp-conf.el
+++ /dev/null
@@ -1,38 +0,0 @@
1;;; persp-conf.el --- configuration for persp-mode
2;; Author: jason <jason@zzq.org>
3;; Created: 16 Jun 2017
4;; X-URL: https://github.com/Bad-ptr/persp-mode.el
5;;; Commentary:
6;;
7;; Enables different "workspaces" within Emacs. Similar to how a window manager
8;; might have several desktops
9;;
10;; Bindings:
11;; * <f8> - Switch between perspectives
12;; * <f9>, p - Manage perspectives
13;;
14;;; Code:
15(use-package persp-mode
16 :ensure t
17 :bind (([f8] . persp-switch))
18 :init
19 (setq persp-nil-name "Home"
20 persp-auto-resume-time 0)
21 ;; Adding this so that capturing process is not interrupted with annoying
22 ;; prompts "Kill and Close" etc.
23 (setq persp-kill-foreign-buffer-action nil
24 ;; increase the default name length
25 persp-lighter '(:eval (format (propertize " #%.10s"
26 'face (let ((persp (get-current-persp)))
27 (if persp
28 (if (persp-contain-buffer-p (current-buffer) persp)
29 'persp-face-lighter-default
30 'persp-face-lighter-buffer-not-in-persp)
31 'persp-face-lighter-nil-persp)))
32 (safe-persp-name (get-current-persp)))))
33 :config
34 ;; Set the persp-mode keymap prefix to <F9>, p
35 (persp-set-keymap-prefix (kbd "<f9> p"))
36 (persp-mode 1))
37
38(provide 'persp-conf)
diff --git a/local-lib/powerline-conf.el b/local-lib/powerline-conf.el
deleted file mode 100644
index 710be77..0000000
--- a/local-lib/powerline-conf.el
+++ /dev/null
@@ -1,96 +0,0 @@
1;;; powerline-conf.el --- configuration for powerline
2;; Author: jason <jason@zzq.org>
3;; Created: 16 Jun 2017
4;; X-URL: https://github.com/milkypostman/powerline
5;;; Commentary:
6;;
7;; Styles the Emacs mode line
8;;
9;;; Code:
10(defface my/modeline-narrow-face
11 '((t (:foreground "black" :background "yellow3")))
12 "todo/fixme highlighting."
13 :group 'faces)
14
15(defface my/modeline-read-only-face
16 '((t (:foreground "black" :background "orange4")))
17 "Read-only buffer highlighting."
18 :group 'faces)
19
20(defface my/modeline-modified-face
21 '((t (:foreground "gray80" :background "red4")))
22 "Modified buffer highlighting."
23 :group 'faces)
24
25(defun powerline-my-theme ()
26 "Setup the default mode-line."
27 (interactive)
28 (setq-default mode-line-format
29 '("%e"
30 (:eval
31 (let* ((active (powerline-selected-window-active))
32 (mode-line (if active 'mode-line 'mode-line-inactive))
33 (face1 (if active 'powerline-active1 'powerline-inactive1))
34 (face2 (if active 'powerline-active2 'powerline-inactive2))
35 (separator-left (intern (format "powerline-%s-%s"
36 (powerline-current-separator)
37 (car powerline-default-separator-dir))))
38 (separator-right (intern (format "powerline-%s-%s"
39 (powerline-current-separator)
40 (cdr powerline-default-separator-dir))))
41 (lhs (append (list (powerline-raw " "))
42 (let ((buffer-modified-str (if buffer-read-only
43 (if (buffer-modified-p) "%%*" "%%%%")
44 (if (buffer-modified-p) "**" "--"))))
45 (if buffer-read-only
46 (list (powerline-raw buffer-modified-str 'my/modeline-read-only-face))
47 (if (buffer-modified-p)
48 (list (powerline-raw buffer-modified-str 'my/modeline-modified-face))
49 (list (powerline-raw buffer-modified-str nil))))
50 )
51 (list
52 (when powerline-display-buffer-size
53 (powerline-buffer-size nil 'l))
54 (when powerline-display-mule-info
55 (powerline-raw mode-line-mule-info nil 'l))
56 (powerline-buffer-id nil 'l)
57 (when (and (boundp 'which-func-mode) which-func-mode)
58 (powerline-raw which-func-format nil 'l))
59 (powerline-raw " ")
60 (funcall separator-left mode-line face1)
61 (when (and (boundp 'erc-track-minor-mode) erc-track-minor-mode)
62 (powerline-raw erc-modified-channels-object face1 'l))
63 (powerline-major-mode face1 'l)
64 (powerline-process face1)
65 (powerline-minor-modes face1 'l)
66 (powerline-narrow face1 'l)
67 (powerline-raw " " face1)
68 (funcall separator-left face1 face2)
69 (powerline-vc face2 'r)
70 (when (bound-and-true-p nyan-mode)
71 (powerline-raw (list (nyan-create)) face2 'l)))))
72 (rhs (list (powerline-raw global-mode-string face2 'r)
73 ;; (funcall separator-right face2 face1)
74 ;; (unless window-system
75 ;; (powerline-raw (char-to-string #xe0a1) face1 'l))
76 (powerline-raw "%4l" face1 'l)
77 (powerline-raw ":" face1 'l)
78 (powerline-raw "%3c" face1 'r)
79 (funcall separator-right face1 mode-line)
80 (powerline-raw " ")
81 (powerline-raw "%6p" nil 'r)
82 (when powerline-display-hud
83 (powerline-hud face2 face1)))))
84 (concat (powerline-render lhs)
85 (powerline-fill face2 (powerline-width rhs))
86 (powerline-render rhs)))))))
87
88(use-package powerline
89 :ensure t
90 :config
91 (setq powerline-default-separator 'wave
92 powerline-display-mule-info nil)
93
94 (powerline-my-theme))
95
96(provide 'powerline-conf)
diff --git a/local-lib/projectile-conf.el b/local-lib/projectile-conf.el
deleted file mode 100644
index 0472af8..0000000
--- a/local-lib/projectile-conf.el
+++ /dev/null
@@ -1,16 +0,0 @@
1;;; projectile-conf.el --- configuration for projectile-mode
2;; Author: jason <jason@zzq.org>
3;; Created: 16 Jun 2017
4;; X-URL: https://github.com/bbatsov/projectile
5;;; Commentary:
6;;
7;; Useful functions for working within projects.
8;;
9;;; Code:
10(use-package projectile
11 :ensure t
12 :diminish projectile-mode
13 :config
14 (projectile-global-mode))
15
16(provide 'projectile-conf)
diff --git a/local-lib/python-conf.el b/local-lib/python-conf.el
deleted file mode 100644
index 6f2a9fa..0000000
--- a/local-lib/python-conf.el
+++ /dev/null
@@ -1,16 +0,0 @@
1;;; python-conf.el --- configuration for the python language
2;; Author: jason <jason@zzq.org>
3;; Created: 16 Jun 2017
4;;; Commentary:
5;;
6;;; Code:
7
8(add-to-list 'package-archives
9 '("elpy" . "http://jorgenschaefer.github.io/packages/"))
10
11(use-package elpy
12 :ensure t
13 :config
14 (elpy-enable))
15
16(provide 'python-conf)
diff --git a/local-lib/rust-conf.el b/local-lib/rust-conf.el
deleted file mode 100644
index 8cc2469..0000000
--- a/local-lib/rust-conf.el
+++ /dev/null
@@ -1,32 +0,0 @@
1;;; rust-conf.el --- configuration for the rust language
2;; Author: jason <jason@zzq.org>
3;; Created: 16 Jun 2017
4;;; Commentary:
5;;
6;; Installation:
7;; * Install Rust: https://www.rust-lang.org/en-US/install.html
8;; * Install Racer: https://github.com/racer-rust/racer
9;; * Install the Rust source: rustup component add rust-src - This goes to:
10;; ~/.multirust/toolchains/[toolchain]/lib/rustlib/src/rust/src
11;; * Define the RUST_SRC_PATH environment var to the source directory
12;;
13;;; Code:
14(use-package rust-mode
15 :ensure t
16 :commands (rust-mode))
17
18(use-package cargo
19 :ensure t
20 :commands (cargo-minor-mode))
21
22(use-package racer
23 :ensure t
24 :commands (racer-mode))
25
26(add-hook 'rust-mode-hook (lambda ()
27 (progn
28 (racer-mode)
29 (cargo-minor-mode))))
30(add-hook 'racer-mode-hook #'company-mode)
31
32(provide 'rust-conf)
diff --git a/local-lib/version-control-conf.el b/local-lib/version-control-conf.el
deleted file mode 100644
index a5e41df..0000000
--- a/local-lib/version-control-conf.el
+++ /dev/null
@@ -1,16 +0,0 @@
1;;; version-control-conf.el --- configuration for version control
2;; Author: jason <jason@zzq.org>
3;; Created: 16 Jun 2017
4;;; Commentary:
5;;
6;; Configures version control (magit)
7;;
8;;; Code:
9(use-package magit
10 :ensure t
11 :commands (magit-status magit-blame magit-log-buffer-file)
12 :bind (("C-c v s" . magit-status)
13 ("C-c v B" . magit-blame)
14 ("C-c v L" . magit-log-buffer-file)))
15
16(provide 'version-control-conf)