2011-09-05 19:30:54 -04:00
|
|
|
" =============================================================================
|
2011-06-20 21:21:58 -04:00
|
|
|
" File: plugin/ctrlp.vim
|
2012-06-14 00:36:21 -04:00
|
|
|
" Description: Fuzzy file, buffer, mru, tag, etc finder.
|
2011-09-05 19:30:54 -04:00
|
|
|
" Author: Kien Nguyen <github.com/kien>
|
|
|
|
" =============================================================================
|
2011-10-07 10:10:14 -04:00
|
|
|
" GetLatestVimScripts: 3736 1 :AutoInstall: ctrlp.zip
|
2011-06-20 21:21:58 -04:00
|
|
|
|
2011-11-12 10:00:50 -05:00
|
|
|
if ( exists('g:loaded_ctrlp') && g:loaded_ctrlp ) || v:version < 700 || &cp
|
2011-08-21 22:14:00 -04:00
|
|
|
fini
|
2011-11-12 10:00:50 -05:00
|
|
|
en
|
2012-03-31 01:51:33 -04:00
|
|
|
let g:loaded_ctrlp = 1
|
|
|
|
|
2012-04-07 07:55:23 -04:00
|
|
|
let [g:ctrlp_lines, g:ctrlp_allfiles, g:ctrlp_alltags, g:ctrlp_alldirs,
|
|
|
|
\ g:ctrlp_allmixes, g:ctrlp_buftags, g:ctrlp_ext_vars, g:ctrlp_builtins]
|
|
|
|
\ = [[], [], [], [], {}, {}, [], 2]
|
2011-06-20 21:21:58 -04:00
|
|
|
|
2011-11-12 10:00:50 -05:00
|
|
|
if !exists('g:ctrlp_map') | let g:ctrlp_map = '<c-p>' | en
|
2011-12-17 21:58:44 -05:00
|
|
|
if !exists('g:ctrlp_cmd') | let g:ctrlp_cmd = 'CtrlP' | en
|
2011-06-20 21:21:58 -04:00
|
|
|
|
2012-07-21 10:35:26 -04:00
|
|
|
com! -n=? -com=dir CtrlP cal ctrlp#init(0, { 'dir': <q-args> })
|
|
|
|
com! -n=? -com=dir CtrlPMRUFiles cal ctrlp#init(2, { 'dir': <q-args> })
|
2011-10-07 10:10:14 -04:00
|
|
|
|
2012-06-19 11:49:09 -04:00
|
|
|
com! -bar CtrlPBuffer cal ctrlp#init(1)
|
|
|
|
com! -bar CtrlPLastMode cal ctrlp#init(-1)
|
2011-11-12 10:00:50 -05:00
|
|
|
|
2012-06-19 11:49:09 -04:00
|
|
|
com! -bar CtrlPClearCache cal ctrlp#clr()
|
|
|
|
com! -bar CtrlPClearAllCaches cal ctrlp#clra()
|
|
|
|
com! -bar CtrlPReload cal ctrlp#reset()
|
2012-04-03 07:55:50 -04:00
|
|
|
|
2012-06-19 11:49:09 -04:00
|
|
|
com! -bar ClearCtrlPCache cal ctrlp#clr()
|
|
|
|
com! -bar ClearAllCtrlPCaches cal ctrlp#clra()
|
|
|
|
com! -bar ResetCtrlP cal ctrlp#reset()
|
2012-03-03 13:53:34 -05:00
|
|
|
|
2012-07-21 10:35:26 -04:00
|
|
|
com! -bar CtrlPCurWD cal ctrlp#init(0, { 'mode': '' })
|
|
|
|
com! -bar CtrlPCurFile cal ctrlp#init(0, { 'mode': 'c' })
|
2012-09-03 12:09:25 -04:00
|
|
|
com! -bar CtrlPRoot cal ctrlp#init(0, { 'mode': 'r' })
|
2011-09-08 14:16:12 -04:00
|
|
|
|
2012-02-23 13:19:44 -05:00
|
|
|
if g:ctrlp_map != '' && !hasmapto(':<c-u>'.g:ctrlp_cmd.'<cr>', 'n')
|
2012-01-21 23:48:44 -05:00
|
|
|
exe 'nn <silent>' g:ctrlp_map ':<c-u>'.g:ctrlp_cmd.'<cr>'
|
|
|
|
en
|
2011-09-07 10:41:43 -04:00
|
|
|
|
2011-11-12 10:00:50 -05:00
|
|
|
cal ctrlp#mrufiles#init()
|
2011-09-18 07:33:37 -04:00
|
|
|
|
2012-07-21 10:35:26 -04:00
|
|
|
com! -bar CtrlPTag cal ctrlp#init(ctrlp#tag#id())
|
|
|
|
com! -bar CtrlPQuickfix cal ctrlp#init(ctrlp#quickfix#id())
|
|
|
|
|
2012-04-03 19:17:11 -04:00
|
|
|
com! -n=? -com=dir CtrlPDir
|
2012-07-21 10:35:26 -04:00
|
|
|
\ cal ctrlp#init(ctrlp#dir#id(), { 'dir': <q-args> })
|
|
|
|
|
2012-03-31 01:51:33 -04:00
|
|
|
com! -n=? -com=buffer CtrlPBufTag
|
|
|
|
\ cal ctrlp#init(ctrlp#buffertag#cmd(0, <q-args>))
|
2012-07-21 10:35:26 -04:00
|
|
|
|
|
|
|
com! -bar CtrlPBufTagAll cal ctrlp#init(ctrlp#buffertag#cmd(1))
|
|
|
|
com! -bar CtrlPRTS cal ctrlp#init(ctrlp#rtscript#id())
|
|
|
|
com! -bar CtrlPUndo cal ctrlp#init(ctrlp#undo#id())
|
|
|
|
com! -bar CtrlPLine cal ctrlp#init(ctrlp#line#id())
|
|
|
|
|
2012-03-31 01:51:33 -04:00
|
|
|
com! -n=? -com=buffer CtrlPChange
|
|
|
|
\ cal ctrlp#init(ctrlp#changes#cmd(0, <q-args>))
|
2012-07-21 10:35:26 -04:00
|
|
|
|
2012-06-19 11:49:09 -04:00
|
|
|
com! -bar CtrlPChangeAll cal ctrlp#init(ctrlp#changes#cmd(1))
|
|
|
|
com! -bar CtrlPMixed cal ctrlp#init(ctrlp#mixed#id())
|
|
|
|
com! -bar CtrlPBookmarkDir cal ctrlp#init(ctrlp#bookmarkdir#id())
|
2012-07-21 10:35:26 -04:00
|
|
|
|
2012-04-13 03:30:36 -04:00
|
|
|
com! -n=? -com=dir CtrlPBookmarkDirAdd
|
|
|
|
\ cal ctrlp#call('ctrlp#bookmarkdir#add', <q-args>)
|
2012-09-03 12:09:25 -04:00
|
|
|
|
|
|
|
" vim:ts=2:sw=2:sts=2
|