Mercurial > public > dotfiles
comparison vim/vimfiles/bundle/ctrlp.vim/autoload/ctrlp/rtscript.vim @ 7:86e0ac713642
Re-added the latest ctrlp.vim plugin.
The ctrlp.vim commit was e61e7d5b801ade5fcefeab3aca75c1f37d54bdf1.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 29 Apr 2012 16:20:31 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
6:ff60fbc930de | 7:86e0ac713642 |
---|---|
1 " ============================================================================= | |
2 " File: autoload/ctrlp/rtscript.vim | |
3 " Description: Runtime scripts extension | |
4 " Author: Kien Nguyen <github.com/kien> | |
5 " ============================================================================= | |
6 | |
7 " Init {{{1 | |
8 if exists('g:loaded_ctrlp_rtscript') && g:loaded_ctrlp_rtscript | |
9 fini | |
10 en | |
11 let [g:loaded_ctrlp_rtscript, g:ctrlp_newrts] = [1, 0] | |
12 | |
13 cal add(g:ctrlp_ext_vars, { | |
14 \ 'init': 'ctrlp#rtscript#init()', | |
15 \ 'accept': 'ctrlp#acceptfile', | |
16 \ 'lname': 'runtime scripts', | |
17 \ 'sname': 'rts', | |
18 \ 'type': 'path', | |
19 \ 'opmul': 1, | |
20 \ }) | |
21 | |
22 let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars) | |
23 " Public {{{1 | |
24 fu! ctrlp#rtscript#init() | |
25 if g:ctrlp_newrts | |
26 \ || !( exists('g:ctrlp_rtscache') && g:ctrlp_rtscache[0] == &rtp ) | |
27 sil! cal ctrlp#progress('Indexing...') | |
28 let entries = split(globpath(&rtp, '**/*.*'), "\n") | |
29 cal filter(entries, 'count(entries, v:val) == 1') | |
30 let [entries, echoed] = [ctrlp#dirnfile(entries)[1], 1] | |
31 el | |
32 let [entries, results] = g:ctrlp_rtscache[2:3] | |
33 en | |
34 let cwd = getcwd() | |
35 if g:ctrlp_newrts | |
36 \ || !( exists('g:ctrlp_rtscache') && g:ctrlp_rtscache[:1] == [&rtp, cwd] ) | |
37 if !exists('echoed') | sil! cal ctrlp#progress('Processing...') | en | |
38 let results = map(copy(entries), 'fnamemodify(v:val, '':.'')') | |
39 en | |
40 let [g:ctrlp_rtscache, g:ctrlp_newrts] = [[&rtp, cwd, entries, results], 0] | |
41 retu results | |
42 endf | |
43 | |
44 fu! ctrlp#rtscript#id() | |
45 retu s:id | |
46 endf | |
47 "}}} | |
48 | |
49 " vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 |