0

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?

1

1 Answer 1

1

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

noremap <silent><F5> :wall \| !clear && echo "% is running..." && python %<CR>
Sign up to request clarification or add additional context in comments.

1 Comment

Or use <Bar> (this is mostly used); see :help key-notation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.