Mapping one key to multiple commands in vim -
I think to execute multiple commands in one line, for example pdflatex I can do the following.
: w | ! pdflatex%: t Note that %: t gives you the current filename (without path). This code works well in Vim. Now, if I want to map the whole thing above, ctrl + shift + f6 says i want to be able to do the following
: Nnoremap & lt; C-s-f6 & gt; : w | ! pdflatex%: t & lt; CR & gt; But this does not work, and gives me the following error.
:! Pdflatex paper.tex & lt; CR & gt; / Bin / bash: -c: Line 0: Unexpected token Syntax error near the `new line '/ bin / bish: -C: Line 0:` pdftex paper.Tex & lt; CR & gt; Does this mean that I can not map ctrl + shift + F6 to the desired function, save and execute pdflatex ? & lt; CS-F6 & gt;
Code> actually works (this will probably not be in the CLI Vim), You can avoid the bar or instead of & lt; bar & gt; should be used:
: nnoremap Bars & gt; ! pdflatex%: t & lt; CR & gt; View : help map_bar .
Comments
Post a Comment