3 ms·
Not to take away anything from the project, but for my particular workflow, the way I get the built in find to work for me is by doing this in vim: set errorfo
by roryrjb 7y ago
Not to take away anything from the project, but for my particular workflow, the way I get the built in find to work for me is by doing this in vim:
set errorformat+=%f,
command! -nargs=+ FindAll cgete system('find . ' .
\ join(ignored_dirs_find, ' ') . ' ' .
\ '-type f -iname \<args>\') | copen 9
I can then :FindAll some_pattern, with ignored_dirs_find being an array that gets populated somewhere else in my .vimrc with -not ( -path -prune ) flags. As I said this works for me, as I'm much more likely to be doing this kind of thing in vim rather directly in the shell, otherwise I do like to use find directly. I prefer doing this to using dedicated extra tools because I often find myself in a machine I haven't configured and I can just get going right away by either using find's flags or curling a .vimrc. No packages to mess with, no plugins to set up. I guess my point is, it's very handy to ignore lots of things when using find, something which fd and others like ripgrep does by default. I just like to be as portable as possible.
EDIT: Also to clarify the copen bit, this will populate a list of results in a seperate window, making it work by adding a simple %f to errorformat, so it knows just to display a list of file names, then you can either switch to that window or :cnf :cbf to switch between files without losing focus of your main editor window.