如何使用 .vimrc 在模式之间切换?
我有一个 .vimrc 脚本,它使用 Conque 自动为 bash 终端创建一个缓冲区(并进入插入模式),然后返回到前一个缓冲区(我打开的文件)。
autocmd VimEnter * ConqueTermSplit bash
autocmd VimEnter * wincmd p
问题是,当我启动 vim 时,我处于插入模式,每次都必须按
才能进入正常模式。
在 .vimrc 末尾写入
不起作用,因为该命令是在命令模式下执行的。
I have a .vimrc script that automatically creates a buffer for a bash terminal with Conque (and goes to insert mode) and then returns to the previous buffer (the file I have opened).
autocmd VimEnter * ConqueTermSplit bash
autocmd VimEnter * wincmd p
The problem is that when I start vim I am left in insert mode and I have to press <Esc>
every time to go to normal mode.
Writing <C-v><Esc>
at the end of .vimrc doesn't work, as the command is executed in command mode.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我没有那个插件
autocmd VimEnter * exec "ConqueTermSplit bash" | autocmd VimEnter * exec "ConqueTermSplit bash" |沉默常态!
可以工作
更新刚刚发现Conque的文档rocks
可以使用
conque_term#open({command}, [buf_opts], [remain])
函数来实现 你想要什么:所以你想要的是大致
I don't have that plugin
autocmd VimEnter * exec "ConqueTermSplit bash" | silent norm!
could work
Update Just found out that Conque's documentation rocks
You can use the
conque_term#open({command}, [buf_opts], [remain])
function to achieve what you want:So what you'd want is roughly