mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-19 13:43:36 -05:00
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:
@@ -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)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user