Skip to content

Instantly share code, notes, and snippets.

@gilbertw1
Created October 6, 2017 19:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save gilbertw1/e5feb4c0c91f821a95169dfe829364c5 to your computer and use it in GitHub Desktop.
Save gilbertw1/e5feb4c0c91f821a95169dfe829364c5 to your computer and use it in GitHub Desktop.
disable region limiting in evil-ex
(evil-define-command evil-ex (&optional initial-input)
:keep-visual t
:repeat abort
(interactive
(list
(let ((s (concat
(cond
(current-prefix-arg
(let ((arg (prefix-numeric-value current-prefix-arg)))
(cond ((< arg 0) (setq arg (1+ arg)))
((> arg 0) (setq arg (1- arg))))
(if (= arg 0) '(".")
(format ".,.%+d" arg)))))
evil-ex-initial-input)))
(and (> (length s) 0) s))))
(let ((evil-ex-current-buffer (current-buffer))
(evil-ex-previous-command (unless initial-input
(car-safe evil-ex-history)))
evil-ex-argument-handler
evil-ex-info-string
result)
(minibuffer-with-setup-hook
#'evil-ex-setup
(setq result
(read-from-minibuffer
":"
(or initial-input
(and evil-ex-previous-command
(propertize evil-ex-previous-command 'face 'shadow)))
evil-ex-completion-map
nil
'evil-ex-history
evil-ex-previous-command
t)))
(evil-ex-execute result)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment