Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim put a line from current cursor position to next line

Tags:

vim

You can pull a line up in vim using Shift + j at the current line. How do you do the reverse i.e put all the words following cursor below the current line ?

like image 572
Vihaan Verma Avatar asked Oct 29 '25 05:10

Vihaan Verma


2 Answers

I go to the whitespace where I want to cut the line and hit r<CR>.

like image 181
romainl Avatar answered Oct 31 '25 02:10

romainl


Doing this is a pretty simple, most people just enter insert mode, stick a newline in there and return to normal mode like this i<entr><esc> There isn't a faster way to do this, however if you really want, you can map this to a key in your vimrc.

like image 43
Daniel Gratzer Avatar answered Oct 31 '25 00:10

Daniel Gratzer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!