asyncrun.vim
asyncrun.vim copied to clipboard
how to execute a command in a combined path
the LLVM_HOME is an PATH, the run-clang-tidy.py is in $LLVM_HOME/share/clang.
So, if i run the following command, it can't find the file.
AsyncRun python $LLVM_HOME/share/clang/run-clang-tidy.py -checks="*" %
however, the following command works.
AsyncRun python d:/llvm/share/clang/run-clang-tidy.py -checks="*" %
how to use the env params in command
Put them in a external shell script file and run the script by:
AsyncRun ~/.vim/scripts/my script.sh
Put them in a external shell script file and run the script by:
AsyncRun ~/.vim/scripts/my script.sh
Thanks.
However, it's only worthy for the frequent tasks.
Put them in a external shell script file and run the script by: AsyncRun ~/.vim/scripts/my script.sh
Thanks.
However, it's only worthy for the frequent tasks.
Shell environment variables are nothing special as they are just plain strings. Thus, you could write a vim function to execute echo shell command and capture the output as the return value. For example, you could write a function like this:
function! GetEnvVar(varname)
let varval = ''
" do something to get the value.
return varval
endfunction
And in Ex mode, when you need to use the value of the variable, just press <c-r>=call GetEnvVar(XXX)<cr>, the string value of the variable would be expanded.