Monday, December 18, 2023

Re: vimgrep on files in 'path'

Hi!

You could use the arglist for this.
I'm not sure how to set it from a path but I think you'll find a way to do it.

Once your arglist is set, use `vimgrep /pattern/ ##` to grep the files in the arglist.

Regards,
Tris'
-------- Original Message --------
On Dec 18, 2023, 20:27, Arun < findanarun@gmail.com> wrote:

Hi there,

I wonder if there is any "grep" like counterpart for the ":find" command in vim. Today, ":find" helps one find any file in the 'path'. It would be nice to perform a search for a pattern in the files reachable via 'path'. I could then invoke, say,
    :findgrep /mypattern/ **/*def.h

..to grep for "mypattern" in files reachable via 'path' that ends in "def.h".

I tried to script it by passing the filenames to ":vimgrep" using:
    :exe 'vim/mypattern/'. join(getcompletion('**/*def.h', 'file_in_path'), " ")

..but getcompletion() sometimes does not give me the full path leading to errors.

Regards,
-Arun

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJUkyiFTzLR%3D-OWnBF-MXaB%2B451H8%3DJJ6ojsLJVmgACZMOg6jw%40mail.gmail.com.

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/uxKxGqpo5E17_GBkoqirhH1l6D1CN_ogXgcylK2e69v4uB3M4WV2PA3gElXZDwoQXerzPCqmjX8WU26N2gzAOh2cs4_XufOn35VW9UDtKdQ%3D%40protonmail.com.

No comments:

Post a Comment