找到“包括隐藏文件”的答案。
在下面的示例中,我使用的是 fdfind。随意使用任何你想要的东西!
command! -nargs=? -complete=dir AF
\ call fzf#run(fzf#wrap(fzf#vim#with_preview({
\ 'source': 'fdfind --type f --hidden --follow --exclude .git --no-ignore . '.expand(<q-args>)
\ })))
上面的代码你会做得很好,但如果你正在寻找更丰富的配置添加,你可以去:
" Terminal buffer options for fzf
autocmd! FileType fzf
autocmd FileType fzf set noshowmode noruler nonu
" nnoremap <silent> <Leader><Leader> :Files<CR>
nnoremap <silent> <expr> <Leader><Leader> (expand('%') =~ 'NERD_tree' ? "\<c-w>\<c-w>" : '').":Files\<cr>"
nnoremap <silent> <Leader>C :Colors<CR>
nnoremap <silent> <Leader><Enter> :Buffers<CR>
nnoremap <silent> <Leader>L :Lines<CR>
nnoremap <silent> <Leader>ag :Ag <C-R><C-W><CR>
nnoremap <silent> <Leader>AG :Ag <C-R><C-A><CR>
xnoremap <silent> <Leader>ag y:Ag <C-R>"<CR>
nnoremap <silent> <Leader>` :Marks<CR>
" nnoremap <silent> q: :History:<CR>
" nnoremap <silent> q/ :History/<CR>
" inoremap <expr> <c-x><c-t> fzf#complete('tmuxwords.rb --all-but-current --scroll 500 --min 5')
imap <c-x><c-k> <plug>(fzf-complete-word)
imap <c-x><c-f> <plug>(fzf-complete-path)
inoremap <expr> <c-x><c-d> fzf#vim#complete#path('blsd')
imap <c-x><c-j> <plug>(fzf-complete-file-ag)
imap <c-x><c-l> <plug>(fzf-complete-line)
function! s:plug_help_sink(line)
let dir = g:plugs[a:line].dir
for pat in ['doc/*.txt', 'README.md']
let match = get(split(globpath(dir, pat), "\n"), 0, '')
if len(match)
execute 'tabedit' match
return
endif
endfor
tabnew
execute 'Explore' dir
endfunction
command! PlugHelp call fzf#run(fzf#wrap({
\ 'source': sort(keys(g:plugs)),
\ 'sink': function('s:plug_help_sink')}))
function! RipgrepFzf(query, fullscreen)
let command_fmt = 'rg --column --line-number --no-heading --color=always --smart-case %s || true'
let initial_command = printf(command_fmt, shellescape(a:query))
let reload_command = printf(command_fmt, '{q}')
let options = {'options': ['--phony', '--query', a:query, '--bind', 'change:reload:'.reload_command]}
if a:fullscreen
let options = fzf#vim#with_preview(options)
endif
call fzf#vim#grep(initial_command, 1, options, a:fullscreen)
endfunction
command! -nargs=* -bang RG call RipgrepFzf(<q-args>, <bang>0)