2017-01-24 21:11:11 +01:00
|
|
|
;;; William Carroll's Emacs configuration
|
2017-01-09 02:34:18 +01:00
|
|
|
|
|
|
|
|
2017-01-14 04:01:45 +01:00
|
|
|
;; From `https://github.com/melpa/melpa`
|
|
|
|
(require 'package)
|
|
|
|
(add-to-list 'package-archives
|
|
|
|
'("melpa" . "https://melpa.org/packages/") t)
|
|
|
|
(when (< emacs-major-version 24)
|
|
|
|
;; For important compatibility libraries like cl-lib
|
|
|
|
(add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/")))
|
2016-12-26 06:40:14 +01:00
|
|
|
(package-initialize)
|
|
|
|
|
2017-01-14 04:01:45 +01:00
|
|
|
|
2016-12-26 06:40:14 +01:00
|
|
|
(custom-set-variables
|
2017-01-01 00:13:14 +01:00
|
|
|
;; 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.
|
2017-01-14 04:01:45 +01:00
|
|
|
'(column-number-mode t)
|
2017-01-06 02:39:32 +01:00
|
|
|
'(custom-safe-themes
|
|
|
|
(quote
|
2017-02-13 17:21:23 +01:00
|
|
|
("9f3181dc1fabe5d58bbbda8c48ef7ece59b01bed606cfb868dd147e8b36af97c" "ad1c2abad40e11d22156fe3987fd9b74b9e1c822264a07dacb24e0b3133aaed1" "945fe66fbc30a7cbe0ed3e970195a7ee79ee34f49a86bc96d02662ab449b8134" "0f0db69b7a75a7466ef2c093e127a3fe3213ce79b87c95d39ed1eccd6fe69f74" "08b8807d23c290c840bbb14614a83878529359eaba1805618b3be7d61b0b0a32" "9d91458c4ad7c74cf946bd97ad085c0f6a40c370ac0a1cbeb2e3879f15b40553" "6254372d3ffe543979f21c4a4179cd819b808e5dd0f1787e2a2a647f5759c1d1" "8ec2e01474ad56ee33bc0534bdbe7842eea74dccfb576e09f99ef89a705f5501" "5b24babd20e58465e070a8d7850ec573fe30aca66c8383a62a5e7a3588db830b" "eb0a314ac9f75a2bf6ed53563b5d28b563eeba938f8433f6d1db781a47da1366" "3d47d88c86c30150c9a993cc14c808c769dad2d4e9d0388a24fee1fbf61f0971" default)))
|
2017-01-06 02:39:32 +01:00
|
|
|
'(evil-shift-width 2)
|
2016-12-31 03:10:34 +01:00
|
|
|
'(mouse-wheel-mode nil)
|
2017-01-01 00:13:14 +01:00
|
|
|
'(neo-window-fixed-size nil)
|
|
|
|
'(neo-window-width 35)
|
2016-12-26 06:40:14 +01:00
|
|
|
'(package-selected-packages
|
|
|
|
(quote
|
2017-02-01 20:38:22 +01:00
|
|
|
(all-the-icons-dired ace-window yasnippet chess synonyms powerline doom-neotree doom-themes persp-mode use-package helm-projectile persp-projectile perspective projectile with-editor helm-core company helm-ag evil-leader flycheck-mix flycheck-elixir evil-matchit typescript-mode evil-surround erlang elixir-mode golden-ratio flycheck-credo flycheck command-log-mode atom-one-dark-theme exec-path-from-shell clues-theme gotham-theme dracula-theme zenburn-theme fill-column-indicator neotree evil iedit vimrc-mode helm-ispell transpose-frame helm-ack nyan-mode alchemist helm magit dockerfile-mode elm-mode ack)))
|
2017-01-14 04:01:45 +01:00
|
|
|
'(popwin-mode t)
|
|
|
|
'(popwin:popup-window-height 25)
|
2017-02-13 17:21:23 +01:00
|
|
|
'(popwin:special-display-config
|
|
|
|
(quote
|
|
|
|
(help-mode
|
|
|
|
("^*helm-.+*$" :regexp t)
|
|
|
|
("^*helm .+*$" :regexp t)
|
|
|
|
("^*helm-.+*$" :regexp t)
|
|
|
|
("^*helm .+*$" :regexp t)
|
|
|
|
("*Miniedit Help*" :noselect t)
|
|
|
|
(completion-list-mode :noselect t)
|
|
|
|
(compilation-mode :noselect t)
|
|
|
|
(grep-mode :noselect t)
|
|
|
|
(occur-mode :noselect t)
|
|
|
|
("*Pp Macroexpand Output*" :noselect t)
|
|
|
|
"*Shell Command Output*" "*vc-diff*" "*vc-change-log*"
|
|
|
|
(" *undo-tree*" :width 60 :position right)
|
|
|
|
("^\\*anything.*\\*$" :regexp t)
|
|
|
|
"*slime-apropos*" "*slime-macroexpansion*" "*slime-description*"
|
|
|
|
("*slime-compilation*" :noselect t)
|
|
|
|
"*slime-xref*"
|
|
|
|
(sldb-mode :stick t)
|
|
|
|
slime-repl-mode slime-connection-list-mode)))
|
2017-01-14 04:01:45 +01:00
|
|
|
'(tool-bar-mode nil))
|
2017-01-01 00:13:14 +01:00
|
|
|
(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.
|
2017-01-06 02:39:32 +01:00
|
|
|
'(hl-line ((t (:inherit nil)))))
|
|
|
|
|
2016-12-26 06:40:14 +01:00
|
|
|
|
2017-02-13 17:21:23 +01:00
|
|
|
;; Window Auto-Balancing
|
|
|
|
(defadvice split-window-below (after restore-balanace-below activate)
|
|
|
|
(balance-windows))
|
|
|
|
|
|
|
|
(defadvice split-window-right (after restore-balance-right activate)
|
|
|
|
(balance-windows))
|
|
|
|
|
|
|
|
(defadvice delete-window (after restore-balance activate)
|
|
|
|
(balance-windows))
|
|
|
|
|
|
|
|
|
|
|
|
;; Command Log Mode
|
|
|
|
(use-package command-log-mode
|
|
|
|
:ensure t
|
|
|
|
:init
|
|
|
|
(setq-default command-log-mode-window-font-size 5)
|
|
|
|
(setq-default command-log-mode-window-size 50)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-01 20:38:22 +01:00
|
|
|
;; Ace Window
|
|
|
|
(use-package ace-window
|
|
|
|
:ensure t
|
|
|
|
:config
|
|
|
|
(setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)))
|
|
|
|
|
|
|
|
|
2017-01-24 21:11:11 +01:00
|
|
|
;; All-the-fonts
|
|
|
|
(use-package all-the-icons
|
|
|
|
:ensure t)
|
2017-01-06 02:39:32 +01:00
|
|
|
|
|
|
|
|
2017-01-30 19:22:27 +01:00
|
|
|
;; Thesaurus
|
|
|
|
(use-package synonyms
|
|
|
|
:ensure t)
|
|
|
|
|
|
|
|
|
2017-01-24 21:11:11 +01:00
|
|
|
;; Doom Themes
|
|
|
|
(use-package doom-themes
|
|
|
|
:ensure t
|
|
|
|
:init
|
2017-01-30 19:22:27 +01:00
|
|
|
(load-theme 'doom-molokai t)
|
2017-01-24 21:11:11 +01:00
|
|
|
(use-package doom-nlinum))
|
2016-12-26 06:40:14 +01:00
|
|
|
|
2017-01-24 21:11:11 +01:00
|
|
|
;; Magit Settings
|
|
|
|
(use-package magit
|
|
|
|
:ensure t
|
|
|
|
:bind (("C-x g" . magit-status)
|
|
|
|
("C-x M-g" . magit-dispatch-popup)))
|
2017-01-24 00:05:21 +01:00
|
|
|
|
2017-01-06 02:39:32 +01:00
|
|
|
|
2017-01-09 02:34:18 +01:00
|
|
|
;; View stream of Emacs commands
|
2017-01-24 21:11:11 +01:00
|
|
|
(use-package command-log-mode
|
|
|
|
:ensure t
|
|
|
|
:commands (global-command-log-mode))
|
2017-01-14 04:01:45 +01:00
|
|
|
|
|
|
|
|
2017-01-09 02:34:18 +01:00
|
|
|
;; Flycheck Settings
|
2017-01-24 21:11:11 +01:00
|
|
|
(use-package flycheck
|
|
|
|
:ensure t)
|
2017-01-09 02:34:18 +01:00
|
|
|
|
|
|
|
|
2017-01-24 21:11:11 +01:00
|
|
|
;; Ansi Term
|
|
|
|
(use-package term
|
|
|
|
:bind (:map term-mode-map
|
|
|
|
("M-p" . term-send-up)
|
|
|
|
("M-n" . term-send-down)
|
2017-01-09 02:34:18 +01:00
|
|
|
|
2017-01-24 21:11:11 +01:00
|
|
|
:map term-raw-map
|
|
|
|
("C-h" . evil-window-left)
|
|
|
|
("C-l" . evil-window-right)
|
|
|
|
("C-k" . evil-window-up)
|
|
|
|
("C-j" . evil-window-down)))
|
2017-01-09 02:34:18 +01:00
|
|
|
|
|
|
|
|
2017-01-24 21:11:11 +01:00
|
|
|
;; Projectile Settings
|
|
|
|
(use-package projectile
|
|
|
|
:ensure t
|
|
|
|
:commands (projectile-mode))
|
2017-01-09 02:34:18 +01:00
|
|
|
|
2016-12-31 03:10:34 +01:00
|
|
|
|
2017-01-30 19:22:27 +01:00
|
|
|
;; Dired Settings
|
|
|
|
(use-package dired
|
|
|
|
:bind (:map dired-mode-map
|
|
|
|
("c" . find-file)))
|
|
|
|
|
|
|
|
|
2017-01-24 21:11:11 +01:00
|
|
|
;; Evil Settings
|
|
|
|
(use-package evil
|
|
|
|
:ensure t
|
|
|
|
:commands (evil-mode local-evil-mode)
|
2017-02-13 17:21:23 +01:00
|
|
|
:bind (:map evil-visual-state-map
|
|
|
|
("H" . evil-first-non-blank)
|
|
|
|
("L" . evil-end-of-visual-line)
|
2017-01-24 21:11:11 +01:00
|
|
|
|
|
|
|
:map evil-motion-state-map
|
|
|
|
("<return>" . nil)
|
|
|
|
("<tab>" . nil)
|
|
|
|
("SPC" . nil)
|
|
|
|
("M-." . nil)
|
|
|
|
|
|
|
|
:map evil-normal-state-map
|
|
|
|
("<return>" . nil)
|
|
|
|
("<tab>" . nil)
|
2017-02-13 17:21:23 +01:00
|
|
|
("K" . nil)
|
|
|
|
("M-." . nil)
|
|
|
|
("s" . nil)
|
2017-01-24 21:11:11 +01:00
|
|
|
("C-h" . evil-window-left)
|
|
|
|
("C-l" . evil-window-right)
|
|
|
|
("C-k" . evil-window-up)
|
|
|
|
("C-j" . evil-window-down)
|
2017-01-30 19:22:27 +01:00
|
|
|
("g c" . comment-or-uncomment-region)
|
|
|
|
("s h" . evil-window-vsplit)
|
2017-02-13 17:21:23 +01:00
|
|
|
("s l" . evil-window-vsplit-right)
|
2017-01-30 19:22:27 +01:00
|
|
|
("s k" . evil-window-split)
|
2017-02-13 17:21:23 +01:00
|
|
|
("s j" . evil-window-split-down)
|
2017-01-24 21:11:11 +01:00
|
|
|
("H" . evil-first-non-blank)
|
2017-02-13 17:21:23 +01:00
|
|
|
("L" . evil-end-of-line)
|
|
|
|
|
|
|
|
:map evil-ex-map
|
|
|
|
("e" . helm-find-files)
|
|
|
|
("tb" . alchemist-test-this-buffer)
|
|
|
|
("tap" . alchemist-test-at-point)
|
|
|
|
("lt" . alchemist-mix-rerun-last-test)
|
|
|
|
)
|
2017-01-24 21:11:11 +01:00
|
|
|
:init
|
2017-02-13 17:21:23 +01:00
|
|
|
(setq evil-emacs-state-cursor '("VioletRed3" box))
|
|
|
|
(setq evil-normal-state-cursor '("DeepSkyBlue2" box))
|
2017-01-24 21:11:11 +01:00
|
|
|
(setq evil-visual-state-cursor '("orange" box))
|
2017-02-13 17:21:23 +01:00
|
|
|
(setq evil-insert-state-cursor '("VioletRed3" bar))
|
|
|
|
(setq evil-replace-state-cursor '("VioletRed3" bar))
|
|
|
|
(setq evil-operator-state-cursor '("VioletRed3" hollow))
|
2017-01-24 21:11:11 +01:00
|
|
|
(global-evil-matchit-mode t)
|
|
|
|
(global-evil-surround-mode t)
|
2017-02-01 20:38:22 +01:00
|
|
|
(global-evil-leader-mode t))
|
2017-01-24 21:11:11 +01:00
|
|
|
|
|
|
|
|
2017-02-13 17:21:23 +01:00
|
|
|
(defun evil-window-vsplit-right ()
|
|
|
|
"Vertically split a window and move right."
|
|
|
|
(interactive)
|
|
|
|
(evil-window-vsplit nil)
|
|
|
|
(evil-window-right 1))
|
|
|
|
|
|
|
|
(defun evil-window-split-down ()
|
|
|
|
"Split a window and move right."
|
|
|
|
(interactive)
|
|
|
|
(evil-window-split nil)
|
|
|
|
(evil-window-down 1))
|
|
|
|
|
|
|
|
|
2017-01-24 21:11:11 +01:00
|
|
|
;; Evil Leader Settings
|
|
|
|
(use-package evil-leader
|
|
|
|
:ensure t
|
|
|
|
:commands (global-evil-leader-mode)
|
|
|
|
:config
|
|
|
|
(evil-leader/set-leader "<SPC>")
|
|
|
|
(evil-leader/set-key
|
|
|
|
"x" 'helm-M-x
|
|
|
|
"<SPC>" 'mode-line-other-buffer
|
2017-02-01 20:38:22 +01:00
|
|
|
"a" 'ace-window
|
2017-01-24 21:11:11 +01:00
|
|
|
"n" 'neotree-project-dir
|
2017-02-13 17:21:23 +01:00
|
|
|
"N" 'neotree-reveal-current-buffer
|
2017-01-30 19:22:27 +01:00
|
|
|
"t" 'alchemist-project-toggle-file-and-tests
|
|
|
|
"f" 'helm-projectile
|
|
|
|
"p" 'helm-projectile-ag
|
|
|
|
"d" 'dired-jump-other-window
|
2017-02-01 20:38:22 +01:00
|
|
|
"D" 'projectile-dired
|
|
|
|
"q" 'kill-this-buffer
|
2017-01-30 19:22:27 +01:00
|
|
|
"h" 'evil-window-left
|
|
|
|
"l" 'evil-window-right
|
|
|
|
"k" 'evil-window-up
|
|
|
|
"j" 'evil-window-down
|
2017-02-13 17:21:23 +01:00
|
|
|
"b" 'helm-mini
|
|
|
|
"T" 'alchemist-mix-test-at-point
|
|
|
|
"B" 'alchemist-mix-test-this-buffer
|
|
|
|
"L" 'alchemist-mix-rerun-last-test
|
|
|
|
))
|
2016-12-31 03:10:34 +01:00
|
|
|
|
2017-01-14 04:01:45 +01:00
|
|
|
|
2017-01-24 21:11:11 +01:00
|
|
|
;; Evil Match-it
|
|
|
|
(use-package evil-matchit
|
|
|
|
:ensure t
|
|
|
|
:commands (global-evil-matchit-mode))
|
2017-01-14 04:01:45 +01:00
|
|
|
|
2017-01-24 00:05:21 +01:00
|
|
|
|
2017-01-24 21:11:11 +01:00
|
|
|
;; Evil Surround
|
|
|
|
(use-package evil-surround
|
|
|
|
:ensure t
|
|
|
|
:commands (global-evil-surround-mode))
|
2017-01-24 00:05:21 +01:00
|
|
|
|
2017-01-14 04:01:45 +01:00
|
|
|
|
2017-01-24 21:11:11 +01:00
|
|
|
;; Flycheck Mix Settings
|
|
|
|
(use-package flycheck-mix
|
|
|
|
:ensure t
|
|
|
|
:init
|
|
|
|
(flycheck-mix-setup))
|
2017-01-14 04:01:45 +01:00
|
|
|
|
|
|
|
|
2017-01-24 21:11:11 +01:00
|
|
|
;; Flycheck Credo Settings
|
|
|
|
(use-package flycheck-credo
|
|
|
|
:ensure t
|
|
|
|
:init
|
|
|
|
(flycheck-credo-setup))
|
2017-01-14 04:01:45 +01:00
|
|
|
|
|
|
|
|
2017-01-24 21:11:11 +01:00
|
|
|
;; Popwin Settings
|
|
|
|
(use-package popwin
|
|
|
|
:ensure t)
|
2017-01-06 02:39:32 +01:00
|
|
|
|
2017-01-24 21:11:11 +01:00
|
|
|
(defun *-popwin-help-mode-off ()
|
|
|
|
"Turn `popwin-mode' off for *Help* buffers."
|
2017-01-06 02:39:32 +01:00
|
|
|
|
2017-01-24 21:11:11 +01:00
|
|
|
(when (boundp 'popwin:special-display-config)
|
|
|
|
(customize-set-variable 'popwin:special-display-config
|
|
|
|
(delq 'help-mode popwin:special-display-config))))
|
2017-01-14 04:01:45 +01:00
|
|
|
|
2017-01-24 21:11:11 +01:00
|
|
|
(defun *-popwin-help-mode-on ()
|
|
|
|
"Turn `popwin-mode' on for *Help* buffers."
|
2017-01-14 04:01:45 +01:00
|
|
|
|
2017-01-24 21:11:11 +01:00
|
|
|
(when (boundp 'popwin:special-display-config)
|
|
|
|
(customize-set-variable 'popwin:special-display-config
|
|
|
|
(add-to-list 'popwin:special-display-config 'help-mode nil #'eq))))
|
2017-01-14 04:01:45 +01:00
|
|
|
|
2017-01-24 21:11:11 +01:00
|
|
|
(add-hook 'helm-minibuffer-set-up-hook #'*-popwin-help-mode-off)
|
|
|
|
(add-hook 'helm-cleanup-hook #'*-popwin-help-mode-on)
|
2017-01-14 04:01:45 +01:00
|
|
|
|
2017-01-24 21:11:11 +01:00
|
|
|
(setq display-buffer-function 'popwin:display-buffer)
|
|
|
|
(setq helm-split-window-preferred-function 'ignore)
|
|
|
|
(push '("^\*helm .+\*$" :regexp t) popwin:special-display-config)
|
|
|
|
(push '("^\*helm-.+\*$" :regexp t) popwin:special-display-config)
|
2016-12-31 03:10:34 +01:00
|
|
|
|
|
|
|
|
|
|
|
;; Alchemist Settings
|
2017-01-24 21:11:11 +01:00
|
|
|
(use-package alchemist
|
|
|
|
:ensure t
|
|
|
|
:config
|
|
|
|
(setq alchemist-mix-env "prod")
|
|
|
|
(setq alchemist-goto-elixir-source-dir "/Users/wpcarro/source_code/elixir")
|
|
|
|
(setq alchemist-goto-erlang-source-dir "/Users/wpcarro/source_code/otp/")
|
|
|
|
:init
|
|
|
|
(linum-mode))
|
2017-01-06 02:39:32 +01:00
|
|
|
|
|
|
|
(defun custom-erlang-mode-hook ()
|
2017-01-24 21:11:11 +01:00
|
|
|
"Jump to and from Elixir, Erlang, Elixir files."
|
|
|
|
|
2017-01-06 02:39:32 +01:00
|
|
|
(define-key erlang-mode-map (kbd "M-,") 'alchemist-goto-jump-back))
|
|
|
|
|
|
|
|
(add-hook 'erlang-mode-hook 'custom-erlang-mode-hook)
|
|
|
|
|
2016-12-31 03:22:57 +01:00
|
|
|
|
2017-01-01 00:13:14 +01:00
|
|
|
;; NeoTree Settings
|
2017-01-24 21:11:11 +01:00
|
|
|
(use-package neotree
|
|
|
|
:ensure t
|
|
|
|
:bind (:map neotree-mode-map
|
|
|
|
("j" . next-line)
|
|
|
|
("k" . previous-line)
|
|
|
|
("<return>" . neotree-enter)
|
|
|
|
("<tab>" . neotree-enter)
|
2017-02-13 17:21:23 +01:00
|
|
|
("D" . neotree-delete-node)
|
|
|
|
("R" . neotree-rename-node)
|
|
|
|
("c" . neotree-create-node)
|
2017-01-24 21:11:11 +01:00
|
|
|
("C-h" . evil-window-left)
|
|
|
|
("C-l" . evil-window-right)
|
|
|
|
("C-k" . evil-window-up)
|
|
|
|
("C-j" . evil-window-down))
|
|
|
|
:init
|
2017-01-30 19:22:27 +01:00
|
|
|
(hl-line-mode)
|
2017-02-13 17:21:23 +01:00
|
|
|
(setq neo-theme (if (display-graphic-p) 'icons 'arrow))
|
|
|
|
(setq-default neo-show-hidden-files t))
|
2017-01-01 00:13:14 +01:00
|
|
|
|
|
|
|
(defun neotree-project-dir ()
|
|
|
|
"Open NeoTree using the git root."
|
|
|
|
(interactive)
|
2017-02-13 17:21:23 +01:00
|
|
|
(let ((project-dir (projectile-project-root)))
|
|
|
|
(neotree-toggle)
|
|
|
|
(if project-dir
|
|
|
|
(if (neo-global--window-exists-p)
|
|
|
|
(progn
|
|
|
|
(neotree-dir project-dir)
|
|
|
|
(neotree-show)))
|
|
|
|
(message "Could not find git project root."))))
|
|
|
|
|
|
|
|
|
|
|
|
(defun neotree-reveal-current-buffer ()
|
|
|
|
"Reveal current buffer in Neotree."
|
|
|
|
(interactive)
|
2017-01-01 00:13:14 +01:00
|
|
|
(let ((project-dir (projectile-project-root))
|
|
|
|
(file-name (buffer-file-name)))
|
2017-02-13 17:21:23 +01:00
|
|
|
|
|
|
|
(neotree-show)
|
2017-01-01 00:13:14 +01:00
|
|
|
(if project-dir
|
|
|
|
(if (neo-global--window-exists-p)
|
|
|
|
(progn
|
|
|
|
(neotree-dir project-dir)
|
2017-02-13 17:21:23 +01:00
|
|
|
(neotree-find file-name)
|
|
|
|
(evil-window-mru)))
|
2017-01-01 00:13:14 +01:00
|
|
|
(message "Could not find git project root."))))
|
|
|
|
|
|
|
|
|
2017-02-01 20:38:22 +01:00
|
|
|
(defun message-project-root ()
|
|
|
|
"Outputs project-root."
|
|
|
|
(interactive)
|
|
|
|
(let (project-dir (projectile-project-root))
|
|
|
|
(if project-dir
|
|
|
|
(message "Project dir found!")
|
|
|
|
(message "No project-dir found."))))
|
|
|
|
|
|
|
|
|
2017-01-24 21:11:11 +01:00
|
|
|
;; Whitespace Settings
|
|
|
|
(use-package whitespace
|
|
|
|
:ensure t
|
|
|
|
:commands (whitespace-mode)
|
|
|
|
:config
|
|
|
|
(setq whitespace-line-column 80)
|
|
|
|
(setq whitespace-style '(face lines-tail)))
|
2017-01-01 00:13:14 +01:00
|
|
|
|
|
|
|
|
2017-01-24 21:11:11 +01:00
|
|
|
;; Helm Settings
|
|
|
|
(use-package helm
|
|
|
|
:ensure t
|
|
|
|
:commands (helm-mode)
|
|
|
|
:bind (
|
|
|
|
("M-x" . helm-M-x)
|
|
|
|
("M-y" . helm-show-kill-ring)
|
|
|
|
("C-x b" . helm-mini)
|
|
|
|
:map helm-map
|
|
|
|
("TAB" . helm-execute-persistent-action)
|
|
|
|
("C-z" . helm-select-action)
|
|
|
|
:term-raw-map
|
|
|
|
("M-x" . helm-M-x))
|
|
|
|
:init
|
|
|
|
(setq helm-buffers-fuzzy-matching t)
|
|
|
|
(setq helm-recentf-fuzzy-match t)
|
|
|
|
(setq helm-semantic-fuzzy-match t)
|
|
|
|
(setq helm-imenu-fuzzy-match t)
|
|
|
|
(setq helm-locate-fuzzy-match t))
|
|
|
|
|
|
|
|
|
|
|
|
;; Helm Projectile Settings
|
|
|
|
(use-package helm-projectile
|
2017-01-30 19:22:27 +01:00
|
|
|
:ensure t)
|
2017-01-24 21:11:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
;; Company Settings
|
|
|
|
(use-package company
|
|
|
|
:config
|
2017-02-13 17:21:23 +01:00
|
|
|
(setq company-idle-delay 0)
|
|
|
|
)
|
2017-01-24 21:11:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
(add-hook 'after-init-hook 'evil-mode)
|
|
|
|
(add-hook 'after-init-hook 'global-whitespace-mode)
|
|
|
|
(add-hook 'after-init-hook 'global-hl-line-mode)
|
|
|
|
(add-hook 'after-init-hook 'global-linum-mode)
|
|
|
|
(add-hook 'after-init-hook 'global-flycheck-mode)
|
|
|
|
(add-hook 'after-init-hook 'global-company-mode)
|
|
|
|
(add-hook 'after-init-hook 'projectile-mode)
|
|
|
|
(add-hook 'after-init-hook 'helm-mode)
|
|
|
|
(add-hook 'before-save-hook 'delete-trailing-whitespace)
|
2017-01-24 00:05:21 +01:00
|
|
|
|
|
|
|
|
2017-01-24 21:11:11 +01:00
|
|
|
;; Scrolling Settings
|
|
|
|
(setq scroll-step 1)
|
|
|
|
(setq scroll-conservatively 10000)
|
|
|
|
|
|
|
|
|
|
|
|
;; Properly configure GUI Emacs to use $PATH values
|
|
|
|
(when (memq window-system '(mac ns))
|
|
|
|
(exec-path-from-shell-initialize))
|
|
|
|
|
2017-01-24 00:05:21 +01:00
|
|
|
|
2017-01-24 21:11:11 +01:00
|
|
|
;; Emacs backup / autosave files
|
|
|
|
;; (setq-default make-backup-files nil)
|
|
|
|
(setq backup-directory-alist `(("." . "~/.emacs-tmp")))
|
|
|
|
(setq auto-save-file-name-transforms `((".*" "~/.emacs-tmp/" t)))
|
2017-01-24 00:05:21 +01:00
|
|
|
|
2017-01-24 21:11:11 +01:00
|
|
|
|
|
|
|
;; Automatically follow symlinks
|
|
|
|
(setq vc-follow-symlinks t)
|
|
|
|
|
|
|
|
|
|
|
|
;; Commenting / Uncommenting
|
|
|
|
(global-set-key (kbd "C-x C-;") 'comment-or-uncomment-region)
|
|
|
|
|
|
|
|
|
|
|
|
;; Fullscreen settings
|
|
|
|
(setq ns-use-native-fullscreen nil)
|
|
|
|
(global-set-key (kbd "<s-return>") 'toggle-frame-fullscreen)
|
2016-12-31 03:10:34 +01:00
|
|
|
|
|
|
|
|
|
|
|
;; General Settings
|
|
|
|
;; Hide the menu-bar
|
|
|
|
(setq ns-auto-hide-menu-bar t)
|
|
|
|
|
|
|
|
;; Native App Settings
|
|
|
|
(tool-bar-mode -1)
|
|
|
|
|
|
|
|
;; Disable GUI scrollbars
|
|
|
|
(scroll-bar-mode -1)
|
|
|
|
|
|
|
|
;; Use spaces instead of tabs
|
|
|
|
(setq-default indent-tabs-mode nil)
|
|
|
|
|
|
|
|
;; Change font settings
|
2017-02-01 20:38:22 +01:00
|
|
|
(add-to-list 'default-frame-alist '(font . "Operator Mono 10"))
|
2016-12-31 03:10:34 +01:00
|
|
|
|
2017-01-01 00:13:14 +01:00
|
|
|
|
2017-01-24 21:11:11 +01:00
|
|
|
;; Force save buffers
|
|
|
|
(defun save-buffer-always ()
|
|
|
|
"Save the buffer even if it is not modified."
|
2016-12-31 03:10:34 +01:00
|
|
|
(interactive)
|
2017-01-24 21:11:11 +01:00
|
|
|
(set-buffer-modified-p t)
|
|
|
|
(save-buffer))
|
2017-01-06 02:39:32 +01:00
|
|
|
|
2017-01-24 21:11:11 +01:00
|
|
|
(global-set-key (kbd "C-x C-s") nil)
|
|
|
|
(global-set-key (kbd "C-x C-s") 'save-buffer-always)
|
2017-01-01 00:13:14 +01:00
|
|
|
|
2016-12-31 03:10:34 +01:00
|
|
|
|
2017-01-24 21:11:11 +01:00
|
|
|
;; Upgrade all packages
|
|
|
|
(defun package-upgrade-all ()
|
|
|
|
"Upgrade all packages automatically without showing *Packages* buffer."
|
|
|
|
(interactive)
|
|
|
|
(package-refresh-contents)
|
|
|
|
(let (upgrades)
|
|
|
|
(cl-flet ((get-version (name where)
|
|
|
|
(let ((pkg (cadr (assq name where))))
|
|
|
|
(when pkg
|
|
|
|
(package-desc-version pkg)))))
|
|
|
|
(dolist (package (mapcar #'car package-alist))
|
|
|
|
(let ((in-archive (get-version package package-archive-contents)))
|
|
|
|
(when (and in-archive
|
|
|
|
(version-list-< (get-version package package-alist)
|
|
|
|
in-archive))
|
|
|
|
(push (cadr (assq package package-archive-contents))
|
|
|
|
upgrades)))))
|
|
|
|
(if upgrades
|
|
|
|
(when (yes-or-no-p
|
|
|
|
(message "Upgrade %d package%s (%s)? "
|
|
|
|
(length upgrades)
|
|
|
|
(if (= (length upgrades) 1) "" "s")
|
|
|
|
(mapconcat #'package-desc-full-name upgrades ", ")))
|
|
|
|
(save-window-excursion
|
|
|
|
(dolist (package-desc upgrades)
|
|
|
|
(let ((old-package (cadr (assq (package-desc-name package-desc)
|
|
|
|
package-alist))))
|
|
|
|
(package-install package-desc)
|
|
|
|
(package-delete old-package)))))
|
|
|
|
(message "All packages are up to date"))))
|
2017-01-01 00:13:14 +01:00
|
|
|
|
2016-12-31 03:10:34 +01:00
|
|
|
|
|
|
|
;; Add transparency
|
2017-01-17 23:50:33 +01:00
|
|
|
(set-frame-parameter (selected-frame) 'alpha '(95 . 95))
|
|
|
|
(add-to-list 'default-frame-alist '(alpha . (95 . 95)))
|