Monday, December 18, 2023

vimgrep on files in 'path'

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.

No comments: