I know I can execute the current file, lets say a bash file, with
:! bash %.
But what can I do if I want to execute the current file in a different directory (such as the location of the current file) than the current vim working directory.
I know that I could change to the working directory of the current file by
:cd %:p:h and then execute the file but then I would need to jump back again.
Would really appreciate any help.