Skip to content

Commit

Permalink
Add custom $ motion for now
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBB committed Aug 3, 2015
1 parent fde076d commit 4fce810
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions emacs/spacemacs.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 4fce810

Please sign in to comment.