2011-09-05 19:30:54 -04:00
|
|
|
" =============================================================================
|
2011-06-20 21:21:58 -04:00
|
|
|
" File: plugin/ctrlp.vim
|
2011-12-13 09:42:57 -05:00
|
|
|
" Description: Fuzzy file, buffer, mru and tag 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
|
2011-11-28 07:52:28 -05:00
|
|
|
let [g:loaded_ctrlp, g:ctrlp_lines, g:ctrlp_allfiles] = [1, [], []]
|
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-01-06 01:22:55 -05:00
|
|
|
com! -n=? -com=dir CtrlP cal ctrlp#init(0, <q-args>)
|
2011-10-07 10:10:14 -04:00
|
|
|
|
2011-11-12 10:00:50 -05:00
|
|
|
com! CtrlPBuffer cal ctrlp#init(1)
|
|
|
|
com! CtrlPMRUFiles cal ctrlp#init(2)
|
|
|
|
|
2011-12-17 21:58:44 -05:00
|
|
|
com! ClearCtrlPCache cal ctrlp#clr()
|
2011-11-12 10:00:50 -05:00
|
|
|
com! ClearAllCtrlPCaches cal ctrlp#clra()
|
2011-12-17 21:58:44 -05:00
|
|
|
com! ResetCtrlP cal ctrlp#reset()
|
2011-06-20 21:21:58 -04:00
|
|
|
|
2011-09-08 17:39:59 -04:00
|
|
|
com! CtrlPCurWD cal ctrlp#init(0, 0)
|
|
|
|
com! CtrlPCurFile cal ctrlp#init(0, 1)
|
|
|
|
com! CtrlPRoot cal ctrlp#init(0, 2)
|
2011-09-08 14:16:12 -04:00
|
|
|
|
2011-12-17 21:58:44 -05:00
|
|
|
exe 'nn <silent>' g:ctrlp_map ':<c-u>'.g:ctrlp_cmd.'<cr>'
|
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
|
|
|
|
2011-11-28 07:52:28 -05:00
|
|
|
if !exists('g:ctrlp_extensions') | fini | en
|
|
|
|
|
2012-01-06 01:22:55 -05:00
|
|
|
let s:ext = g:ctrlp_extensions
|
|
|
|
|
|
|
|
if index(s:ext, 'tag') >= 0
|
|
|
|
let g:ctrlp_alltags = []
|
|
|
|
com! CtrlPTag cal ctrlp#init(ctrlp#tag#id())
|
2011-11-28 07:52:28 -05:00
|
|
|
en
|
|
|
|
|
2012-01-06 01:22:55 -05:00
|
|
|
if index(s:ext, 'quickfix') >= 0
|
2011-11-28 07:52:28 -05:00
|
|
|
com! CtrlPQuickfix cal ctrlp#init(ctrlp#quickfix#id())
|
|
|
|
en
|
2011-11-30 04:42:19 -05:00
|
|
|
|
2012-01-06 01:22:55 -05:00
|
|
|
if index(s:ext, 'dir') >= 0
|
2011-12-22 04:24:27 -05:00
|
|
|
let g:ctrlp_alldirs = []
|
2012-01-06 01:22:55 -05:00
|
|
|
com! -n=? -com=dir CtrlPDir cal ctrlp#init(ctrlp#dir#id(), <q-args>)
|
2011-11-30 04:42:19 -05:00
|
|
|
en
|
2011-12-21 06:58:08 -05:00
|
|
|
|
2012-01-06 01:22:55 -05:00
|
|
|
if index(s:ext, 'buffertag') >= 0
|
2011-12-21 06:58:08 -05:00
|
|
|
let g:ctrlp_buftags = {}
|
2012-01-06 01:22:55 -05:00
|
|
|
com! -n=? -com=buffer CtrlPBufTag
|
|
|
|
\ cal ctrlp#init(ctrlp#buffertag#cmd(0, <q-args>))
|
|
|
|
com! CtrlPBufTagAll cal ctrlp#init(ctrlp#buffertag#cmd(1))
|
2011-12-21 06:58:08 -05:00
|
|
|
en
|
2012-01-06 01:22:55 -05:00
|
|
|
|
|
|
|
unl s:ext
|