Make Y equivalent to y$.

This is much more consistent with C and D and is even recommended by vim
itself.
This commit is contained in:
person808 2015-08-28 17:43:47 -10:00 committed by syl20bnr
parent 10bcf8e432
commit 12bc72123a
2 changed files with 18 additions and 8 deletions

View file

@ -694,6 +694,9 @@ Additional information may as well be displayed in the minibuffer.
opposite direction in =Vim=, but in =Spacemacs= it is the major mode specific opposite direction in =Vim=, but in =Spacemacs= it is the major mode specific
leader key by default (which can be set on another key binding in the leader key by default (which can be set on another key binding in the
dotfile). dotfile).
- The ~Y~ key does not yank the whole line. It yanks from the current point to
the end of the line. This is more consistent with the behavior of ~C~ and ~D~
and is also recommended by the vim documentation.
Send a PR to add the differences you found in this section. Send a PR to add the differences you found in this section.

View file

@ -717,6 +717,13 @@
(define-key evil-window-map (kbd "<right>") 'evil-window-right) (define-key evil-window-map (kbd "<right>") 'evil-window-right)
(define-key evil-window-map (kbd "<up>") 'evil-window-up) (define-key evil-window-map (kbd "<up>") 'evil-window-up)
(define-key evil-window-map (kbd "<down>") 'evil-window-down) (define-key evil-window-map (kbd "<down>") 'evil-window-down)
;; Make Y equivalent to y$
(defun spacemacs/evil-yank-to-end-of-line ()
"Yank from point to end of line."
(interactive)
(evil-yank (point) (point-at-eol)))
(define-key evil-normal-state-map (kbd "Y") 'spacemacs/evil-yank-to-end-of-line)
(define-key evil-motion-state-map (kbd "Y") 'spacemacs/evil-yank-to-end-of-line)
(evil-leader/set-key "re" 'evil-show-registers) (evil-leader/set-key "re" 'evil-show-registers)