asynctasks.vim
asynctasks.vim copied to clipboard
Pre-command
Is it possible to have a pre-command.
For example, if you run for the first time, then it sets up some variable or something (in my case, i want to use direnv).
So, it takes about 5 seconds to setup direnv and while it sets up it outputs. So i was wondering if i can use a pre-cmd so that it sets it up.
The way i do now is:
command= cd .. && cd $(VIM_ROOT) && cargo run
So basically, i go a dir up, then back to activate direnv. Because direnv is activated only on directory change (it acts as a bash/zsh daemon from .bashrc/.zshrc file). And since Asynctasks always opens in the same directory where VIM is open (or project root directory), direnv can't detect the dir change, thus the cd $(VIM_ROOT) of Asynctasks does not activate direnv.
Having a pre-cmd would be very useful not only for direnv, but other cases too.
my case would be:
pre-command= cd .. && cd $(VIM_ROOT) # to be activated only once
command= cargo run # to ba activated everytime