mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
nit(evil): revise & reformat comments
For clarity and to conform to newer conventions.
This commit is contained in:
@ -143,9 +143,9 @@ more information on modifiers."
|
|||||||
"Same as `evil-window-split', but correctly updates the window history."
|
"Same as `evil-window-split', but correctly updates the window history."
|
||||||
:repeat nil
|
:repeat nil
|
||||||
(interactive "P<f>")
|
(interactive "P<f>")
|
||||||
;; HACK This ping-ponging between the destination and source windows is to
|
;; HACK: This ping-ponging between the destination and source windows is to
|
||||||
;; update the window focus history, so that, if you close either split
|
;; update the window focus history, so that, if you close either split
|
||||||
;; afterwards you won't be sent to some random window.
|
;; afterwards you won't be sent to some random window.
|
||||||
(let ((origwin (selected-window))
|
(let ((origwin (selected-window))
|
||||||
window-selection-change-functions)
|
window-selection-change-functions)
|
||||||
(select-window (split-window origwin count 'below))
|
(select-window (split-window origwin count 'below))
|
||||||
@ -162,9 +162,9 @@ more information on modifiers."
|
|||||||
"Same as `evil-window-split', but correctly updates the window history."
|
"Same as `evil-window-split', but correctly updates the window history."
|
||||||
:repeat nil
|
:repeat nil
|
||||||
(interactive "P<f>")
|
(interactive "P<f>")
|
||||||
;; HACK This ping-ponging between the destination and source windows is to
|
;; HACK: This ping-ponging between the destination and source windows is to
|
||||||
;; update the window focus history, so that, if you close either split
|
;; update the window focus history, so that, if you close either split
|
||||||
;; afterwards you won't be sent to some random window.
|
;; afterwards you won't be sent to some random window.
|
||||||
(let ((origwin (selected-window))
|
(let ((origwin (selected-window))
|
||||||
window-selection-change-functions)
|
window-selection-change-functions)
|
||||||
(select-window (split-window origwin count 'right))
|
(select-window (split-window origwin count 'right))
|
||||||
|
@ -139,17 +139,18 @@ directives. By default, this only recognizes C directives.")
|
|||||||
(count-lines (point-min) (point-max))
|
(count-lines (point-min) (point-max))
|
||||||
(buffer-size)))))
|
(buffer-size)))))
|
||||||
|
|
||||||
;; REVIEW In evil, registers 2-9 are buffer-local. In vim, they're global,
|
;; HACK: In vim, registers 2-9 are global. In Evil, they're buffer-local. so
|
||||||
;; so... Perhaps this should be PRed upstream?
|
;; I enforce vim's way.
|
||||||
|
;; REVIEW: PR this upstream?
|
||||||
(defadvice! +evil--make-numbered-markers-global-a (char)
|
(defadvice! +evil--make-numbered-markers-global-a (char)
|
||||||
:after-until #'evil-global-marker-p
|
:after-until #'evil-global-marker-p
|
||||||
(and (>= char ?2) (<= char ?9)))
|
(and (>= char ?2) (<= char ?9)))
|
||||||
|
|
||||||
;; Make J (evil-join) remove comment delimiters when joining lines.
|
;; HACK: Fix joining commented lines with J (evil-join).
|
||||||
(advice-add #'evil-join :around #'+evil-join-a)
|
(advice-add #'evil-join :around #'+evil-join-a)
|
||||||
|
|
||||||
;; Prevent gw (`evil-fill') and gq (`evil-fill-and-move') from squeezing
|
;; HACK: Prevent gw (`evil-fill') and gq (`evil-fill-and-move') from squeezing
|
||||||
;; spaces. It doesn't in vim, so it shouldn't in evil.
|
;; spaces. It doesn't in vim, so it shouldn't in evil.
|
||||||
(defadvice! +evil--no-squeeze-on-fill-a (fn &rest args)
|
(defadvice! +evil--no-squeeze-on-fill-a (fn &rest args)
|
||||||
:around '(evil-fill evil-fill-and-move)
|
:around '(evil-fill evil-fill-and-move)
|
||||||
(letf! (defun fill-region (from to &optional justify nosqueeze to-eop)
|
(letf! (defun fill-region (from to &optional justify nosqueeze to-eop)
|
||||||
@ -159,12 +160,12 @@ directives. By default, this only recognizes C directives.")
|
|||||||
;; 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)
|
||||||
|
|
||||||
;; monkey patch `evil-ex-replace-special-filenames' to improve support for
|
;; HACK: Enhance `evil-ex-replace-special-filenames' to add support for
|
||||||
;; file modifiers like %:p:h. This adds support for most of vim's modifiers,
|
;; Vim-like Ex file modifiers like %:p:h. Most vim's modifiers are
|
||||||
;; and one custom one: %:P (expand to the project root).
|
;; supported, plus one custom one: %:P (expands to the project's root).
|
||||||
(advice-add #'evil-ex-replace-special-filenames :override #'+evil-replace-filename-modifiers-a)
|
(advice-add #'evil-ex-replace-special-filenames :override #'+evil-replace-filename-modifiers-a)
|
||||||
|
|
||||||
;; make `try-expand-dabbrev' (from `hippie-expand') work in minibuffer
|
;; HACK: Make `try-expand-dabbrev' (from `hippie-expand') work in minibuffer
|
||||||
(add-hook 'minibuffer-inactive-mode-hook #'+evil--fix-dabbrev-in-minibuffer-h)
|
(add-hook 'minibuffer-inactive-mode-hook #'+evil--fix-dabbrev-in-minibuffer-h)
|
||||||
|
|
||||||
;; Focus and recenter new splits
|
;; Focus and recenter new splits
|
||||||
|
Reference in New Issue
Block a user