3

Is there a one-letter abbreviation for yank-until end of line? For example, there is:

  • D delete til end of line
  • C change til end of line
  • y$ was the closest thing I can find for this (Y yanks full line)

Is there a short-form of the above?

3
  • AFAIK, no. Workaround is "nnoremap Y y$". As suggested here: stackoverflow.com/questions/7764176/…
    – Dmitry
    Jun 14, 2020 at 21:14
  • 4
    Also mentioned in :help Y.
    – Ralf
    Jun 14, 2020 at 21:15
  • For anyone else interested, bear in mind that y$ yanks from the current cursor position until the end of the line including the new line/line feed character. If you don't want that, you will be using yt$ and trying to remap that.
    – Benjamin R
    Oct 15, 2022 at 14:11

1 Answer 1

4

It looks like the "Y" is not Vi-Compatible, but you can make a work around with :map Y y$ (Works on Neovim, not sure about vim proper)

Source

1
  • 2
    Yes, this works on vim, too: :help Y; though, :nnoremap Y y$ is better.
    – D. Ben Knoble
    Feb 1, 2022 at 22:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.