开发者

Any vim command to enter insert mode after paste?

开发者 https://www.devze.com 2023-01-18 04:56 出处:网络
If I use \'p\' to paste, vim will rema开发者_JAVA百科in at normal mode. Is there a command where I can paste and enter insert mode?That depends where you wish to insert text after you\'ve pasted. Past

If I use 'p' to paste, vim will rema开发者_JAVA百科in at normal mode. Is there a command where I can paste and enter insert mode?


That depends where you wish to insert text after you've pasted. Paste as normal using p and then enter insert mode using aAiIoO...

The vim mindset is to enter insert mode as frequently as is strictly necessary.

If you meant how do I paste whilst remaining in insert mode you can use <ctrl-r>[register name]. E.g <ctrl-r>" for the default register.


You can paste from insert mode directly, using Ctrl+op. Perhaps this will work for you?


You can map a shortcut to do that, and use it instead to paste:

nmap <leader>p pi

If your leader key is "," then ",p" will paste and then enter insert mode.

0

精彩评论

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