I'd like to search the current directory recursively for the word under cursor.
Here is what I have now in my .vimrc (Note I'm on Windows):
nmap <leader>f :vimgrep! <cword> **.* <bar> :copen <CR>
This works fine but it searches all the files including object files, project files, etc.
vimgrep to search only
When I tried the following, it didn't work:
nmap <leader>f :vimgrep! <cword> **.c **.h **.txt <bar> :copen <CR>
What is the right way to do it?
Another question: why adding
vimgrep doesn't prevent it from automatically jumping to the first match?