ctrlp.vim 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. " =============================================================================
  2. " File: plugin/ctrlp.vim
  3. " Description: Fuzzy file, buffer, mru, tag, etc finder.
  4. " Author: Kien Nguyen <github.com/kien>
  5. " =============================================================================
  6. " GetLatestVimScripts: 3736 1 :AutoInstall: ctrlp.zip
  7. if ( exists('g:loaded_ctrlp') && g:loaded_ctrlp ) || v:version < 700 || &cp
  8. fini
  9. en
  10. let g:loaded_ctrlp = 1
  11. let [g:ctrlp_lines, g:ctrlp_allfiles, g:ctrlp_alltags, g:ctrlp_alldirs,
  12. \ g:ctrlp_allmixes, g:ctrlp_buftags, g:ctrlp_ext_vars, g:ctrlp_builtins]
  13. \ = [[], [], [], [], {}, {}, [], 2]
  14. if !exists('g:ctrlp_map') | let g:ctrlp_map = '<c-p>' | en
  15. if !exists('g:ctrlp_cmd') | let g:ctrlp_cmd = 'CtrlP' | en
  16. com! -n=? -com=custom,ctrlp#utils#dircompl CtrlP
  17. \ cal ctrlp#init(0, { 'dir': <q-args> })
  18. com! -n=? -com=custom,ctrlp#utils#dircompl CtrlPMRUFiles
  19. \ cal ctrlp#init(2, { 'dir': <q-args> })
  20. com! -bar CtrlPBuffer cal ctrlp#init(1)
  21. com! -n=? CtrlPLastMode cal ctrlp#init(-1, { 'args': <q-args> })
  22. com! -bar CtrlPClearCache cal ctrlp#clr()
  23. com! -bar CtrlPClearAllCaches cal ctrlp#clra()
  24. com! -bar ClearCtrlPCache cal ctrlp#clr()
  25. com! -bar ClearAllCtrlPCaches cal ctrlp#clra()
  26. com! -bar CtrlPCurWD cal ctrlp#init(0, { 'mode': '' })
  27. com! -bar CtrlPCurFile cal ctrlp#init(0, { 'mode': 'c' })
  28. com! -bar CtrlPRoot cal ctrlp#init(0, { 'mode': 'r' })
  29. if g:ctrlp_map != '' && !hasmapto(':<c-u>'.g:ctrlp_cmd.'<cr>', 'n')
  30. exe 'nn <silent>' g:ctrlp_map ':<c-u>'.g:ctrlp_cmd.'<cr>'
  31. en
  32. cal ctrlp#mrufiles#init()
  33. com! -bar CtrlPTag cal ctrlp#init(ctrlp#tag#id())
  34. com! -bar CtrlPQuickfix cal ctrlp#init(ctrlp#quickfix#id())
  35. com! -n=? -com=custom,ctrlp#utils#dircompl CtrlPDir
  36. \ cal ctrlp#init(ctrlp#dir#id(), { 'dir': <q-args> })
  37. com! -n=? -com=buffer CtrlPBufTag
  38. \ cal ctrlp#init(ctrlp#buffertag#cmd(0, <q-args>))
  39. com! -bar CtrlPBufTagAll cal ctrlp#init(ctrlp#buffertag#cmd(1))
  40. com! -bar CtrlPRTS cal ctrlp#init(ctrlp#rtscript#id())
  41. com! -bar CtrlPUndo cal ctrlp#init(ctrlp#undo#id())
  42. com! -bar CtrlPLine cal ctrlp#init(ctrlp#line#id())
  43. com! -n=? -com=buffer CtrlPChange
  44. \ cal ctrlp#init(ctrlp#changes#cmd(0, <q-args>))
  45. com! -bar CtrlPChangeAll cal ctrlp#init(ctrlp#changes#cmd(1))
  46. com! -bar CtrlPMixed cal ctrlp#init(ctrlp#mixed#id())
  47. com! -bar CtrlPBookmarkDir cal ctrlp#init(ctrlp#bookmarkdir#id())
  48. com! -n=? -com=custom,ctrlp#utils#dircompl CtrlPBookmarkDirAdd
  49. \ cal ctrlp#call('ctrlp#bookmarkdir#add', <q-args>)
  50. " vim:ts=2:sw=2:sts=2