diff --git a/emacs/spacemacs.el b/emacs/spacemacs.el index db9ed8b..cd2331c 100644 --- a/emacs/spacemacs.el +++ b/emacs/spacemacs.el @@ -470,6 +470,18 @@ layers configuration." "Q_INTERFACES")) (c-make-macro-with-semi-re))) + ;; Evil $ and g$ + (evil-define-motion evil-last-non-blank (count) + "Move the cursor to the last non-blank character +on the current line. If COUNT is given, move COUNT - 1 +lines downward first." + :type inclusive + (evil-end-of-line count) + (setq evil-this-type 'inclusive) ; Overridden in some cases by `evil-end-of-line' + (re-search-backward "^\\|[^[:space:]]")) + (define-key evil-motion-state-map "g$" 'evil-end-of-line) + (define-key evil-motion-state-map "$" 'evil-last-non-blank) + ;; Some fixes for comint-style buffers (dolist (mode '(erc-mode comint-mode term-mode)) (bb/remove-from-list evil-insert-state-modes mode))