Reputation: 31963
The shortcut Y, for some reason, does not operate the way D and C do. Instead of yanking from the current position to the end of the line, Y yanks the whole line. Y does the same thing as yy.
Is it possible to override this functionality ? I want Y to acts as y$
Upvotes: 4
Views: 363
Reputation: 172608
Learn how to look up commands and navigate the built-in :help
; it is comprehensive and offers many tips. Pertaining to your question, :help Y
offers this:
If you like "Y" to work from the cursor to the end of line (which is more logical, but not Vi-compatible) use
:map Y y$
.
Upvotes: 3