-cwd="$(VIM_FILEDIR)" breaks
TornaxO7 opened this issue · 5 comments
TornaxO7 commented
Example code (language: C
):
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("Hi\n");
return EXIT_SUCCESS;
}
Run with:
:AsyncRun -mode=term -pos=tab -cwd="$(VIM_FILEDIR)" -save=2 gcc -lm % && ./a.out
Getting the following error message:
It works, if I remove the -cwd="$(VIM_FILEDIR)
part of the command.
skywind3000 commented
remove your quotation:
:AsyncRun -mode=term -pos=tab -cwd=$(VIM_FILEDIR) -save=2 gcc -lm % && ./a.out
TornaxO7 commented
It works, thank you!
skywind3000 commented
also I updated asyncrun.vim to mute this error.
skywind3000 commented
I found a bug in your command, %
will be interpreted to a file name relative to vim's working directory, if you specify a different directory by -cwd=?
, the %
should be replaced as `$(VIM_FILENAME)', the correct version is:
:AsyncRun -mode=term -pos=tab -cwd=$(VIM_FILEDIR) -save=2 gcc -lm "$(VIM_FILENAME)" && ./a.out
TornaxO7 commented
I had no problems with this command yet, so I didn't change it but thank you for this hint!