How to yank the text on a line and paste it inline in Vim?

The problem is that yy is copying the entire line, including the newline. An alternative would be to copy from the beginning to the end of the line, and then paste.

^y$

  • ^ Go to the first character of the line.
  • y Yank till
  • $ End of line.

// Credit to: tester and Idan Arye for the Vim golf improvements.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)