ejk314
ejk314

Reputation: 381

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?

Upvotes: 0

Views: 882

Answers (1)

ejk314
ejk314

Reputation: 381

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

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

Upvotes: 1

Related Questions