General update

This commit is contained in:
Henrik Lissner 2016-05-23 20:56:19 -04:00
parent f72c8805ea
commit 504efc57e7
9 changed files with 71 additions and 62 deletions

View file

@ -1,10 +1,12 @@
![DOOM Emacs](/../screenshots/scratch.png?raw=true) [![MIT](https://img.shields.io/badge/license-MIT-green.svg)](./LICENSE)
![Screenshot](/../screenshots/main.png?raw=true)
This is an Emacs configuration for stubborn vimmers and silent demon This is an Emacs configuration for stubborn vimmers and silent demon
annihilating protagonists alike. It strives to emulate vim as best it can, and annihilating protagonists alike. It strives to emulate vim as best it can, and
surpass it in any way possible. surpass it in any way possible.
![Splash page screenshot](../screenshots/scratch.png?raw=true)
![Main screenshots](../screenshots/main.png?raw=true)
## Installation ## Installation
``` ```
@ -44,7 +46,7 @@ To get a picture of what's in here, check out:
* Project-wide search and replace with **helm-ag** (press shift-Tab while in results * Project-wide search and replace with **helm-ag** (press shift-Tab while in results
buffer) buffer)
* Session persistence (and tab emulation) with **workgroups2** * Session persistence (and tab emulation) with **workgroups2**
![Workgroups2 tabs emulation](/../screenshots/tabs.png?raw=true) ![Workgroups2 tabs emulation](../screenshots/tabs.png?raw=true)
* Run code inline with **quickrun** * Run code inline with **quickrun**
* REPLs for many major modes with **repl-toggle**, including Ruby, Python, * REPLs for many major modes with **repl-toggle**, including Ruby, Python,
PHP, JS, Elisp, Haskell and Lua. PHP, JS, Elisp, Haskell and Lua.
@ -66,14 +68,14 @@ To get a picture of what's in here, check out:
* **Modeline improvements** * **Modeline improvements**
* evil-search/iedit/evil-substitute mode-line integration: * evil-search/iedit/evil-substitute mode-line integration:
![matches count in mode-line](/../screenshots/search.png?raw=true) ![matches count in mode-line](../screenshots/search.png?raw=true)
![substitutions count in mode-line](/../screenshots/subst.png?raw=true) ![substitutions count in mode-line](../screenshots/subst.png?raw=true)
* Macro-recording indicator: * Macro-recording indicator:
![macro indicator in modeline](/../screenshots/macro.png?raw=true) ![macro indicator in modeline](../screenshots/macro.png?raw=true)
* Show (py|rb)env version in mode-line * Show (py|rb)env version in mode-line
![py/rb version in modeline](/../screenshots/version.png?raw=true) ![py/rb version in modeline](../screenshots/version.png?raw=true)
--- ---
![Yay! Evil!](/../screenshots/cacochan.png) ![Yay! Evil!](../screenshots/cacochan.png)

View file

@ -2,8 +2,6 @@
(use-package evil (use-package evil
:init :init
;; Disable highlights on insert-mode
(add-hook 'evil-insert-state-entry-hook 'evil-ex-nohighlight)
(setq evil-magic t (setq evil-magic t
evil-want-C-u-scroll t evil-want-C-u-scroll t
evil-ex-visual-char-range t ; column range for ex commands evil-ex-visual-char-range t ; column range for ex commands
@ -25,7 +23,7 @@
;; Color-coded state cursors ;; Color-coded state cursors
evil-default-cursor (face-attribute 'minibuffer-prompt :foreground nil t) evil-default-cursor (face-attribute 'minibuffer-prompt :foreground nil t)
evil-normal-state-cursor 'box evil-normal-state-cursor 'box
evil-emacs-state-cursor `(,(face-attribute 'highlight :foreground nil t) box) evil-emacs-state-cursor `(,(face-attribute 'shadow :foreground nil nil) box)
evil-insert-state-cursor 'bar evil-insert-state-cursor 'bar
evil-visual-state-cursor 'hollow evil-visual-state-cursor 'hollow
@ -42,6 +40,8 @@
(add-hook 'evil-operator-state-entry-hook 'show-paren-mode) (add-hook 'evil-operator-state-entry-hook 'show-paren-mode)
(add-hook 'evil-operator-state-exit-hook 'show-paren-mode-off) (add-hook 'evil-operator-state-exit-hook 'show-paren-mode-off)
(add-hook 'evil-normal-state-entry-hook 'show-paren-mode-off) (add-hook 'evil-normal-state-entry-hook 'show-paren-mode-off)
;; Disable highlights on insert-mode
(add-hook 'evil-insert-state-entry-hook 'evil-ex-nohighlight)
:config :config
(evil-mode 1) (evil-mode 1)
@ -344,17 +344,15 @@
:config :config
(setq evil-escape-key-sequence "jk" (setq evil-escape-key-sequence "jk"
evil-escape-delay 0.25) evil-escape-delay 0.25)
(evil-escape-mode +1) (push 'neotree-mode evil-escape-excluded-major-modes)
;; evil-escape causes noticable lag in commands that start with j, so we
;; evil-escape causes noticable lag in linewise motions in visual mode, so disable it in ;; enable it only where we need it.
;; visual mode
(defun doom|evil-escape-disable () (evil-escape-mode -1)) (defun doom|evil-escape-disable () (evil-escape-mode -1))
(defun doom|evil-escape-enable () (evil-escape-mode +1)) (defun doom|evil-escape-enable () (evil-escape-mode +1))
(add-hook 'evil-visual-state-entry-hook 'doom|evil-escape-disable) (add-hook 'evil-insert-state-entry-hook 'doom|evil-escape-enable)
(add-hook 'evil-visual-state-exit-hook 'doom|evil-escape-enable) (add-hook 'evil-insert-state-exit-hook 'doom|evil-escape-disable)
(add-hook 'evil-insert-state-exit-hook 'doom|evil-escape-enable) (add-hook 'evil-replace-state-entry-hook 'doom|evil-escape-enable)
(add-hook 'evil-replace-state-exit-hook 'doom|evil-escape-disable))
(push 'neotree-mode evil-escape-excluded-major-modes))
(provide 'core-evil) (provide 'core-evil)
;;; core-evil.el ends here ;;; core-evil.el ends here

View file

@ -5,26 +5,24 @@
:commands (helm helm-other-buffer helm-mode) :commands (helm helm-other-buffer helm-mode)
:init :init
(defvar helm-global-prompt " ") (defvar helm-global-prompt " ")
(setq-default
helm-quick-update t
;; Speedier without fuzzy matching
helm-mode-fuzzy-match nil
helm-buffers-fuzzy-matching nil
helm-apropos-fuzzy-match nil
helm-M-x-fuzzy-match nil
helm-recentf-fuzzy-match nil
helm-projectile-fuzzy-match nil
;; Display extraineous helm UI elements
helm-display-header-line nil
helm-ff-auto-update-initial-value nil
helm-find-files-doc-header nil
;; Don't override evil-ex's completion
helm-mode-handle-completion-in-region nil
helm-candidate-number-limit 50
;; Don't wrap item cycling
helm-move-to-line-cycle-in-source t)
(defvar helm-projectile-find-file-map (make-sparse-keymap)) (defvar helm-projectile-find-file-map (make-sparse-keymap))
(setq helm-quick-update t
;; Speedier without fuzzy matching
helm-mode-fuzzy-match nil
helm-buffers-fuzzy-matching nil
helm-apropos-fuzzy-match nil
helm-M-x-fuzzy-match nil
helm-recentf-fuzzy-match nil
helm-projectile-fuzzy-match nil
;; Display extraineous helm UI elements
helm-display-header-line nil
helm-ff-auto-update-initial-value nil
helm-find-files-doc-header nil
;; Don't override evil-ex's completion
helm-mode-handle-completion-in-region nil
helm-candidate-number-limit 50
;; Don't wrap item cycling
helm-move-to-line-cycle-in-source t)
:config :config
(set-keymap-parent helm-projectile-find-file-map helm-map) (set-keymap-parent helm-projectile-find-file-map helm-map)
@ -46,8 +44,7 @@
:e "ESC" 'helm-keyboard-quit) :e "ESC" 'helm-keyboard-quit)
;;; Helm hacks ;;; Helm hacks
(defvar doom-helm-header-fg (face-attribute 'helm-source-header :foreground) "docstring") (defconst doom-helm-header-fg (face-attribute 'helm-source-header :foreground))
;; Shrink source headers if there is only one source ;; Shrink source headers if there is only one source
(add-hook 'helm-after-initialize-hook 'doom*helm-hide-source-header-maybe) (add-hook 'helm-after-initialize-hook 'doom*helm-hide-source-header-maybe)
;; A simpler prompt: see `helm-global-prompt' ;; A simpler prompt: see `helm-global-prompt'

View file

@ -241,12 +241,13 @@
(setq org-agenda-archives-mode nil (setq org-agenda-archives-mode nil
org-agenda-buffer nil)))) org-agenda-buffer nil))))
(map! :map org-agenda-mode-map (after! org-agenda
:e "<escape>" 'doom/org-agenda-quit (map! :map org-agenda-mode-map
:e "ESC" 'doom/org-agenda-quit :e "<escape>" 'doom/org-agenda-quit
:e [escape] 'doom/org-agenda-quit :e "ESC" 'doom/org-agenda-quit
"q" 'doom/org-agenda-quit :e [escape] 'doom/org-agenda-quit
"Q" 'doom/org-agenda-quit)) "q" 'doom/org-agenda-quit
"Q" 'doom/org-agenda-quit)))
(after! realgud (after! realgud
;; This allows realgud debuggers to run in a popup. ;; This allows realgud debuggers to run in a popup.

View file

@ -143,6 +143,9 @@
(push "assets" projectile-globally-ignored-directories) (push "assets" projectile-globally-ignored-directories)
(push ".cask" projectile-globally-ignored-directories) (push ".cask" projectile-globally-ignored-directories)
(push ".elc" projectile-globally-ignored-file-suffixes)
(push doom-temp-dir projectile-globally-ignored-directories)
(projectile-global-mode +1)) (projectile-global-mode +1))
(provide 'core-project) (provide 'core-project)

View file

@ -48,9 +48,9 @@
(setq doom-buffer-edited nil) (setq doom-buffer-edited nil)
(insert (insert
(let* ((auto-detect-frame (or auto-detect-frame (not (display-graphic-p)))) (let* ((auto-detect-frame (or auto-detect-frame (not (display-graphic-p))))
(width (if auto-detect-frame (width (max 3 (- (if auto-detect-frame
(window-width) (window-width)
(cdr (assq 'width default-frame-alist)))) (cdr (assq 'width default-frame-alist))) 3)))
(height (if auto-detect-frame (height (if auto-detect-frame
(window-height) (window-height)
(cdr (assq 'height default-frame-alist)))) (cdr (assq 'height default-frame-alist))))

View file

@ -42,7 +42,7 @@
;; Initialize UI ;; Initialize UI
(load-theme doom-current-theme t) (load-theme doom-current-theme t)
(tooltip-mode -1) ; show tooltips in echo area (tooltip-mode -1) ; show tooltips in echo area
(if (not window-system) (if (not (display-graphic-p))
(menu-bar-mode -1) (menu-bar-mode -1)
(scroll-bar-mode -1) ; no scrollbar (scroll-bar-mode -1) ; no scrollbar
(tool-bar-mode -1) ; no toolbar (tool-bar-mode -1) ; no toolbar
@ -63,10 +63,13 @@
;; Show tilde in margin on empty lines ;; Show tilde in margin on empty lines
(define-fringe-bitmap 'tilde [64 168 16] nil nil 'center) (define-fringe-bitmap 'tilde [64 168 16] nil nil 'center)
(set-fringe-bitmap-face 'tilde 'fringe) (set-fringe-bitmap-face 'tilde 'fringe)
(setcdr (assq 'empty-line fringe-indicator-alist) 'tilde)) (setcdr (assq 'empty-line fringe-indicator-alist) 'tilde)
;; Fix certain unicode characters without upsetting line-height
(doom-fix-unicode "DejaVu Sans" '(?⚠ ?★ ?➊ ?➋ ?➌ ?➍ ?➎ ?❻ ?➐ ?➑ ?➒ ?➓)))
;; Fix certain unicode characters without upsetting line-height ;; Hide mode-line in help/compile window
(doom-fix-unicode "DejaVu Sans" '(?⚠ ?★ ?➊ ?➋ ?➌ ?➍ ?➎ ?❻ ?➐ ?➑ ?➒ ?➓)) (add-hook 'help-mode-hook 'doom|hide-mode-line)
(add-hook 'compilation-mode-hook 'doom|hide-mode-line)
;; On by default in Emacs 25. I'll enable it manually, so disable it globally ;; On by default in Emacs 25. I'll enable it manually, so disable it globally
(when (and (> emacs-major-version 24) (featurep 'eldoc)) (when (and (> emacs-major-version 24) (featurep 'eldoc))
@ -79,10 +82,6 @@
("\\<\\(FIXME\\(?:(.*)\\)?:?\\)\\>" 1 'error prepend) ("\\<\\(FIXME\\(?:(.*)\\)?:?\\)\\>" 1 'error prepend)
("\\<\\(NOTE\\(?:(.*)\\)?:?\\)\\>" 1 'success prepend)))) ("\\<\\(NOTE\\(?:(.*)\\)?:?\\)\\>" 1 'success prepend))))
;; Hide mode-line in help/compile window
(add-hook 'help-mode-hook 'doom|hide-mode-line)
(add-hook 'compilation-mode-hook 'doom|hide-mode-line)
;; ;;
;; Plugins ;; Plugins

View file

@ -8,13 +8,13 @@
(doom|nlinum-enable))) (doom|nlinum-enable)))
;;;###autoload ;;;###autoload
(defun doom|nlinum-enable () (defun doom|nlinum-enable (&rest _)
(nlinum-mode +1) (nlinum-mode +1)
(add-hook 'post-command-hook 'doom|nlinum-hl-line nil t) (add-hook 'post-command-hook 'doom|nlinum-hl-line nil t)
(doom|nlinum-unhl-line)) (doom|nlinum-unhl-line))
;;;###autoload ;;;###autoload
(defun doom|nlinum-disable () (defun doom|nlinum-disable (&rest _)
(nlinum-mode -1) (nlinum-mode -1)
(remove-hook 'post-command-hook 'doom|nlinum-hl-line t) (remove-hook 'post-command-hook 'doom|nlinum-hl-line t)
(doom|nlinum-unhl-line)) (doom|nlinum-unhl-line))
@ -51,7 +51,7 @@
(when ov (when ov
(doom|nlinum-unhl-line) (doom|nlinum-unhl-line)
(let ((str (nth 1 (get-text-property 0 'display (overlay-get ov 'before-string))))) (let ((str (nth 1 (get-text-property 0 'display (overlay-get ov 'before-string)))))
(put-text-property 0 (length str) 'face 'linum-highlight-face str) (put-text-property 0 (length str) 'face 'doom-nlinum-highlight str)
(setq doom--hl-nlinum-overlay ov (setq doom--hl-nlinum-overlay ov
doom--hl-nlinum-line line-no)))))))) doom--hl-nlinum-line line-no))))))))

View file

@ -47,6 +47,15 @@ evil-window-move-* (e.g. `evil-window-move-far-left')"
(switch-to-buffer this-buffer)) (switch-to-buffer this-buffer))
(select-window that-window)))) (select-window that-window))))
;;;###autoload
(defun doom/evil-window-move-l () (interactive) (doom/evil-window-move 'left))
;;;###autoload
(defun doom/evil-window-move-d () (interactive) (doom/evil-window-move 'down))
;;;###autoload
(defun doom/evil-window-move-u () (interactive) (doom/evil-window-move 'up))
;;;###autoload
(defun doom/evil-window-move-r () (interactive) (doom/evil-window-move 'right))
;;;###autoload ;;;###autoload
(defun doom/new-buffer () (defun doom/new-buffer ()
(interactive) (interactive)