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)
![Screenshot](/../screenshots/main.png?raw=true)
[![MIT](https://img.shields.io/badge/license-MIT-green.svg)](./LICENSE)
This is an Emacs configuration for stubborn vimmers and silent demon
annihilating protagonists alike. It strives to emulate vim as best it can, and
surpass it in any way possible.
![Splash page screenshot](../screenshots/scratch.png?raw=true)
![Main screenshots](../screenshots/main.png?raw=true)
## 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
buffer)
* 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**
* REPLs for many major modes with **repl-toggle**, including Ruby, Python,
PHP, JS, Elisp, Haskell and Lua.
@ -66,14 +68,14 @@ To get a picture of what's in here, check out:
* **Modeline improvements**
* evil-search/iedit/evil-substitute mode-line integration:
![matches count in mode-line](/../screenshots/search.png?raw=true)
![substitutions count in mode-line](/../screenshots/subst.png?raw=true)
![matches count in mode-line](../screenshots/search.png?raw=true)
![substitutions count in mode-line](../screenshots/subst.png?raw=true)
* 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
![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
:init
;; Disable highlights on insert-mode
(add-hook 'evil-insert-state-entry-hook 'evil-ex-nohighlight)
(setq evil-magic t
evil-want-C-u-scroll t
evil-ex-visual-char-range t ; column range for ex commands
@ -25,7 +23,7 @@
;; Color-coded state cursors
evil-default-cursor (face-attribute 'minibuffer-prompt :foreground nil t)
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-visual-state-cursor 'hollow
@ -42,6 +40,8 @@
(add-hook 'evil-operator-state-entry-hook 'show-paren-mode)
(add-hook 'evil-operator-state-exit-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
(evil-mode 1)
@ -344,17 +344,15 @@
:config
(setq evil-escape-key-sequence "jk"
evil-escape-delay 0.25)
(evil-escape-mode +1)
;; evil-escape causes noticable lag in linewise motions in visual mode, so disable it in
;; visual mode
(push 'neotree-mode evil-escape-excluded-major-modes)
;; evil-escape causes noticable lag in commands that start with j, so we
;; enable it only where we need it.
(defun doom|evil-escape-disable () (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-visual-state-exit-hook 'doom|evil-escape-enable)
(add-hook 'evil-insert-state-exit-hook 'doom|evil-escape-enable)
(push 'neotree-mode evil-escape-excluded-major-modes))
(add-hook 'evil-insert-state-entry-hook 'doom|evil-escape-enable)
(add-hook 'evil-insert-state-exit-hook 'doom|evil-escape-disable)
(add-hook 'evil-replace-state-entry-hook 'doom|evil-escape-enable)
(add-hook 'evil-replace-state-exit-hook 'doom|evil-escape-disable))
(provide 'core-evil)
;;; core-evil.el ends here

View file

@ -5,8 +5,8 @@
:commands (helm helm-other-buffer helm-mode)
:init
(defvar helm-global-prompt " ")
(setq-default
helm-quick-update t
(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
@ -24,8 +24,6 @@
;; Don't wrap item cycling
helm-move-to-line-cycle-in-source t)
(defvar helm-projectile-find-file-map (make-sparse-keymap))
:config
(set-keymap-parent helm-projectile-find-file-map helm-map)
(map! :map helm-map
@ -46,8 +44,7 @@
:e "ESC" 'helm-keyboard-quit)
;;; 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
(add-hook 'helm-after-initialize-hook 'doom*helm-hide-source-header-maybe)
;; A simpler prompt: see `helm-global-prompt'

View file

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

View file

@ -143,6 +143,9 @@
(push "assets" 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))
(provide 'core-project)

View file

@ -48,9 +48,9 @@
(setq doom-buffer-edited nil)
(insert
(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)
(cdr (assq 'width default-frame-alist))))
(cdr (assq 'width default-frame-alist))) 3)))
(height (if auto-detect-frame
(window-height)
(cdr (assq 'height default-frame-alist))))

View file

@ -42,7 +42,7 @@
;; Initialize UI
(load-theme doom-current-theme t)
(tooltip-mode -1) ; show tooltips in echo area
(if (not window-system)
(if (not (display-graphic-p))
(menu-bar-mode -1)
(scroll-bar-mode -1) ; no scrollbar
(tool-bar-mode -1) ; no toolbar
@ -63,10 +63,13 @@
;; Show tilde in margin on empty lines
(define-fringe-bitmap 'tilde [64 168 16] nil nil 'center)
(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" '(?⚠ ?★ ?➊ ?➋ ?➌ ?➍ ?➎ ?❻ ?➐ ?➑ ?➒ ?➓))
(doom-fix-unicode "DejaVu Sans" '(?⚠ ?★ ?➊ ?➋ ?➌ ?➍ ?➎ ?❻ ?➐ ?➑ ?➒ ?➓)))
;; 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)
;; On by default in Emacs 25. I'll enable it manually, so disable it globally
(when (and (> emacs-major-version 24) (featurep 'eldoc))
@ -79,10 +82,6 @@
("\\<\\(FIXME\\(?:(.*)\\)?:?\\)\\>" 1 'error 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

View file

@ -8,13 +8,13 @@
(doom|nlinum-enable)))
;;;###autoload
(defun doom|nlinum-enable ()
(defun doom|nlinum-enable (&rest _)
(nlinum-mode +1)
(add-hook 'post-command-hook 'doom|nlinum-hl-line nil t)
(doom|nlinum-unhl-line))
;;;###autoload
(defun doom|nlinum-disable ()
(defun doom|nlinum-disable (&rest _)
(nlinum-mode -1)
(remove-hook 'post-command-hook 'doom|nlinum-hl-line t)
(doom|nlinum-unhl-line))
@ -51,7 +51,7 @@
(when ov
(doom|nlinum-unhl-line)
(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
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))
(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
(defun doom/new-buffer ()
(interactive)