editor/evil: port vim-unimpaired keybinds

Adds these keys, inspired by tpope/vim-unimpaired:

[ SPC, ] SPC (or [o, ]o)
  Add COUNT blank lines above/below the cursor
[f, ]f
  Visit previous/next file in current folder, alphabetically
[u, ]u
  Url encode/decode operators
[y, ]y
  C-string-style escaping/unescaping operators (escapes quotes,
  backslashes and control characters)
[x, ]x
  XML entity encoding/decoding operators (only if :lang web is enabled)
[F, ]F
  Focus previous/next frame (decided this is better than ]t/[t which is
  being used by hl-todo-{next,previous})

We already had gp and ]b/[b (buffers).

We're not going to port ]e/[e because it is redundant with ddp/ddP or gx
(evil-exchange). I also think these keybinds are better suited to
{next,previous}-error.
This commit is contained in:
Henrik Lissner 2019-06-15 16:17:44 +02:00
parent be3f6fb38f
commit 0b1ecb8105
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 166 additions and 23 deletions

View file

@ -31,16 +31,6 @@
(evil-normal-state)
(evil-visual-restore))
;;;###autoload
(defun +evil/reselect-paste ()
"Return to visual mode and reselect the last pasted region."
(interactive)
(cl-destructuring-bind (_ _ _ beg end &optional _)
evil-last-paste
(evil-visual-make-selection
(save-excursion (goto-char beg) (point-marker))
end)))
;;;###autoload
(defun +evil/paste-preserve-register ()
"Call `evil-paste-after' without overwriting the clipboard (by writing to the