This plugin maps ga
to do a search using mileszs/ack.vim.
This plugin is a fork of Chun-Yang/vim-action-ag that supports mileszs/ack.vim instead of the now-deprecated rking/ag.vim.
Install this plugin and its dependency, mileszs/ack.vim, either manually or by using your Vim plug-in manager of choice.
If you want to use ag
(The Silver Searcher) with this plugin, simply configure ack.vim accordingly.
- Normal Mode
gaiw
to search the wordgai'
to search the words inside single quotes.
- Visual Mode
ga
to search the selected text
" use * to search current word in normal mode
nmap * <Plug>AckActionWord
" use * to search selected text in visual mode
vmap * <Plug>AckActionVisual
There are some special characters used in Ack/Ag, like '$' which is treated as the
end of the line. Most of the time we use literal meaning of these characters.
You can set escapes for these characters by setting g:vim_action_ack_escape_chars
.
This is the default setting for g:vim_action_ack_escape_chars
:
let g:vim_action_ack_escape_chars = '#%.^$*+?()[{\\|'