Open Konfekt opened 3 years ago
autosave is actually default, except for grep
commands. So Async
and Make
update current buffer. I didn't want grep
commands to save the buffers because sometimes I don't want that. I don't want g:
options, maybe I'll make an option for the global tasks.ini
file. Personally I have mappings like:
nnoremap gr<space> :LGrep<space>
if you use mappings too, you can just prepend an :update<cr>
. I'd like to avoid an option just for grep commands.
If you really want all grep commands to autosave, you can also rewrite the commands:
command! -nargs=1 -bang Grep call async#qfix(<q-args>, {'nojump': <bang>0, 'grep': 1, 'nosave': 0})
command! -nargs=1 -bang LGrep call async#qfix(<q-args>, {'nojump': <bang>0, 'grep': 1, 'nosave': 0, 'locl': 1})
command! -nargs=1 -bang GrepAdd call async#qfix(<q-args>, {'nojump': <bang>0, 'grep': 1, 'nosave': 0, 'append': 1})
command! -nargs=1 -bang LGrepAdd call async#qfix(<q-args>, {'nojump': <bang>0, 'grep': 1, 'nosave': 0, 'locl': 1, 'append': 1})
autosave is actually default, except for grep commands.
Thank you, that suits me as well; I did not know.
how would that work?
Just by prepending the string g:asyncrun_wrapper given as a global option to the command to be run; for example, a grep command could be run under ionice.
Just by prepending the string g:asyncrun_wrapper given as a global option to the command to be run; for example, a grep command could be run under ionice.
From what I can see in the code, this wrapper just prepends a string to the command. It does no escaping or anything special. So basically it's not worth an option, you can just change the command itself.
It is just more convenient to have it automatically prepended instead of having to change all definitions of &makeprg
including the (built-in) compiler files.
I see. I'll add it as an option to the global/local tasks configuration file, I don't want a global variable because it could be set from anywhere and then all commands could be wrapped without even knowing.
Thank you for this great plug-in that seems to have gone mostly unnoticed till now. I am particularly glad that it offers (window-)local make (and grep) commands.
As it was inspired by asyncrun some of it useful options could be transferred, how about
g:asyncrun_save
to save the current file before runningAsync
andg:asyncrun_wrapper
to run all commands by a process scheduler such asnice
?