有没有vim命令可以在粘贴后进入插入模式?
如果我使用“p”粘贴,vim 将保持正常模式。有没有可以粘贴并进入插入模式的命令?
If I use 'p' to paste, vim will remain at normal mode. Is there a command where I can paste and enter insert mode?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这取决于粘贴后您希望在何处插入文本。使用
p
正常粘贴,然后使用aAiIoO
进入插入模式...vim 的思维方式是根据严格需要频繁地进入插入模式。
如果您的意思是如何在保持插入模式的情况下进行粘贴,您可以使用
[寄存器名称]
。例如"
用于默认寄存器。That depends where you wish to insert text after you've pasted. Paste as normal using
p
and then enter insert mode usingaAiIoO
...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.您可以使用 Ctrl+op 直接从插入模式粘贴。也许这对你有用?
You can paste from insert mode directly, using Ctrl+op. Perhaps this will work for you?
您可以映射一个快捷方式来执行此操作,并使用它来粘贴:
如果您的前导键是“,”,则“,p”将粘贴,然后进入插入模式。
You can map a shortcut to do that, and use it instead to paste:
If your leader key is "," then ",p" will paste and then enter insert mode.