filebrowser.vim 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. " Dirvish file browser.
  2. " Use relative paths if there is no `conceal` ability.
  3. let g:dirvish_relative_paths = (v:version <= 703 ? 1 : 0)
  4. augroup dirvishCustomisation
  5. autocmd!
  6. " Allow fugitive.vim commands in dirvish buffers.
  7. autocmd FileType dirvish call fugitive#detect(@%)
  8. " Use 'o' to (o)pen and 'i' to spl(i)t.
  9. autocmd FileType dirvish let s:nowait = (v:version > 703 ? '<nowait>' : '')
  10. \| execute 'nnoremap '.s:nowait.'<buffer><silent> o :<C-U>.call dirvish#open("edit", 0)<CR>'
  11. \| execute 'nnoremap '.s:nowait.'<buffer><silent> i :<C-U>.call dirvish#open("split", 1)<CR>'
  12. \| execute 'xnoremap '.s:nowait.'<buffer><silent> O :call dirvish#open("edit", 0)<CR>'
  13. \| execute 'xnoremap '.s:nowait.'<buffer><silent> I :call dirvish#open("split", 1)<CR>'
  14. augroup END
  15. " CtrlP - Fuzzy Finder in Vimscript
  16. "let g:ctrlp_map = '<Leader>p'
  17. " Use `ag` as fallback if available.
  18. if executable('ag')
  19. let s:fallback = 'ag %s -l --nocolor -g ""'
  20. else
  21. let s:fallback = 'find %s -type f'
  22. endif
  23. let g:ctrlp_user_command = [
  24. \ '.git',
  25. \ 'cd %s && git ls-files . -co --exclude-standard',
  26. \ s:fallback
  27. \]
  28. let g:ctrlp_extensions = ['funky']
  29. " Function definition jumping with CtrlP's Funky plugin.
  30. map <silent> <Leader>f :CtrlPFunky<CR>
  31. " FZF - Fuzzy Finder in Go/Ruby
  32. map <silent> <Leader>p :FZF<CR>