ctrlp.vim 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. " =============================================================================
  2. " File: plugin/ctrlp.vim
  3. " Description: Fuzzy file, buffer, mru and tag 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=dir CtrlP cal ctrlp#init(0, <q-args>)
  17. com! CtrlPBuffer cal ctrlp#init(1)
  18. com! CtrlPMRUFiles cal ctrlp#init(2)
  19. com! CtrlPLastMode cal ctrlp#init(-1)
  20. com! CtrlPClearCache cal ctrlp#clr()
  21. com! CtrlPClearAllCaches cal ctrlp#clra()
  22. com! CtrlPReload cal ctrlp#reset()
  23. com! ClearCtrlPCache cal ctrlp#clr()
  24. com! ClearAllCtrlPCaches cal ctrlp#clra()
  25. com! ResetCtrlP cal ctrlp#reset()
  26. com! CtrlPCurWD cal ctrlp#init(0, 0)
  27. com! CtrlPCurFile cal ctrlp#init(0, 1)
  28. com! CtrlPRoot cal ctrlp#init(0, 2)
  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! CtrlPTag cal ctrlp#init(ctrlp#tag#id())
  34. com! CtrlPQuickfix cal ctrlp#init(ctrlp#quickfix#id())
  35. com! -n=? -com=dir CtrlPDir
  36. \ cal ctrlp#init(ctrlp#dir#id(), <q-args>)
  37. com! -n=? -com=buffer CtrlPBufTag
  38. \ cal ctrlp#init(ctrlp#buffertag#cmd(0, <q-args>))
  39. com! CtrlPBufTagAll cal ctrlp#init(ctrlp#buffertag#cmd(1))
  40. com! CtrlPRTS cal ctrlp#init(ctrlp#rtscript#id())
  41. com! CtrlPUndo cal ctrlp#init(ctrlp#undo#id())
  42. com! 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! CtrlPChangeAll cal ctrlp#init(ctrlp#changes#cmd(1))
  46. com! CtrlPMixed cal ctrlp#init(ctrlp#mixed#id())
  47. com! CtrlPBookmarkDir cal ctrlp#init(ctrlp#bookmarkdir#id())
  48. com! -n=? -com=dir CtrlPBookmarkDirAdd
  49. \ cal ctrlp#call('ctrlp#bookmarkdir#add', <q-args>)