views:

146

answers:

1

In vim, I do search with vimgrep frequently. I have mapping like below:

map <leader>s :execute "noautocmd vimgrep /\\<" . expand("<cword>") . "\\>/gj **/*.*" <Bar> 
cw<CR> 5

The problem is that there are some temporary subfolders (like obj, objd) that I don't want to search for. How can I exclude subfolders matching given patterns. For example, subfolders with prefix "objd" should not be included in searching.

+2  A: 

You could try ack instead. It integrates nicely with vim and has lots of options for doing the sort of thing you want to do.

There are several ack-vim integrations on GitHub. For example: here and here.

Andy Stewart
+1: `ack` is brilliant. Thanks for the `ack`-`vim` links.
Johnsyweb