Move Evil configuration to init.org

This commit is contained in:
contrapunctus 2022-07-26 09:41:37 +05:30
parent 5a811e25c0
commit ee9d074d06
2 changed files with 92 additions and 87 deletions

View File

@ -1,87 +0,0 @@
(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...
: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.
("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)
:map evil-operator-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)
;; evil-inner-tag ?
("hW" evil-inner-WORD)
("hw" evil-inner-word)
("h\(" evil-inner-paren)
("h\)" evil-inner-paren)
("h\{" evil-inner-curly)
("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)
: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 ()
"Kill from point to start of line."
(interactive)
(kill-line 0))
(define-key evil-insert-state-map (kbd "C-u") 'kill-start-of-line))
;;;; evil-snipe
(with-eval-after-load 'evil-snipe
(setq evil-snipe-count-scope 'letters)
;; This doesn't take two chars by default, which combined with
;; unimplemented evil-snipe-count-scope 'vertical makes it nearly
;; useless as a replacement for fFtT;
(evil-snipe-replace-evil)
(global-evil-snipe-mode 1))
(evil-mode)

View File

@ -2008,6 +2008,98 @@ TODO - make mode-line indicator prominent by placing it first, like in Evil
("<escape>" . god-mode-isearch-disable))))
#+END_SRC
*** Evil mode
:PROPERTIES:
:CUSTOM_ID: evil-mode
:END:
#+BEGIN_SRC emacs-lisp
(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...
:bind
(("C-x e" evil-mode)
;;(global-set-key (kbd "g C-g") 'count-words-region)
(:map evil-normal-state-map
(;; ("<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.
("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)
:map evil-operator-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)
;; evil-inner-tag ?
("hW" evil-inner-WORD)
("hw" evil-inner-word)
("h\(" evil-inner-paren)
("h\)" evil-inner-paren)
("h\{" evil-inner-curly)
("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)
: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 ()
"Kill from point to start of line."
(interactive)
(kill-line 0))
(define-key evil-insert-state-map (kbd "C-u") 'kill-start-of-line)
;;;; evil-snipe
(with-eval-after-load 'evil-snipe
(setq evil-snipe-count-scope 'letters)
;; This doesn't take two chars by default, which combined with
;; unimplemented evil-snipe-count-scope 'vertical makes it nearly
;; useless as a replacement for fFtT;
(evil-snipe-replace-evil)
(global-evil-snipe-mode 1)))
#+END_SRC
* Applications
:PROPERTIES:
:CUSTOM_ID: applications