From 4fce810f8b71e390c035cff9dc19132b2abc0c38 Mon Sep 17 00:00:00 2001 From: Eivind Fonn Date: Mon, 3 Aug 2015 16:27:27 +0200 Subject: [PATCH] Add custom $ motion for now See syl20bnr/spacemacs#2525 --- emacs/spacemacs.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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))