加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

Vim:为什么不“:正常!我“进入插入模式?

发布时间:2020-12-15 19:10:04 所属栏目:安全 来源:网络整理
导读:在vim中,如果我从命令行执行以下命令 :normal! i vim不进入插入模式。同样的命令 :normal! A 将光标移动到行尾,但光标保持在插入模式。 任何想法为什么这不工作?没有,我想知道从vimscript函数的主体进入插入模式的另一种方式(当然函数返回之后,插入模式
在vim中,如果我从命令行执行以下命令
:normal! i

vim不进入插入模式。同样的命令

:normal! A

将光标移动到行尾,但光标保持在插入模式。

任何想法为什么这不工作?没有,我想知道从vimscript函数的主体进入插入模式的另一种方式(当然函数返回之后,插入模式保持不变)。

编辑:看起来像:startinsert将填满问题的第二部分,但我仍然想知道我可以做些什么:正常! A或:正常!一个为什么那些不能像预期那样工作。用箭头运动模拟“追加”是一个坏的解决方案,因为像空行等等。

普通命令以insert方式结束为一个不完整的命令,并中止。从帮助正常:

{commands} should be a complete command. If {commands} does not
finish a command,the last one will be aborted as if <Esc> or <C-C>
was typed. The display isn’t updated while “:normal” is busy. This
implies that an insert command must be completed (to start Insert
mode,see :startinsert)

:startinsert可能是您要查找的命令。

:正常A可以通过追加一个爆炸(!)来启动插件,如Ingo Karkat所建议的。从帮助startinsert:

When the ! is included it works like “A”,append to the line.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读