Skip to content
Linwei edited this page Oct 28, 2016 · 31 revisions

Can asyncrun.vim trigger an autocommand QuickFixCmdPost to get some plugin (like errormaker) processing the content in quickfix ?

Sure you can use either g:asyncrun_exit or -post in your case without modifing any code in asyncrun.vim.

setup global callback on job finished:

let g:asyncrun_exit = "silent doautocmd QuickFixCmdPost make"

setup local callback on each command:

:AsyncRun -post=silent\ doautocmd\ QuickFixCmdPost\ make @ make

Macro '%' is expanded incorrectly on windows if the filename contains spaces ?

The '%' is expanded and escaped by vim itself on the command line, and if the buffer is named 'hello world', % will be escaped as 'hello\ world' by vim. The backslash here is the escaping character, and is okay on all the unix systems, but unfortunately, on windows cmd.exe assumes it as a path seperator.

Here is another accurate form on both windows and unix:

AsyncRun gcc "$(VIM_FILEPATH)" -o "$(VIM_FILEDIR)/$(VIM_FILENAME)"
Clone this wiki locally