开发者

Moving a line from one screen to other screen in vim

开发者 https://www.devze.com 2023-03-21 11:12 出处:网络
Suppose I have opened two different files in two vertica开发者_如何学JAVAl screens in vim. Is a there a single command to move the line under cursor to other screen?Not to my knowledge. Delete it, swi

Suppose I have opened two different files in two vertica开发者_如何学JAVAl screens in vim. Is a there a single command to move the line under cursor to other screen?


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>


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>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号