mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-04-24 03:50:24 +10:00
Updating dotfiles.
This commit is contained in:
@@ -176,6 +176,29 @@ more information on modifiers."
|
||||
(balance-windows (window-parent)))
|
||||
(if file (evil-edit file)))
|
||||
|
||||
;;;###autoload (autoload '+evil-join-a "editor/evil/autoload/advice" nil nil)
|
||||
(evil-define-operator +evil-join-a (beg end)
|
||||
"Join the selected lines.
|
||||
|
||||
This advice improves on `evil-join' by removing comment delimiters when joining
|
||||
commented lines, by using `fill-region-as-paragraph'.
|
||||
|
||||
From https://github.com/emacs-evil/evil/issues/606"
|
||||
:motion evil-line
|
||||
(let* ((count (count-lines beg end))
|
||||
(count (if (> count 1) (1- count) count))
|
||||
(fixup-mark (make-marker)))
|
||||
(dotimes (var count)
|
||||
(if (and (bolp) (eolp))
|
||||
(join-line 1)
|
||||
(let* ((end (line-beginning-position 3))
|
||||
(fill-column (1+ (- end beg))))
|
||||
(set-marker fixup-mark (line-end-position))
|
||||
(fill-region-as-paragraph beg end nil t)
|
||||
(goto-char fixup-mark)
|
||||
(fixup-whitespace))))
|
||||
(set-marker fixup-mark nil)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +evil--fix-dabbrev-in-minibuffer-h ()
|
||||
"Make `try-expand-dabbrev' from `hippie-expand' work in minibuffer. See
|
||||
|
||||
@@ -155,6 +155,17 @@ directives. By default, this only recognizes C directives.")
|
||||
(run-at-time 0.1 nil #'helpful-key key-sequence)
|
||||
(abort-recursive-edit)))
|
||||
|
||||
;; Make J (evil-join) remove comment delimiters when joining lines.
|
||||
(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'.
|
||||
(advice-add #'evil-force-normal-state :after #'+evil-escape-a)
|
||||
|
||||
@@ -373,16 +384,18 @@ directives. By default, this only recognizes C directives.")
|
||||
;;; Keybinds
|
||||
|
||||
;; Keybinds that have no Emacs+evil analogues (i.e. don't exist):
|
||||
;; zq - mark word at point as good word
|
||||
;; zw - mark word at point as bad
|
||||
;; zu{q,w} - undo last marking
|
||||
;; Keybinds that evil define:
|
||||
;; z= - correct flyspell word at point
|
||||
;; ]s - jump to previous spelling error
|
||||
;; [s - jump to next spelling error
|
||||
|
||||
(map! :v "@" #'+evil:apply-macro
|
||||
|
||||
;; implement dictionary keybinds
|
||||
;; evil already defines 'z=' to `ispell-word' = correct word at point
|
||||
(:when (featurep! :checkers spell)
|
||||
:n "zq" #'+spell/add-word
|
||||
:n "zw" #'+spell/remove-word
|
||||
:m "[s" #'+spell/previous-error
|
||||
:m "]s" #'+spell/next-error)
|
||||
|
||||
;; ported from vim-unimpaired
|
||||
:n "] SPC" #'+evil/insert-newline-below
|
||||
:n "[ SPC" #'+evil/insert-newline-above
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; editor/evil/packages.el
|
||||
|
||||
(package! evil :pin "2bc6ca3587502fde67b93e411e329fc8224c916a")
|
||||
(package! evil :pin "1e7aa5bfbd86feff0ed5982e487070352d326b90")
|
||||
(package! evil-args :pin "758ad5ae54ad34202064fec192c88151c08cb387")
|
||||
(package! evil-easymotion :pin "f96c2ed38ddc07908db7c3c11bcd6285a3e8c2e9")
|
||||
(package! evil-embrace :pin "4379adea032b25e359d01a36301b4a5afdd0d1b7")
|
||||
@@ -33,4 +33,4 @@
|
||||
(package! neotree)
|
||||
(autoload 'neotree-make-executor "neotree" nil nil 'macro))
|
||||
|
||||
(package! evil-collection :pin "3e62b6b1312f7907081be41a032aaacffa732fef"))
|
||||
(package! evil-collection :pin "c136589d9584e5d01a4b3f2e4cf8ac5f5a23be63"))
|
||||
|
||||
Reference in New Issue
Block a user