Migrate Evil configuration to use-package
This commit is contained in:
parent
41a69a09d5
commit
4c5d6f6340
|
@ -1,54 +1,47 @@
|
|||
(add-to-list 'load-path "~/.emacs.d/elisp-git/evil/")
|
||||
(add-to-list 'load-path "~/.emacs.d/elisp-git/evil-snipe/")
|
||||
|
||||
(with-eval-after-load 'evil
|
||||
;;(evil-mode 1)
|
||||
(use-package evil
|
||||
:disabled
|
||||
:init (evil-mode 1)
|
||||
;; Want something to switch between evil and god-mode, instead of this.
|
||||
;; They say there's a plugin for it...
|
||||
(global-set-key (kbd "C-x e") 'evil-mode)
|
||||
;; (define-key evil-normal-state-map (kbd "<tab>") 'forward-button)
|
||||
(cp-define-many-keys
|
||||
evil-normal-state-map
|
||||
'(("zR" 'yafolding-show-all)
|
||||
("zM" 'yafolding-hide-all)
|
||||
("zo" 'yafolding-show-element)
|
||||
("zc" 'yafolding-hide-element)))
|
||||
:bind
|
||||
(("C-x e" evil-mode)
|
||||
;;(global-set-key (kbd "g C-g") 'count-words-region)
|
||||
(:map evil-normal-state-map
|
||||
&allow-other-keys(;; ("<tab>" forward-button)
|
||||
("zR" . 'yafolding-show-all)
|
||||
("zM" . 'yafolding-hide-all)
|
||||
("zo" . 'yafolding-show-element)
|
||||
("zc" . 'yafolding-hide-element)
|
||||
|
||||
;; The story so far - in evil-normal-state-map, I set 'i' to
|
||||
;; evil-previous-visual-line, 'k' to evil-next-visual-line, 'j' to
|
||||
;; evil-backward-char. Note that I forgot to set 'h' to insert at
|
||||
;; first...but that's not all - later I realized this didn't affect
|
||||
;; Visual mode :p 4 more lines for that. Next...d/c didn't work with
|
||||
;; ijkl. 4 more lines for evil-operator-state-map. After that - you
|
||||
;; usually want visual-line up/down movement, but _not_ when you hit
|
||||
;; d-j/k (or d-i/k)! So, in evil-operator-state-map, i and k are now
|
||||
;; vanilla evil-previous/next-line. Set gi/gk to
|
||||
;; evil-previous/next-line in normal and visual states, and to
|
||||
;; evil-previous/next-visual-line in operator state - 2 new lines to
|
||||
;; each group of 4.
|
||||
|
||||
(cp-define-many-keys
|
||||
evil-normal-state-map
|
||||
'(("gi" evil-previous-visual-line)
|
||||
;; evil-previous-visual-line, 'k' to evil-next-visual-line,
|
||||
;; 'j' to evil-backward-char. Note that I forgot to set 'h'
|
||||
;; to insert at first...but that's not all - later I realized
|
||||
;; this didn't affect Visual mode :p 4 more lines for that.
|
||||
;; Next...d/c didn't work with ijkl. 4 more lines for
|
||||
;; evil-operator-state-map. After that - you usually want
|
||||
;; visual-line up/down movement, but _not_ when you hit d-j/k
|
||||
;; (or d-i/k)! So, in evil-operator-state-map, i and k are
|
||||
;; now vanilla evil-previous/next-line. Set gi/gk to
|
||||
;; evil-previous/next-line in normal and visual states, and
|
||||
;; to evil-previous/next-visual-line in operator state - 2
|
||||
;; new lines to each group of 4.
|
||||
("gi" . evil-previous-visual-line)
|
||||
("gk" . evil-next-visual-line)
|
||||
( "i" . evil-previous-line)
|
||||
( "k" . evil-next-line)
|
||||
( "j" . evil-backward-char)
|
||||
( "h" . evil-insert)))
|
||||
:map evil-visual-state-map
|
||||
("gi" evil-previous-visual-line)
|
||||
("gk" evil-next-visual-line)
|
||||
("i" evil-previous-line)
|
||||
("k" evil-next-line)
|
||||
("j" evil-backward-char)
|
||||
( "h" evil-insert)))
|
||||
("h" evil-insert)
|
||||
|
||||
(cp-define-many-keys
|
||||
evil-visual-state-map
|
||||
'(("gi" evil-previous-visual-line)
|
||||
("gk" evil-next-visual-line)
|
||||
("i" evil-previous-line)
|
||||
("k" evil-next-line)
|
||||
("j" evil-backward-char)
|
||||
("h" evil-insert)))
|
||||
|
||||
(cp-define-many-keys
|
||||
evil-operator-state-map
|
||||
'(("gi" evil-previous-visual-line)
|
||||
:map evil-operator-state-map
|
||||
("gi" evil-previous-visual-line)
|
||||
("gk" evil-next-visual-line)
|
||||
("i" evil-previous-line)
|
||||
("k" evil-next-line)
|
||||
|
@ -63,19 +56,17 @@
|
|||
("h\}" evil-inner-curly)
|
||||
("h<" evil-inner-angle)
|
||||
("h>" evil-inner-angle)
|
||||
|
||||
("h\[" evil-inner-bracket)
|
||||
("h\]" evil-inner-bracket)
|
||||
("hs" evil-inner-sentence)
|
||||
("hp" evil-inner-paragraph)
|
||||
("h`" evil-inner-back-quote)
|
||||
("h\"" evil-inner-double-quote)
|
||||
("h'" evil-inner-single-quote)))
|
||||
("h'" evil-inner-single-quote)
|
||||
|
||||
(cp-define-many-keys
|
||||
evil-motion-state-map
|
||||
'(("gi" evil-previous-visual-line)
|
||||
("gk" evil-next-visual-line))))
|
||||
:map evil-motion-state-map
|
||||
("gi" evil-previous-visual-line)
|
||||
("gk" evil-next-visual-line)))
|
||||
|
||||
;;;; set C-h to backspace when editing commands and searching
|
||||
(defun kill-start-of-line ()
|
||||
|
|
Loading…
Reference in New Issue