I have an instruction in the _vimrc file to display F3, to make vimgrep for the word under the current cursor.
map <F3> :execute "noautocmd vimgrep /" . expand("<cword>") . "/gj **/*." . expand("%:e") <Bar> cw<CR>
Now I want to make vimgrep to exactly match words for the word under the current cursor. I changed it as shown below, but it does not work.
map <leader>s :execute "noautocmd vimgrep /\<" . expand("<cword>") . "\>/gj **/*." . expand("%:e") <Bar> cw<CR>
Something is wrong? How can I achieve exact match words?
source
share