feature/evil: new +evil:align-right command

Bound to :ral[ign]
This commit is contained in:
Henrik Lissner 2018-03-20 23:55:33 -04:00
parent a26755a089
commit 7574e13677
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 12 additions and 0 deletions

View file

@ -36,6 +36,7 @@
;; Editing ;; Editing
(ex! "@" #'+evil:macro-on-all-lines) ; TODO Test me (ex! "@" #'+evil:macro-on-all-lines) ; TODO Test me
(ex! "al[ign]" #'+evil:align) (ex! "al[ign]" #'+evil:align)
(ex! "ral[ign]" #'+evil:align-right)
(ex! "enhtml" #'+web:encode-html-entities) (ex! "enhtml" #'+web:encode-html-entities)
(ex! "dehtml" #'+web:decode-html-entities) (ex! "dehtml" #'+web:decode-html-entities)
(ex! "mc" #'+evil:mc) (ex! "mc" #'+evil:mc)

View file

@ -176,6 +176,17 @@ line)."
(concat "\\(\\s-*\\)" (evil-transform-vim-style-regexp pattern)) (concat "\\(\\s-*\\)" (evil-transform-vim-style-regexp pattern))
1 1 bang)) 1 1 bang))
;;;###autoload (autoload '+evil:align-right "feature/evil/autoload/evil" nil t)
(evil-define-operator +evil:align-right (beg end pattern &optional bang)
"Like `+evil:align', except alignments are right-justified. PATTERN is a
vim-style regexp. If BANG, repeat the alignment for all matches (otherwise just
the first match on each line)."
(interactive "<r><//g><!>")
(align-regexp
beg end
(concat "\\(" (evil-transform-vim-style-regexp pattern) "\\)")
-1 1 bang))
;; --- wgrep ------------------------------ ;; --- wgrep ------------------------------