Add :retab ex command (untested)

This commit is contained in:
Henrik Lissner 2014-09-05 17:29:08 -04:00
parent f2e2f05742
commit acef486d46
2 changed files with 20 additions and 3 deletions

View file

@ -173,12 +173,12 @@
(my:tmux-paste command)
(my:tmux-run command)))
(evil-define-operator my:ex:scratch-buffer (beg end type &optional bang)
(evil-define-operator my:ex:scratch-buffer (beg end &optional bang)
:motion nil
:move-point nil
:type line
:repeat nil
(interactive "<R><!>")
(interactive "<r><!>")
(let ((text nil)
(mode major-mode)
(text-empty-p nil))
@ -193,6 +193,23 @@
(if text (insert text))
(funcall mode)))))
(evil-define-operator my:ex:retab (beg end)
:motion nil
:move-point nil
:type line
:repeat nil
"Akin to vim's :retab, this changes all tabs-to-spaces or
spaces-to-tabs, depending on `indent-tab-mode'. Untested."
(interactive "<r>")
(let ((b beg)
(e end))
(unless (and b e)
(setq b (point-min))
(setq e (point-max)))
(if indent-tabs-mode
(tabify b e)
(untabify b e))))
(evil-define-command my:ex:byte-compile-all (&optional bang) :repeat nil
(interactive "<!>")
(byte-recompile-file (expand-file-name "init.el" *dir) bang 0)