(Emacs)+transpose prefix

Transposing objects?  Pretty cool Emacs, but I'd like it in vim.
This commit is contained in:
2022-08-12 21:22:31 +01:00
parent 1ed167c747
commit 1a45eebcea

View File

@@ -298,13 +298,14 @@ However there are many other packages surrounding evil that port even
greater functionality from vi to Emacs. Surround, commenting, greater functionality from vi to Emacs. Surround, commenting,
multiple cursors and further support to other packages are configured multiple cursors and further support to other packages are configured
here. here.
*** Evil Core *** Evil core
Setup the evil package, with some opinionated keybindings: Setup the evil package, with some opinionated keybindings:
- Switch =evil-upcase= and =evil-downcase= because I use =evil-upcase= - Switch ~evil-upcase~ and ~evil-downcase~ because I use ~evil-upcase~
more more
- Switch =evil-goto-mark= and =evil-goto-mark-line= as I'd rather have - Switch ~evil-goto-mark~ and ~evil-goto-mark-line~ as I'd rather have
the global one closer to the home row the global one closer to the home row
- Use 'T' character as an action for transposing objects
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package evil (use-package evil
:demand t :demand t
@@ -318,17 +319,22 @@ Setup the evil package, with some opinionated keybindings:
"`" #'evil-goto-mark-line "`" #'evil-goto-mark-line
"C-w" #'evil-window-map "C-w" #'evil-window-map
"gu" #'evil-upcase "gu" #'evil-upcase
"gU" #'evil-downcase) "gU" #'evil-downcase
(general-def "T" nil)
:states 'visual (nmmap
:infix "T"
"w" #'transpose-words
"c" #'transpose-chars
"s" #'transpose-sentences
"p" #'transpose-paragraphs
"e" #'transpose-sexps
"l" #'transpose-lines)
(vmap
:keymaps '(emacs-lisp-mode-map lisp-interaction-mode-map) :keymaps '(emacs-lisp-mode-map lisp-interaction-mode-map)
"gr" #'eval-region) "gr" #'eval-region)
(leader (leader
"w" #'evil-window-map "w" #'evil-window-map
"wd" #'delete-frame) "wd" #'delete-frame)
(vmap
:keymaps '(emacs-lisp-mode-map lisp-interaction-mode-map)
"gr" #'eval-region)
:init :init
(setq evil-want-keybinding nil (setq evil-want-keybinding nil
evil-split-window-below t evil-split-window-below t