" The Silver Searcher
" Use ag over grep
let &grepprg = "ag --nogroup --nocolor --ignore wiki --ignore tags"
" Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
" ag is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0
" bind \ (backward slash) to grep shortcut
command -nargs=+ -complete=file -bar Ag silent! grep! <args>|cwindow|redraw!
nnoremap \ :Ag<SPACE>
when I click on \ I get the prompt to search, which is great, it looks like this:
I got three questions:
how do I dismiss the bottom bar? I'm not sure what that action is called.. ideally I would connect that to some keyboard binding
How can i make it so that when i click on a file (or perform some keybinding on a file in the list below).. it automatically jumps to the file AND dismiss the bottom bar?
how can I (with a keyboard shortuct) make the bottom bar higher and smaller? sometimes that's useful when i got tonnes of results
Another alternative would be to use an autocommand to create a buffer-local mapping only in the quickfix window, or just to use a new trigger for your jump-to-error-and-close mapping. (e.g. <leader><cr>)
You can use the regular window resizing commands:
These take counts, so you can resize more rapidly with commands such as:
:cwindowcommand. Read the help at
:h quickfixto see what commands are available (like e.g.
:ccloseto close it)