How do I copy from the cursor to the end of the line?
Answer
y$
Explanation
The y$ command yanks (copies) text from the cursor position to the end of the line. Unlike Y which copies the whole line, y$ copies only the remainder.
How it works
yis the yank operator$is the motion to the end of the line- The yanked text goes into the default register
Example
hello world and more
With the cursor on w in world, y$ copies world and more.
Tips
Yin Vim yanks the whole line (unlikeDwhich deletes to end of line)- Many users remap
Ytoy$for consistency withDandC ppastes the yanked text after the cursor"ay$yanks to the end of line into registera