2015-06-15 09:05:52 +02:00
|
|
|
|
;;; core-editor.el
|
2015-06-04 18:23:21 -04:00
|
|
|
|
|
2016-05-20 19:08:02 -04:00
|
|
|
|
(global-auto-revert-mode 1) ; revert buffers for changed files
|
|
|
|
|
;; Enable syntax highlighting for older emacs
|
|
|
|
|
(unless (bound-and-true-p global-font-lock-mode)
|
|
|
|
|
(global-font-lock-mode t))
|
2016-04-08 16:15:37 -04:00
|
|
|
|
|
2016-05-20 19:08:02 -04:00
|
|
|
|
(setq-default
|
|
|
|
|
;; Formatting
|
2016-04-08 16:15:37 -04:00
|
|
|
|
delete-trailing-lines nil
|
2016-05-12 22:11:43 -04:00
|
|
|
|
fill-column 80
|
2016-05-20 19:08:02 -04:00
|
|
|
|
indent-tabs-mode nil
|
|
|
|
|
require-final-newline t
|
|
|
|
|
tab-always-indent t
|
|
|
|
|
tab-width 4
|
2016-04-08 16:15:37 -04:00
|
|
|
|
truncate-lines t
|
|
|
|
|
truncate-partial-width-windows 50
|
2016-02-26 00:08:41 -05:00
|
|
|
|
visual-fill-column-center-text nil
|
2016-05-20 19:08:02 -04:00
|
|
|
|
word-wrap t
|
|
|
|
|
;; Scrolling
|
|
|
|
|
hscroll-margin 1
|
|
|
|
|
hscroll-step 1
|
2016-04-08 16:15:37 -04:00
|
|
|
|
scroll-conservatively 1001
|
2016-05-20 19:08:02 -04:00
|
|
|
|
scroll-margin 0
|
2015-06-06 06:40:33 -04:00
|
|
|
|
scroll-preserve-screen-position t
|
2016-05-20 19:08:02 -04:00
|
|
|
|
;; Regions
|
2016-03-03 15:04:14 -05:00
|
|
|
|
shift-select-mode t
|
2016-05-20 19:08:02 -04:00
|
|
|
|
;; Whitespace
|
2015-07-23 01:34:05 +02:00
|
|
|
|
tabify-regexp "^\t* [ \t]+"
|
2016-03-09 21:39:47 -05:00
|
|
|
|
whitespace-line-column fill-column
|
2016-04-26 02:01:08 -04:00
|
|
|
|
whitespace-style '(face tabs tab-mark
|
2016-03-27 18:18:43 -04:00
|
|
|
|
trailing indentation lines-tail)
|
2015-06-06 06:40:33 -04:00
|
|
|
|
whitespace-display-mappings
|
2016-04-26 02:01:08 -04:00
|
|
|
|
'((tab-mark ?\t [?› ?\t])
|
2015-11-17 02:08:35 -05:00
|
|
|
|
(newline-mark 10 [36 10])))
|
2015-06-06 06:40:33 -04:00
|
|
|
|
|
2016-04-05 23:58:32 -04:00
|
|
|
|
;; Save point across sessions
|
2015-11-27 03:40:10 -05:00
|
|
|
|
(require 'saveplace)
|
2016-02-01 00:18:36 -05:00
|
|
|
|
(setq-default
|
2016-05-20 22:37:30 -04:00
|
|
|
|
save-place-file (concat doom-temp-dir "/saveplace")
|
2016-02-01 00:18:36 -05:00
|
|
|
|
save-place t)
|
2015-11-30 05:32:35 -05:00
|
|
|
|
(when (>= emacs-major-version 25)
|
|
|
|
|
(save-place-mode +1))
|
2015-11-27 03:40:10 -05:00
|
|
|
|
|
2016-04-05 23:58:32 -04:00
|
|
|
|
;; Save history across sessions
|
|
|
|
|
(require 'savehist)
|
2016-05-20 22:37:30 -04:00
|
|
|
|
(setq savehist-file (concat doom-temp-dir "/savehist")
|
2016-04-05 23:58:32 -04:00
|
|
|
|
savehist-save-minibuffer-history t
|
|
|
|
|
savehist-additional-variables
|
|
|
|
|
'(kill-ring search-ring regexp-search-ring))
|
|
|
|
|
(savehist-mode 1)
|
|
|
|
|
|
2016-05-18 02:14:08 -04:00
|
|
|
|
;; Remove text property cruft from history
|
2016-04-05 23:58:32 -04:00
|
|
|
|
(defun unpropertize-savehist ()
|
|
|
|
|
(mapc (lambda (list)
|
2016-05-18 02:14:08 -04:00
|
|
|
|
(when (boundp list)
|
|
|
|
|
(set list (mapcar 'substring-no-properties (eval list)))))
|
2016-05-12 22:11:43 -04:00
|
|
|
|
'(kill-ring minibuffer-history helm-grep-history helm-ff-history
|
|
|
|
|
file-name-history read-expression-history extended-command-history
|
|
|
|
|
evil-ex-history)))
|
2016-05-18 02:14:08 -04:00
|
|
|
|
(add-hook 'kill-emacs-hook 'unpropertize-savehist)
|
|
|
|
|
(add-hook 'savehist-save-hook 'unpropertize-savehist)
|
2016-04-05 23:58:32 -04:00
|
|
|
|
|
|
|
|
|
;; Keep track of recently opened files
|
|
|
|
|
(require 'recentf)
|
2016-05-20 22:37:30 -04:00
|
|
|
|
(setq recentf-save-file (concat doom-temp-dir "/recentf")
|
2016-04-05 23:58:32 -04:00
|
|
|
|
recentf-exclude '("/tmp/" "/ssh:" "\\.?ido\\.last$" "\\.revive$" "/TAGS$"
|
2016-05-12 22:11:43 -04:00
|
|
|
|
"emacs\\.d/private/cache/.+" "emacs\\.d/workgroups/.+$"
|
|
|
|
|
"wg-default" "/company-statistics-cache.el$")
|
2016-04-05 23:58:32 -04:00
|
|
|
|
recentf-max-menu-items 0
|
|
|
|
|
recentf-max-saved-items 250
|
2016-05-18 02:14:19 -04:00
|
|
|
|
recentf-auto-cleanup 600
|
|
|
|
|
recentf-filename-handlers '(abbreviate-file-name))
|
2016-04-05 23:58:32 -04:00
|
|
|
|
(recentf-mode 1)
|
|
|
|
|
|
2016-05-20 19:08:02 -04:00
|
|
|
|
;; window config undo/redo
|
|
|
|
|
(setq winner-dont-bind-my-keys t)
|
|
|
|
|
(winner-mode 1)
|
|
|
|
|
(add-hook! after-init
|
2016-05-20 22:37:30 -04:00
|
|
|
|
(setq winner-boring-buffers doom-ignore-buffers))
|
2016-05-20 19:08:02 -04:00
|
|
|
|
|
2016-04-23 22:08:46 -04:00
|
|
|
|
;; Let editorconfig handle global whitespace settings
|
2016-05-20 19:08:02 -04:00
|
|
|
|
(use-package editorconfig :demand t
|
|
|
|
|
:mode ("\\.?editorconfig$" . editorconfig-conf-mode)
|
|
|
|
|
:config (editorconfig-mode +1)
|
|
|
|
|
;; Show whitespace in tabs indentation mode
|
2016-05-12 22:11:43 -04:00
|
|
|
|
(add-hook! 'editorconfig-custom-hooks
|
|
|
|
|
(if indent-tabs-mode (whitespace-mode +1))))
|
2016-04-23 22:08:46 -04:00
|
|
|
|
|
2015-06-06 06:40:33 -04:00
|
|
|
|
|
2016-03-03 15:04:14 -05:00
|
|
|
|
;;
|
2016-05-20 19:08:02 -04:00
|
|
|
|
;; Hooks 'n hacks
|
2016-03-03 15:04:14 -05:00
|
|
|
|
;;
|
2016-01-30 21:16:10 -05:00
|
|
|
|
|
2015-06-15 09:05:52 +02:00
|
|
|
|
(associate! makefile-gmake-mode :match "/Makefile$")
|
2016-04-23 22:08:46 -04:00
|
|
|
|
(add-hook! special-mode (setq truncate-lines nil))
|
2016-05-20 19:08:02 -04:00
|
|
|
|
;; If file is oversized...
|
|
|
|
|
(add-hook! find-file
|
|
|
|
|
(when (> (buffer-size) 1048576)
|
|
|
|
|
(setq buffer-read-only t)
|
|
|
|
|
(buffer-disable-undo)
|
|
|
|
|
(fundamental-mode)
|
|
|
|
|
(visual-line-mode)))
|
2016-04-26 02:01:08 -04:00
|
|
|
|
|
2015-11-09 20:49:33 -05:00
|
|
|
|
(defadvice delete-trailing-whitespace
|
|
|
|
|
(around delete-trailing-whitespace-ignore-line activate)
|
2015-07-29 12:31:42 +02:00
|
|
|
|
"Don't delete trailing whitespace on current line, if in insert mode."
|
2015-08-01 14:38:41 +02:00
|
|
|
|
(let ((spaces (1- (current-column)))
|
2015-11-09 20:49:33 -05:00
|
|
|
|
(linestr (buffer-substring-no-properties
|
|
|
|
|
(line-beginning-position)
|
|
|
|
|
(line-end-position))))
|
2015-07-29 12:31:42 +02:00
|
|
|
|
ad-do-it
|
2016-03-23 11:52:19 -04:00
|
|
|
|
(when (and (evil-insert-state-p)
|
|
|
|
|
(string-match-p "^[\s\t]*$" linestr))
|
2015-08-01 14:38:41 +02:00
|
|
|
|
(insert linestr))))
|
2015-07-29 12:31:42 +02:00
|
|
|
|
|
2016-05-20 19:08:02 -04:00
|
|
|
|
;; Disable by default, please
|
|
|
|
|
(electric-indent-mode -1)
|
|
|
|
|
;; Smarter, keyword-based electric-indent (see `def-electric!')
|
2016-05-20 22:37:30 -04:00
|
|
|
|
(defvar doom-electric-indent-p nil)
|
|
|
|
|
(defvar-local doom-electric-indent-words '())
|
2016-03-23 11:59:06 -04:00
|
|
|
|
(setq electric-indent-chars '(?\n ?\^?))
|
|
|
|
|
(push (lambda (c)
|
2016-05-20 22:37:30 -04:00
|
|
|
|
(when (and (eolp) doom-electric-indent-words)
|
2016-03-23 11:59:06 -04:00
|
|
|
|
(save-excursion
|
|
|
|
|
(backward-word)
|
2016-05-12 22:11:43 -04:00
|
|
|
|
(looking-at-p
|
2016-05-20 22:37:30 -04:00
|
|
|
|
(concat "\\<" (regexp-opt doom-electric-indent-words))))))
|
2016-03-23 11:59:06 -04:00
|
|
|
|
electric-indent-functions)
|
|
|
|
|
|
2016-03-03 15:04:14 -05:00
|
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
;; Plugins
|
|
|
|
|
;;
|
2015-06-06 06:40:33 -04:00
|
|
|
|
|
|
|
|
|
(use-package ace-window
|
|
|
|
|
:commands ace-window
|
|
|
|
|
:config (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)
|
|
|
|
|
aw-scope 'frame
|
2015-06-24 15:34:46 +02:00
|
|
|
|
aw-background t))
|
2015-06-06 06:40:33 -04:00
|
|
|
|
|
2016-04-16 21:27:59 -04:00
|
|
|
|
(use-package avy
|
|
|
|
|
:commands (avy-goto-char-2 avy-goto-line)
|
|
|
|
|
:config (setq avy-all-windows nil
|
|
|
|
|
avy-background t))
|
|
|
|
|
|
2016-05-01 01:05:25 -04:00
|
|
|
|
(use-package dumb-jump
|
|
|
|
|
:commands (dumb-jump-go dumb-jump-quick-look dumb-jump-back)
|
|
|
|
|
:config
|
2016-05-20 22:37:30 -04:00
|
|
|
|
(setq dumb-jump-default-project doom-emacs-dir)
|
2016-05-01 01:05:25 -04:00
|
|
|
|
(dumb-jump-mode +1))
|
|
|
|
|
|
2015-07-19 00:43:29 +02:00
|
|
|
|
(use-package emr
|
2016-05-13 00:28:44 -04:00
|
|
|
|
:commands (emr-show-refactor-menu emr-declare-command)
|
|
|
|
|
:config
|
|
|
|
|
(emr-initialize)
|
|
|
|
|
(define-key popup-menu-keymap [escape] 'keyboard-quit))
|
2015-06-06 06:40:33 -04:00
|
|
|
|
|
|
|
|
|
(use-package expand-region
|
|
|
|
|
:commands (er/expand-region er/contract-region er/mark-symbol er/mark-word))
|
|
|
|
|
|
2016-04-20 21:36:32 -04:00
|
|
|
|
(use-package goto-last-change :commands goto-last-change)
|
2015-06-06 06:40:33 -04:00
|
|
|
|
|
2016-02-23 13:07:21 -05:00
|
|
|
|
(use-package hideshow
|
|
|
|
|
:commands (hs-minor-mode hs-toggle-hiding hs-already-hidden-p)
|
|
|
|
|
:config (setq hs-isearch-open t)
|
|
|
|
|
:init
|
2016-05-20 22:37:30 -04:00
|
|
|
|
(advice-add 'evil-toggle-fold :before 'doom*load-hs-minor-mode)
|
2016-05-20 19:08:02 -04:00
|
|
|
|
;; Prettify code folding in emacs
|
2016-02-23 13:07:21 -05:00
|
|
|
|
(define-fringe-bitmap 'hs-marker [16 48 112 240 112 48 16] nil nil 'center)
|
|
|
|
|
(defface hs-face '((t (:background "#ff8")))
|
|
|
|
|
"Face to hightlight the ... area of hidden regions"
|
|
|
|
|
:group 'hideshow)
|
|
|
|
|
(defface hs-fringe-face '((t (:foreground "#888")))
|
|
|
|
|
"Face used to highlight the fringe on folded regions"
|
|
|
|
|
:group 'hideshow)
|
|
|
|
|
(setq hs-set-up-overlay
|
|
|
|
|
(lambda (ov)
|
|
|
|
|
(when (eq 'code (overlay-get ov 'hs))
|
2016-05-07 22:05:00 -04:00
|
|
|
|
(let ((marker-string "*")
|
|
|
|
|
(display-string (format " ... " (count-lines (overlay-start ov)
|
|
|
|
|
(overlay-end ov)))))
|
|
|
|
|
(put-text-property 0 1 'display
|
2016-05-12 22:11:43 -04:00
|
|
|
|
(list 'right-fringe 'hs-marker 'hs-fringe-face)
|
|
|
|
|
marker-string)
|
|
|
|
|
(put-text-property 0 (length display-string)
|
|
|
|
|
'face 'hs-face display-string)
|
2016-02-23 13:07:21 -05:00
|
|
|
|
(overlay-put ov 'before-string marker-string)
|
|
|
|
|
(overlay-put ov 'display display-string))))))
|
|
|
|
|
|
2016-04-23 22:08:46 -04:00
|
|
|
|
(use-package imenu-list
|
|
|
|
|
:commands imenu-list-minor-mode
|
|
|
|
|
:config
|
|
|
|
|
(setq imenu-list-mode-line-format nil
|
|
|
|
|
imenu-list-position 'right
|
|
|
|
|
imenu-list-size 32)
|
|
|
|
|
(map! :map imenu-list-major-mode-map
|
2016-05-20 22:37:30 -04:00
|
|
|
|
:n [escape] 'doom/imenu-list-quit
|
2016-04-23 22:08:46 -04:00
|
|
|
|
:n "RET" 'imenu-list-goto-entry
|
|
|
|
|
:n "SPC" 'imenu-list-display-entry
|
|
|
|
|
:n [tab] 'hs-toggle-hiding))
|
|
|
|
|
|
|
|
|
|
(use-package re-builder
|
|
|
|
|
:commands (re-builder reb-mode-buffer-p)
|
2016-05-20 22:37:30 -04:00
|
|
|
|
:init (add-hook 'reb-mode-hook 'doom|reb-cleanup)
|
2016-04-23 22:08:46 -04:00
|
|
|
|
:config
|
2016-05-20 19:08:02 -04:00
|
|
|
|
(evil-set-initial-state 'reb-mode 'insert)
|
2016-04-23 22:08:46 -04:00
|
|
|
|
(setq reb-re-syntax 'string)
|
|
|
|
|
(map! :map rxt-help-mode-map
|
|
|
|
|
:n [escape] 'kill-buffer-and-window
|
|
|
|
|
:map reb-mode-map
|
2016-05-20 19:08:02 -04:00
|
|
|
|
:n "C-g" 'reb-quit
|
|
|
|
|
:n [escape] 'reb-quit
|
|
|
|
|
:n [backtab] 'reb-change-syntax))
|
2016-04-23 22:08:46 -04:00
|
|
|
|
|
2016-01-29 07:06:52 -05:00
|
|
|
|
(use-package rotate-text
|
|
|
|
|
:commands (rotate-text rotate-text-backward)
|
2016-05-01 01:06:25 -04:00
|
|
|
|
:config (push '("true" "false") rotate-text-words))
|
2015-06-06 06:40:33 -04:00
|
|
|
|
|
2016-05-12 22:11:43 -04:00
|
|
|
|
(use-package smart-forward
|
|
|
|
|
:commands (smart-up smart-down smart-left smart-right))
|
2015-06-06 06:40:33 -04:00
|
|
|
|
|
2015-06-04 18:23:21 -04:00
|
|
|
|
(use-package smartparens
|
|
|
|
|
:config
|
2015-10-06 20:27:18 -04:00
|
|
|
|
(setq sp-autowrap-region nil ; let evil-surround handle this
|
2015-06-15 09:05:52 +02:00
|
|
|
|
sp-highlight-pair-overlay nil
|
2015-12-23 02:40:41 -05:00
|
|
|
|
sp-cancel-autoskip-on-backward-movement nil
|
2015-06-15 09:05:52 +02:00
|
|
|
|
sp-show-pair-delay 0)
|
|
|
|
|
|
2015-08-02 18:24:57 +02:00
|
|
|
|
(smartparens-global-mode 1)
|
2015-06-15 09:05:52 +02:00
|
|
|
|
(require 'smartparens-config)
|
|
|
|
|
|
2015-12-23 02:40:41 -05:00
|
|
|
|
;; Smartparens interferes with Replace mode
|
|
|
|
|
(add-hook 'evil-replace-state-entry-hook 'turn-off-smartparens-mode)
|
2016-03-19 04:26:20 -04:00
|
|
|
|
(add-hook 'evil-replace-state-exit-hook 'turn-on-smartparens-mode)
|
2015-12-23 02:40:41 -05:00
|
|
|
|
|
|
|
|
|
;; Auto-close more conservatively
|
2016-03-28 21:39:13 -04:00
|
|
|
|
(sp-pair "'" nil :unless '(sp-point-after-word-p))
|
2016-05-26 18:53:46 -04:00
|
|
|
|
(sp-pair "\"" nil :unless '(sp-point-before-word-p sp-point-after-word-p sp-point-before-same-p))
|
2016-01-18 01:44:15 -05:00
|
|
|
|
(sp-pair "{" nil :post-handlers '(("||\n[i]" "RET") ("| " " "))
|
2015-08-02 18:24:57 +02:00
|
|
|
|
:unless '(sp-point-before-word-p sp-point-before-same-p))
|
2016-01-18 01:44:15 -05:00
|
|
|
|
(sp-pair "(" nil :post-handlers '(("||\n[i]" "RET") ("| " " "))
|
2015-08-02 18:24:57 +02:00
|
|
|
|
:unless '(sp-point-before-word-p sp-point-before-same-p))
|
2016-01-18 01:44:15 -05:00
|
|
|
|
(sp-pair "[" nil :post-handlers '(("| " " "))
|
2015-12-23 02:40:41 -05:00
|
|
|
|
:unless '(sp-point-before-word-p sp-point-before-same-p))
|
2015-07-25 13:50:30 +02:00
|
|
|
|
|
2016-05-12 22:11:43 -04:00
|
|
|
|
(sp-local-pair
|
|
|
|
|
'css-mode "/*" "*/" :post-handlers '(("[d-3]||\n[i]" "RET") ("| " "SPC")))
|
2016-05-26 18:53:46 -04:00
|
|
|
|
(sp-local-pair '(sh-mode markdown-mode) "`" nil
|
2016-05-12 22:11:43 -04:00
|
|
|
|
:unless '(sp-point-before-word-p sp-point-before-same-p))
|
2015-12-23 02:40:41 -05:00
|
|
|
|
(sp-with-modes '(xml-mode nxml-mode php-mode)
|
2016-03-28 21:39:13 -04:00
|
|
|
|
(sp-local-pair "<!--" "-->" :post-handlers '(("| " "SPC")))))
|
2015-06-04 18:23:21 -04:00
|
|
|
|
|
2016-05-20 19:08:02 -04:00
|
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
;; Keybinding fixes
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
;; This section is dedicated to bindings that "fix" certain keys so that they
|
|
|
|
|
;; behave more like vim (or how I like it).
|
|
|
|
|
|
|
|
|
|
;; Line-wise mouse selection on margin
|
2016-05-26 18:51:39 -04:00
|
|
|
|
(map! "<left-margin> <down-mouse-1>" 'doom/mouse-drag-line
|
|
|
|
|
"<left-margin> <mouse-1>" 'doom/mouse-select-line
|
|
|
|
|
"<left-margin> <drag-mouse-1>" 'doom/mouse-select-line)
|
2016-05-20 19:08:02 -04:00
|
|
|
|
|
|
|
|
|
;; Restores "dumb" indentation to the tab key. This rustles a lot of peoples'
|
|
|
|
|
;; jimmies, apparently, but it's how I like it.
|
2016-05-20 22:37:30 -04:00
|
|
|
|
(map! :i "<tab>" 'doom/dumb-indent
|
|
|
|
|
:i "<backtab>" 'doom/dumb-dedent
|
2016-05-20 19:08:02 -04:00
|
|
|
|
:i "<C-tab>" 'indent-for-tab-command
|
2016-05-21 18:43:35 -04:00
|
|
|
|
:i "<A-tab>" (λ! (insert "\t"))
|
2016-05-20 19:08:02 -04:00
|
|
|
|
;; No dumb-tab for lisp
|
2016-05-20 22:37:30 -04:00
|
|
|
|
(:map lisp-mode-map :i [remap doom/dumb-indent] 'indent-for-tab-command)
|
|
|
|
|
(:map emacs-lisp-mode-map :i [remap doom/dumb-indent] 'indent-for-tab-command)
|
2016-05-20 19:08:02 -04:00
|
|
|
|
;; Highjacks space/backspace to:
|
|
|
|
|
;; a) eat spaces on either side of the cursor, if present ( | ) -> (|)
|
|
|
|
|
;; b) allow backspace to delete space-indented blocks intelligently
|
|
|
|
|
;; c) but do none of this when inside a string
|
2016-05-26 18:53:46 -04:00
|
|
|
|
:i "SPC" 'doom/inflate-space-maybe
|
|
|
|
|
:i [remap delete-backward-char] 'doom/deflate-space-maybe
|
|
|
|
|
:i [remap newline] 'doom/newline-and-indent
|
2016-05-20 19:08:02 -04:00
|
|
|
|
;; Smarter move-to-beginning-of-line
|
2016-05-26 18:51:39 -04:00
|
|
|
|
:i [remap move-beginning-of-line] 'doom/move-to-bol
|
2016-05-20 19:08:02 -04:00
|
|
|
|
;; Restore bash-esque keymaps in insert mode; C-w and C-a already exist
|
2016-05-20 22:37:30 -04:00
|
|
|
|
:i "C-e" 'doom/move-to-eol
|
|
|
|
|
:i "C-u" 'doom/backward-kill-to-bol-and-indent
|
2016-05-20 19:08:02 -04:00
|
|
|
|
;; Fixes delete
|
|
|
|
|
:i "<kp-delete>" 'delete-char
|
|
|
|
|
;; Fix osx keymappings and then some
|
2016-05-20 22:37:30 -04:00
|
|
|
|
:i "<M-left>" 'doom/move-to-bol
|
|
|
|
|
:i "<M-right>" 'doom/move-to-eol
|
2016-05-20 19:08:02 -04:00
|
|
|
|
:i "<M-up>" 'beginning-of-buffer
|
|
|
|
|
:i "<M-down>" 'end-of-buffer
|
|
|
|
|
:i "<C-up>" 'smart-up
|
|
|
|
|
:i "<C-down>" 'smart-down
|
|
|
|
|
;; Fix emacs motion keys
|
|
|
|
|
:i "A-b" 'evil-backward-word-begin
|
|
|
|
|
:i "A-w" 'evil-forward-word-begin
|
|
|
|
|
:i "A-e" 'evil-forward-word-end
|
|
|
|
|
;; Textmate-esque insert-line before/after
|
|
|
|
|
:i "<M-return>" 'evil-open-below
|
|
|
|
|
:i "<S-M-return>" 'evil-open-above
|
|
|
|
|
;; insert lines in-place)
|
|
|
|
|
:n "<M-return>" (λ! (save-excursion (evil-insert-newline-below)))
|
|
|
|
|
:n "<S-M-return>" (λ! (save-excursion (evil-insert-newline-above)))
|
|
|
|
|
;; Make ESC quit all the things
|
|
|
|
|
(:map (minibuffer-local-map
|
|
|
|
|
minibuffer-local-ns-map
|
|
|
|
|
minibuffer-local-completion-map
|
|
|
|
|
minibuffer-local-must-match-map
|
|
|
|
|
minibuffer-local-isearch-map)
|
|
|
|
|
[escape] 'abort-recursive-edit
|
|
|
|
|
"C-r" 'evil-paste-from-register)
|
|
|
|
|
|
|
|
|
|
(:map (evil-ex-search-keymap read-expression-map)
|
|
|
|
|
"C-w" 'backward-kill-word
|
|
|
|
|
"C-u" 'backward-kill-sentence
|
|
|
|
|
"C-b" 'backward-word)
|
|
|
|
|
|
|
|
|
|
(:map evil-ex-completion-map "C-a" 'move-beginning-of-line)
|
|
|
|
|
|
|
|
|
|
(:after view
|
|
|
|
|
(:map view-mode-map "<escape>" 'View-quit-all))
|
|
|
|
|
|
|
|
|
|
(:after help-mode
|
|
|
|
|
(:map help-map
|
|
|
|
|
;; Remove slow/annoying help subsections
|
|
|
|
|
"h" nil
|
|
|
|
|
"g" nil)))
|
|
|
|
|
|
2015-06-04 18:23:21 -04:00
|
|
|
|
(provide 'core-editor)
|
|
|
|
|
;;; core-editor.el ends here
|