asyncrun.vim
asyncrun.vim copied to clipboard
AsyncRun ag in windows10 has no output
I've used asyncrun.vim in linux vim, now I have to use gvim in windows10.
Environment:
- windows10,
- gvim8.1
- ag, rg have install in system $PATH
- maybe relate vim options: &shell is default to 'cmd.exe', &shellcmdflag is
/d /s /c
Problem:
In gvim execute :AsyncRun ag --version and :AsyncRun ag --help has correct output in quickfix window, just as execute ag --version or ag --help directly in cmd.exe or powershell(or gitbash) prompt window.
But when I want to search something in one code project, such as :AsyncRun ag function, the quickfix window only result in [Finished in 0 seconds with code 1], which seems fail to search, while in cmd.exe prompt `ag function' can print out some search output.
later I've try out use AsyncRun ag function . can work, must explicitly provide . as current directory argument.
That's different from the default behavior when run ag/rg directly in shell/cmd.exe
because stdin has been closed by default
because stdin has been closed by default
Why do you make such a setting? What's the benefit?I want to know the reason.3Q
I add "." to the ag command, but I cannot jump to the result in quickfix window. all result start with || , any ideas?

你要找找 ag 的参数,让它输出成:
文件名:行号: 内容
这样的 grep 格式,才能捕获。
@skywind3000 Great help!!! I add --vimgrep to the ag command and everything works!!