简体   繁体   中英

Vim key mapping to execute a python script

I'm trying to map a command in Vim for the first time. I want it to execute the current python script, so I put the following in my .vimrc :

noremap <silent><F5> :wall | !clear && echo "% is running..." && python %<CR>

When I start Vim I get the following error:

/bin/bash: -c: line 0: syntax error near unexpected token `newline'
/bin/bash: -c: line 0: `clear && echo "/home/ekirstein/.vimrc is running..." && python /home/ekirstein/CR>'

Can someone please tell me what I'm doing wrong?

Thanks glts. I forgot to escape the pipe...

noremap <silent><F5> :wall \| !clear && echo "% is running..." && python %<CR>

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