On Tue, Dec 13, 2016 at 10:04:53AM -0800, Ni Va wrote:
> Hi,
>
> I am using a useful tool rigrep to search content through dirs and
> files.
>
> Then I have applied it to makeprg and set errorformat to display found
> informations like this :
>
>
> let &makeprg = expand("$VIM").'\vim80\rg.exe -n ' . l:args
> let &errorformat = '%f:%l:%m'
> make
> copen
>
> It works perfectly and found items are well displayed with copen. Now
> I would like to job_start the command make and retrieve same display
> in the copened list.
>
> How can I do that ?
> Thanks by advance
There are two bits of advice I have.
First, vim is very familiar with tools for searching through dirs and
files. The most well-known is called grep (perhaps you also know it).
vim has a command specifically for doing these searches: ":grep". You
can control it with 'grepprg' just like you can control ":make" with
'makeprg'. I suggest you get comfortable using those ones!
(I also use ripgrep. Here are the relevant configurations for me on
Linux):
set grepprg=rg\ --vimgrep
set grepformat=%f:%l:%c:%m
Second, you can use the AsyncRun plugin in order to run 'grepprg'
asynchronously. The syntax is a bit cumbersome, but it looks like:
:AsyncRun -program=grep SEARCH_TERMS
That will run 'grepprg' in the background and populate the errorlist
as you desire.
https://github.com/skywind3000/asyncrun.vim
I hope someone has a better solution than this plugin. :) Maybe one
day :grep will automatically be async?
--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment