Reputation: 31
Suppose I have opened two different files in two vertical screens in vim. Is a there a single command to move the line under cursor to other screen?
Upvotes: 3
Views: 141
Reputation: 5408
Not to my knowledge. Delete it, switch panes and paste it.
dd<ctrl>ww</ctrl>p
Of course if this is something you do regularly you can write a macro for it, just like for any other sequence of commands in vim. For example to map CtrlX to this function, you could run this in your buffer or set it in your ~/.vimrc
file:
:map <C-x> dd<C-w><C-w>p<C-w><C-w>
Upvotes: 4
Reputation: 32398
If you want to do this on a regular basis, just map it to a keystroke. e.g.
map <C-A> dd<C-W><C-W>P<C-W><C-W>
Upvotes: 3