VIM:使用:normal命令退出插入模式 [英] VIM: exit insert mode with :normal command

查看:109
本文介绍了VIM:使用:normal命令退出插入模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,当我使用:normal命令(:normal i)进入插入模式时,如何退出插入模式?

When I go into insert mode with the :normal command (:normal i) for example, how do I exit insert mode?

如果我按< Esc>或< c-c>或< c-[> ;,则VIM退出命令模式,并且我无法运行:normal命令.

If I press <Esc>, or <c-c>, or <c-[>, VIM exits command mode and I can't run my :normal command.

我在我的.vimrc文件中放入了imap <c-e> <Esc>,但是当我键入< c-e>时,在命令模式下,不会插入任何内容.我不知道如何在命令模式下输入"control e".

I put imap <c-e> <Esc> in my .vimrc but when I type <c-e> in command mode, nothing gets inserted. I can't figure out how to enter a "control e" in command mode.

< c-o>可以工作,例如:normal Ihello<c-o>Aworld,但有时我想在正常模式下执行多个命令.

<c-o> works, for example :normal Ihello<c-o>Aworld but sometimes I want to do more than one command in normal mode.

我知道我可以使用宏,但是我想知道如何使用:normal.

I know I can use a macro, but I want to know how to do it with :normal.

推荐答案

要在命令中添加文字<ESC>,请先按CTRL+V,然后按<ESC>.

To add a literal <ESC> to your command, press CTRL+V then <ESC>.

请参见:help i_CTRL-V.

这篇关于VIM:使用:normal命令退出插入模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆