refactor: Begin moving package configuration to use-package

This is the first in a series of commits for refactoring my
configuration to make use of jwiegley's use-package.

In the previous layout of the configuration there were some questions
around what settings go into which file, but in the end it is all just
related to which packages are being configured (besides settings
related to global Emacs behaviour).

This commit introduces use-package forms for all currently used
packages (which are still installed via Nix, not via package.el) but
does not yet clean up the rest of the configuration in a suitable way.

Note that this version introduces a bug in which the configuration of
telephone line is not correctly initialised after package setup.
This commit is contained in:
Vincent Ambo 2018-06-22 10:29:31 +02:00 committed by Vincent Ambo
parent f0dfc8b06d
commit 4fe8d78dbb
10 changed files with 218 additions and 216 deletions

View file

@ -1,14 +1,6 @@
;; Initializes modes I use.
(add-hook 'prog-mode-hook 'esk-add-watchwords)
(add-hook 'prog-mode-hook 'idle-highlight-mode)
;; Configure markdown-mode
(autoload 'markdown-mode "markdown-mode"
"Major mode for editing Markdown files" t)
(add-to-list 'auto-mode-alist '("\\.txt\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))
;; Use auto-complete as completion at point
(defun set-auto-complete-as-completion-at-point-function ()
@ -17,35 +9,18 @@
(add-hook 'auto-complete-mode-hook
'set-auto-complete-as-completion-at-point-function)
;; Configure Erlang mode
(defun erlang-mode-init-setup ()
(interactive)
;; Don't indent after '>' while I'm writing
(local-set-key ">" 'self-insert-command)
;;(local-set-key "RET" 'newline)
(rainbow-delimiters-mode 1)
)
(add-hook 'erlang-mode-hook 'erlang-mode-init-setup)
;; Enable rainbow-delimiters for all things programming
(add-hook 'prog-mode-hook 'rainbow-delimiters-mode)
;; Enable Paredit & Company in Emacs Lisp mode
(add-hook 'emacs-lisp-mode-hook 'paredit-mode)
(add-hook 'emacs-lisp-mode-hook 'company-mode)
;; Always highlight matching brackets
(show-paren-mode 1)
;; Always auto-close parantheses and other pairs
(electric-pair-mode)
;; Represent undo-history as an actual tree (visualize with C-x u)
(setq undo-tree-mode-lighter "")
(require 'undo-tree)
(global-undo-tree-mode)
;; (replaced by smartparens)
;; (electric-pair-mode)
;; Keep track of recent files
(recentf-mode)
@ -57,9 +32,5 @@
(auto-compression-mode t)
;; Show available key chord completions
(which-key-mode t)
;; Show previews of ace-window numbers in the mode line for each window.
(ace-window-display-mode)
(provide 'modes)