简体   繁体   English

Vim Autocmd E488:尾随字符

[英]Vim autocmd E488: Trailing characters

This line in my vimrc produce the error in the title 我的vimrc中的这一行在标题中产生错误

autocmd CursorMovedI *.html :<C-x><C-u>

How I can make it to work? 我怎样才能使其正常工作?

:autocmd accepts commands for ex mode, don't try to feed it normal-mode commands. :autocmd接受ex模式下的命令,请勿尝试以普通模式命令输入命令。 Correct syntax is probably 正确的语法可能是

autocmd CursorMovedI *.html :execute "normal! \<C-x>\<C-u>"

or 要么

autocmd CursorMovedI *.html :call feedkeys("\<C-x>\<C-u>", 'n')

( : is not really required, but I use it to separate executed commands from execution conditions). :不是必需的,但是我用它来将已执行的命令与执行条件分开)。 You need to remove ! 您需要删除! from first command or , 'n' from the second if you intend to execute a mapping. 如果要执行映射, 'n'则从第一个命令输入,或者从第二个命令返回, 'n'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM