mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 13:00:04 +08:00
parent
96248f8ba6
commit
4c4dd609b0
@ -272,7 +272,7 @@ function! zvim#util#UpdateHosts(...) abort
|
|||||||
echo 'successfully!'
|
echo 'successfully!'
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
fu! zvim#util#Generate_ignore(ignore,tool) abort
|
fu! zvim#util#Generate_ignore(ignore,tool, ...) abort
|
||||||
let ignore = []
|
let ignore = []
|
||||||
if a:tool ==# 'ag'
|
if a:tool ==# 'ag'
|
||||||
for ig in split(a:ignore,',')
|
for ig in split(a:ignore,',')
|
||||||
@ -282,7 +282,11 @@ fu! zvim#util#Generate_ignore(ignore,tool) abort
|
|||||||
elseif a:tool ==# 'rg'
|
elseif a:tool ==# 'rg'
|
||||||
for ig in split(a:ignore,',')
|
for ig in split(a:ignore,',')
|
||||||
call add(ignore, '-g')
|
call add(ignore, '-g')
|
||||||
call add(ignore, '!' . ig)
|
if a:0 > 0
|
||||||
|
call add(ignore, "'!" . ig . "'")
|
||||||
|
else
|
||||||
|
call add(ignore, '!' . ig)
|
||||||
|
endif
|
||||||
endfor
|
endfor
|
||||||
endif
|
endif
|
||||||
return ignore
|
return ignore
|
||||||
|
@ -18,7 +18,7 @@ let g:ctrlp_custom_ignore = get(g:, 'ctrlp_custom_ignore', {
|
|||||||
\ })
|
\ })
|
||||||
if executable('rg') && !exists('g:ctrlp_user_command')
|
if executable('rg') && !exists('g:ctrlp_user_command')
|
||||||
let g:ctrlp_user_command = 'rg %s --no-ignore --hidden --files -g "" '
|
let g:ctrlp_user_command = 'rg %s --no-ignore --hidden --files -g "" '
|
||||||
\ . join(zvim#util#Generate_ignore(g:spacevim_wildignore,'rg'))
|
\ . join(zvim#util#Generate_ignore(g:spacevim_wildignore,'rg', 1))
|
||||||
elseif executable('ag') && !exists('g:ctrlp_user_command')
|
elseif executable('ag') && !exists('g:ctrlp_user_command')
|
||||||
let g:ctrlp_user_command = 'ag %s --hidden -i -g "" ' . join(zvim#util#Generate_ignore(g:spacevim_wildignore,'ag'))
|
let g:ctrlp_user_command = 'ag %s --hidden -i -g "" ' . join(zvim#util#Generate_ignore(g:spacevim_wildignore,'ag'))
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user