Skip to content

Commit

Permalink
Add auto-preview feature
Browse files Browse the repository at this point in the history
Auto-preview files when they are selected in the quickfix window.
Include `let g:ackpreview=1` in your .vimrc to enable.
  • Loading branch information
thebinarypenguin authored and kassio committed Mar 11, 2014
1 parent 0af7a73 commit 07d1707
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugin/ack.vim
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ function! s:Ack(cmd, args)
exec "nnoremap <silent> <buffer> H <C-W><CR><C-W>K<C-W>b"
exec "nnoremap <silent> <buffer> v <C-W><CR><C-W>H<C-W>b<C-W>J<C-W>t"
exec "nnoremap <silent> <buffer> gv <C-W><CR><C-W>H<C-W>b<C-W>J"

" If auto preview in on, remap j and k keys
if exists("g:ackpreview")
exec "nnoremap <silent> <buffer> j j<CR><C-W><C-W>"
exec "nnoremap <silent> <buffer> k k<CR><C-W><C-W>"
endif
endif

" If highlighting is on, highlight the search keyword.
Expand Down

0 comments on commit 07d1707

Please sign in to comment.