Move :global and :align defs back to core-evil

This commit is contained in:
Henrik Lissner 2016-05-21 00:09:32 -04:00
parent 51b4ddb70c
commit 6a1bc990d2
2 changed files with 18 additions and 18 deletions

View file

@ -177,7 +177,24 @@
(list (when (evil-ex-p) evil-ex-argument))) (list (when (evil-ex-p) evil-ex-argument)))
(evil-define-interactive-code "<g//>" (evil-define-interactive-code "<g//>"
:ex-arg global-match :ex-arg global-match
(when (evil-ex-p) (evil-ex-parse-global evil-ex-argument)))) (when (evil-ex-p) (evil-ex-parse-global evil-ex-argument)))
(evil-define-operator doom:evil-ex-global (beg end pattern command &optional invert)
"Rewritten :g[lobal] that will highlight buffer matches. Takes the same arguments."
:motion mark-whole-buffer :move-point nil
(interactive "<r><g//><!>")
(evil-ex-global beg end pattern command invert))
(evil-define-operator doom:align (&optional beg end bang pattern)
"Ex interface to `align-regexp'. Accepts vim-style regexps."
(interactive "<r><!><//>")
(align-regexp
beg end
(concat "\\(\\s-*\\)"
(if bang
(regexp-quote pattern)
(evil-transform-vim-style-regexp pattern)))
1 1)))
;; evil plugins ;; evil plugins
(use-package evil-numbers (use-package evil-numbers

View file

@ -1,22 +1,5 @@
;;; my-commands.el ;;; my-commands.el
(evil-define-operator doom:evil-ex-global (beg end pattern command &optional invert)
"Rewritten :g[lobal] that will highlight buffer matches. Takes the same arguments."
:motion mark-whole-buffer :move-point nil
(interactive "<r><g//><!>")
(evil-ex-global beg end pattern command invert))
(evil-define-operator doom:align (&optional beg end bang pattern)
"Ex interface to `align-regexp'. Accepts vim-style regexps."
(interactive "<r><!><//>")
(align-regexp
beg end
(concat "\\(\\s-*\\)"
(if bang
(regexp-quote pattern)
(evil-transform-vim-style-regexp pattern)))
1 1))
;;; Rewritten commands ;;; Rewritten commands
(ex! "g[lobal]" 'doom:evil-ex-global) (ex! "g[lobal]" 'doom:evil-ex-global)