Currently I have this mapping in my ~/.vimrc
noremap <Leader>a :Ack <cword><cr>
which enables me to search for a word under the cursor.
I would like to search for a current visual selection instead, because sometimes words are not enough.
Is there a way I can send visual selection to ack.vim
?
vnoremap
, it's better to usexnoremap
. The former also maps the keystrokes in "select" mode, which is usually used by snippet plugins. Read:help mapmode-x
for details. – Merrick