modeline like file-specific command for AsyncRun?
Closed this issue · 3 comments
inspired by vim's modeline, i think if asyncrun provides a similar feature would more convenient.
say i have a file contains a line like this, and when asyncrun runs, it expects this line.
# asyncrun: -mode=term -pos=tab python "$(VIM_FILEPATH)"
it's very handy when there are many small single-file-sourced executables, i dont have to type command every time nor remember it every time i open the file.
i dont think this feature is overlapped with map, it's a good complement.
i wrote a simple implementation that only works on nvim.
AsyncRun supports shebang, if you have the command starting with #!
like:
#! python
in your source header, You can try this:
:AsyncRun -program=shebang abc.py
the command will be interpreted as
python abc.py
But not all source contain a shebang, so you may take a look at:
thanks for the reply!
good to know the shebang support; seems i should try asynctasks further (i just looked it's doc before ask).
so i am closing this.