I have a keymapping which I posted in a previously answered question at:
VIM – Sourcing tags from multiple locations in project
I am wondering if it is possible to make this mapping a multi-line mapping to a set of functions so that it is tidier in my .vimrc file. The command is currently one huge one-liner:
" Create a mapping to delete the old tags, re-generate them, and use them
map <F10> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q . \| rm -f $SDK_SRC_PLUS_HEADERS/tags \| ctags -R -f $SDK_SRC_PLUS_HEADERS/tags $SDK_SRC_PLUS_HEADERS/tags \| rm -f $THIRD_PARTY_SDK/tags \| ctags -R -f $THIRD_PARTY_SDK/tags $THIRD_PARTY_SDK/tags \| echo "Done re-generating tags."<CR>
Does VIM support some sort of escape sequence so I could break the mapping into something more readable and block aligned, like so:
" Create a mapping to delete the old tags, re-generate them, and use them
map <F10> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .
\| rm -f $SDK_SRC_PLUS_HEADERS/tags
\| ctags -R -f $SDK_SRC_PLUS_HEADERS/tags $SDK_SRC_PLUS_HEADERS/tags
\| rm -f $THIRD_PARTY_SDK/tags
\| ctags -R -f $THIRD_PARTY_SDK/tags $THIRD_PARTY_SDK/tags
\| echo "Done re-generating tags."<CR>
I have tried numerous escape sequences, but no luck.
Thank you all in advance.
Why not just make it a shell script and reference it in one line trivially ?
That way you can easily test it outside vim, and use it in other tools too.
To answer your concern below, if your environment variables were exported in the same session as vim (and prior to vim) then they will remain the same for sub-processes regardless of you changing them later.