有没有vim命令可以在粘贴后进入插入模式?

发布于 2024-09-25 12:21:50 字数 48 浏览 0 评论 0原文

如果我使用“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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

听你说爱我 2024-10-02 12:21:50

这取决于粘贴后您希望在何处插入文本。使用 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 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.

北方的巷 2024-10-02 12:21:50

您可以使用 Ctrl+op 直接从插入模式粘贴。也许这对你有用?

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

草莓味的萝莉 2024-10-02 12:21:50

您可以映射一个快捷方式来执行此操作,并使用它来粘贴:

nmap <leader>p pi

如果您的前导键是“,”,则“,p”将粘贴,然后进入插入模式。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文