Fix gq/gw squeezing spaces across filled lines
" abcdef" would be changed to "abcdef". Vim doesn't do this. Evil shouldn't either.
This commit is contained in:
parent
e632871a11
commit
75cca3586d
1 changed files with 8 additions and 0 deletions
|
@ -158,6 +158,14 @@ directives. By default, this only recognizes C directives.")
|
||||||
;; Make J (evil-join) remove comment delimiters when joining lines.
|
;; Make J (evil-join) remove comment delimiters when joining lines.
|
||||||
(advice-add #'evil-join :override #'+evil-join-a)
|
(advice-add #'evil-join :override #'+evil-join-a)
|
||||||
|
|
||||||
|
;; Prevent gw (`evil-fill') and gq (`evil-fill-and-move') from squeezing
|
||||||
|
;; spaces. It doesn't in vim, so it shouldn't in evil.
|
||||||
|
(defadvice! +evil--no-squeeze-on-fill-a (orig-fn &rest args)
|
||||||
|
:around '(evil-fill evil-fill-and-move)
|
||||||
|
(letf! (defun fill-region (from to &optional justify nosqueeze to-eop)
|
||||||
|
(funcall fill-region from to justify t to-eop))
|
||||||
|
(apply orig-fn args)))
|
||||||
|
|
||||||
;; Make ESC (from normal mode) the universal escaper. See `doom-escape-hook'.
|
;; Make ESC (from normal mode) the universal escaper. See `doom-escape-hook'.
|
||||||
(advice-add #'evil-force-normal-state :after #'+evil-escape-a)
|
(advice-add #'evil-force-normal-state :after #'+evil-escape-a)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue