Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 540
vl_stackoverflow Avatar asked May 11 '26 13:05

vl_stackoverflow


1 Answers

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.

like image 54
nobe4 Avatar answered May 13 '26 06:05

nobe4