简体   繁体   中英

E488: Trailing characters in Vim mapping

I want to map F5 on a command and typed:

:cmap <F5> :make | vert copen 100<CR>

Then I get E488. What to do?

Escape your | :

:cmap <F5> :make \| vert copen 100<CR>

Right now it tries to

cmap <F5> :make
and then 
vert copen 100<CR>

Escaping the | delimiter ensure your mapping is preserved.

Be aware that the \\| escaping may not always work, as stated in :help map_bar . Alternatives are: <Bar> and ^V| .

Thanks @Randy Morris.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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