ag.vim icon indicating copy to clipboard operation
ag.vim copied to clipboard

Search highlighted word

Open abacha opened this issue 9 years ago • 2 comments

Is it possible to bind a shortcut (ie leader G) to do :Ag ?

abacha avatar Jan 06 '17 20:01 abacha

I have this shortcut in my vimrc

nnoremap <leader>k :exe 'Ag!' expand('<cword>')<cr>

It searches the word under cursor. For highlighted word this is less easy

benoittgt avatar Jan 09 '17 09:01 benoittgt

This works for me:

vnoremap <leader>G "hy:Ag "<C-r>h"<CR>

I'm not sure if I'm missing something? The comment thread above implies a significant amount of difficulty that I'm just not seeing.

zack avatar Sep 18 '18 14:09 zack