我在定义自己的命令vimrc
:
command! Tcs :normal lvf`hc
目的是我进行反引号,它将内部内容从此处删除到下一个反引号。喜欢:
`hi there` -> ``
问题是,它仍然保持正常模式,我想复制c
命令行为,以便可以立即开始在插入模式下键入。
我已经尝试过,command! Tcs :normal lvf`hc :startinsert
但是我放在最后一个之后的内容c
将直接在编辑器中键入。
谢谢
:norm[al][!] {commands} *:norm* *:normal* (...) {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.
This implies that an insert command must be completed
。(...)
在您的情况下,命令normal
已中止,这就是为什么您仍处于正常模式。您仍然可以尝试:normal! i
要获得想要的东西,您可以执行以下操作:
command! Tcs execute "normal lvf`hd" | :startinsert
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句