3

This does NOT work with files opened in several tabs (put in ~/.vimrc obviously):

noremap <F5> :wa<CR> <bar> :!global_stack_build_run.sh<CR>

Neither it works when I use | instead of <bar>.

It appears to run only :wa.

4
  • 3
    Are you sure this does not work? According to the documentation :help map_bar using <bar> should work. A simple mapping did just work. Try removing the <cr> from your mapping and see if it will be put into the command line Oct 24, 2018 at 20:10
  • @ChristianBrabandt Thank you! Indeed removing <cr> after wa: worked: noremap <F5> :wa <bar> :!global_stack_build_run.sh<CR>. Consider it an answer. Oct 24, 2018 at 20:13
  • 1
    You dont’t need the second colon in the version in your comment
    – D. Ben Knoble
    Oct 24, 2018 at 23:15
  • @ChristianBrabandt, if you care, you can copy your comment into the answer and I'll accept it. Oct 26, 2018 at 10:20

1 Answer 1

2

According to the documentation :help map_bar using should work. A simple mapping I tried did just work. So try removing the <cr> from your mapping and see if it will be put into the command line

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.