From 92d965158b31232d762bf3cb2313c7ff5883e1c5 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Fri, 31 Mar 2017 20:11:00 +0800 Subject: [PATCH] Fix #380 --- config/plugins/unite.vim | 58 ++++++++++++++-------------------------- 1 file changed, 20 insertions(+), 38 deletions(-) diff --git a/config/plugins/unite.vim b/config/plugins/unite.vim index bf1dbe37d..487ec380d 100644 --- a/config/plugins/unite.vim +++ b/config/plugins/unite.vim @@ -192,60 +192,42 @@ let g:unite_source_grep_max_candidates = get(g:, if executable('hw') " Use hw (highway) " https://github.com/tkengo/highway - let g:unite_source_grep_command = get(g:, 'unite_source_grep_command', 'hw') - let g:unite_source_grep_default_opts = get(g:, - \ 'unite_source_grep_default_opts', '--no-group --no-color') - let g:unite_source_grep_recursive_opt = get(g:, - \ 'unite_source_grep_recursive_opt', '') + let g:unite_source_grep_command = 'hw' + let g:unite_source_grep_default_opts = '--no-group --no-color' + let g:unite_source_grep_recursive_opt = '' elseif executable('ag') " Use ag (the silver searcher) " https://github.com/ggreer/the_silver_searcher - let g:unite_source_grep_command = get(g:, 'unite_source_grep_command', 'ag') - let g:unite_source_grep_default_opts = get(g:, - \ 'unite_source_grep_default_opts', - \ '-i --line-numbers --nocolor --nogroup --hidden --ignore ' . - \ '''.hg'' --ignore ''.svn'' --ignore ''.git'' --ignore ''.bzr''') - let g:unite_source_grep_recursive_opt = get(g:, - \ 'unite_source_grep_recursive_opt', '') + let g:unite_source_grep_command = 'ag' + let g:unite_source_grep_default_opts = '-i --line-numbers --nocolor --nogroup --hidden --ignore ' . + \ '''.hg'' --ignore ''.svn'' --ignore ''.git'' --ignore ''.bzr''' + let g:unite_source_grep_recursive_opt = '' elseif executable('pt') " Use pt (the platinum searcher) " https://github.com/monochromegane/the_platinum_searcher - let g:unite_source_grep_command = get(g:, 'unite_source_grep_command', 'pt') - let g:unite_source_grep_default_opts = get(g:, - \ 'unite_source_grep_default_opts', '--nogroup --nocolor') - let g:unite_source_grep_recursive_opt = get(g:, - \ 'unite_source_grep_recursive_opt', '') + let g:unite_source_grep_command = 'pt' + let g:unite_source_grep_default_opts = '--nogroup --nocolor' + let g:unite_source_grep_recursive_opt = '' elseif executable('ack-grep') " Use ack " http://beyondgrep.com/ - let g:unite_source_grep_command = get(g:, - \ 'unite_source_grep_command', 'ack-grep') - let g:unite_source_grep_default_opts = get(g:, - \ 'unite_source_grep_default_opts', - \ '-i --no-heading --no-color -k -H') - let g:unite_source_grep_recursive_opt = get(g:, - \ 'unite_source_grep_recursive_opt', '') + let g:unite_source_grep_command = 'ack-grep' + let g:unite_source_grep_default_opts = '-i --no-heading --no-color -k -H' + let g:unite_source_grep_recursive_opt = '' elseif executable('ack') - let g:unite_source_grep_command = get(g:, 'unite_source_grep_command', 'ack') - let g:unite_source_grep_default_opts = get(g:, - \ 'unite_source_grep_default_opts', '-i --no-heading --no-color -k -H') - let g:unite_source_grep_recursive_opt = get(g:, - \ 'unite_source_grep_recursive_opt', '') + let g:unite_source_grep_command = 'ack' + let g:unite_source_grep_default_opts = '-i --no-heading --no-color -k -H' + let g:unite_source_grep_recursive_opt = '' elseif executable('jvgrep') " Use jvgrep " https://github.com/mattn/jvgrep - let g:unite_source_grep_command = get(g:, - \ 'unite_source_grep_command', 'jvgrep') - let g:unite_source_grep_default_opts = get(g:, - \ 'unite_source_grep_default_opts', - \ '-i --exclude ''\.(git|svn|hg|bzr)''') - let g:unite_source_grep_recursive_opt = get(g:, - \ 'unite_source_grep_recursive_opt', '-R') + let g:unite_source_grep_command = 'jvgrep' + let g:unite_source_grep_default_opts = '-i --exclude ''\.(git|svn|hg|bzr)''' + let g:unite_source_grep_recursive_opt = '-R' elseif executable('beagrep') " Use beagrep " https://github.com/baohaojun/beagrep - let g:unite_source_grep_command = get(g:, - \ 'unite_source_grep_command', 'beagrep') + let g:unite_source_grep_command = 'beagrep' endif let g:unite_source_rec_async_command = get(g:, \ 'unite_source_rec_async_command',