Skip to content

Commit

Permalink
vim - use git grep for project search if available
Browse files Browse the repository at this point in the history
  • Loading branch information
samstokes committed Mar 28, 2017
1 parent 6f4840c commit c4fded2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .vimrc
Expand Up @@ -244,10 +244,15 @@ map <Leader>ll :TlistToggle<CR>
" easy project grep
nmap <Leader>/ :grep
" use ack if available
call system('type ack >/dev/null 2>&1')
call system('git status >/dev/null 2>&1')
if !v:shell_error
set grepprg=ack
set grepprg=git\ grep\ -n
else
" use ack if available
call system('type ack >/dev/null 2>&1')
if !v:shell_error
set grepprg=ack
endif
endif

" include git branch in statusline via Fugitive
Expand Down

0 comments on commit c4fded2

Please sign in to comment.