utils 0.0.67 → 0.0.68
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/bin/edit +3 -1
- data/lib/utils/editor.rb +14 -0
- data/lib/utils/version.rb +1 -1
- data/utils.gemspec +3 -3
- metadata +3 -74
- data/lib/utils/config/vim/after/syntax/haml.vim +0 -9
- data/lib/utils/config/vim/after/syntax/html.vim +0 -11
- data/lib/utils/config/vim/autoload/Align.vim +0 -1029
- data/lib/utils/config/vim/autoload/AlignMaps.vim +0 -330
- data/lib/utils/config/vim/autoload/ctrlp/bookmarkdir.vim +0 -139
- data/lib/utils/config/vim/autoload/ctrlp/buffertag.vim +0 -238
- data/lib/utils/config/vim/autoload/ctrlp/changes.vim +0 -96
- data/lib/utils/config/vim/autoload/ctrlp/dir.vim +0 -90
- data/lib/utils/config/vim/autoload/ctrlp/line.vim +0 -63
- data/lib/utils/config/vim/autoload/ctrlp/mixed.vim +0 -83
- data/lib/utils/config/vim/autoload/ctrlp/mrufiles.vim +0 -119
- data/lib/utils/config/vim/autoload/ctrlp/quickfix.vim +0 -62
- data/lib/utils/config/vim/autoload/ctrlp/rtscript.vim +0 -49
- data/lib/utils/config/vim/autoload/ctrlp/tag.vim +0 -112
- data/lib/utils/config/vim/autoload/ctrlp/undo.vim +0 -154
- data/lib/utils/config/vim/autoload/ctrlp/utils.vim +0 -72
- data/lib/utils/config/vim/autoload/ctrlp.vim +0 -1772
- data/lib/utils/config/vim/autoload/rails.vim +0 -4570
- data/lib/utils/config/vim/autoload/rubycomplete.vim +0 -801
- data/lib/utils/config/vim/autoload/sqlcomplete.vim +0 -741
- data/lib/utils/config/vim/autoload/vimball.vim +0 -750
- data/lib/utils/config/vim/colors/flori.vim +0 -116
- data/lib/utils/config/vim/compiler/coffee.vim +0 -68
- data/lib/utils/config/vim/compiler/eruby.vim +0 -40
- data/lib/utils/config/vim/compiler/ruby.vim +0 -67
- data/lib/utils/config/vim/compiler/rubyunit.vim +0 -34
- data/lib/utils/config/vim/doc/Decho.txt +0 -372
- data/lib/utils/config/vim/doc/coffee-script.txt +0 -116
- data/lib/utils/config/vim/doc/ctrlp.txt +0 -1113
- data/lib/utils/config/vim/doc/fugitive.txt +0 -257
- data/lib/utils/config/vim/doc/rails.txt +0 -1022
- data/lib/utils/config/vim/doc/xml-plugin.txt +0 -226
- data/lib/utils/config/vim/ftdetect/coffee.vim +0 -8
- data/lib/utils/config/vim/ftdetect/eco.vim +0 -1
- data/lib/utils/config/vim/ftdetect/ragel.vim +0 -2
- data/lib/utils/config/vim/ftdetect/ruby.vim +0 -17
- data/lib/utils/config/vim/ftdetect/slim.vim +0 -2
- data/lib/utils/config/vim/ftplugin/coffee.vim +0 -221
- data/lib/utils/config/vim/ftplugin/eruby.vim +0 -100
- data/lib/utils/config/vim/ftplugin/ruby.vim +0 -260
- data/lib/utils/config/vim/ftplugin/xml.vim +0 -941
- data/lib/utils/config/vim/indent/IndentAnything_html.vim +0 -35
- data/lib/utils/config/vim/indent/coffee.vim +0 -338
- data/lib/utils/config/vim/indent/eruby.vim +0 -77
- data/lib/utils/config/vim/indent/javascript.vim +0 -116
- data/lib/utils/config/vim/indent/ruby.vim +0 -377
- data/lib/utils/config/vim/indent/slim.vim +0 -75
- data/lib/utils/config/vim/plugin/AlignMapsPlugin.vim +0 -242
- data/lib/utils/config/vim/plugin/AlignPlugin.vim +0 -41
- data/lib/utils/config/vim/plugin/Decho.vim +0 -592
- data/lib/utils/config/vim/plugin/IndentAnything.vim +0 -675
- data/lib/utils/config/vim/plugin/bufexplorer.vim +0 -1144
- data/lib/utils/config/vim/plugin/cecutil.vim +0 -508
- data/lib/utils/config/vim/plugin/ctrlp.vim +0 -61
- data/lib/utils/config/vim/plugin/fugitive.vim +0 -2041
- data/lib/utils/config/vim/plugin/lusty-explorer.vim +0 -1509
- data/lib/utils/config/vim/plugin/rails.vim +0 -339
- data/lib/utils/config/vim/plugin/rubyextra.vim +0 -193
- data/lib/utils/config/vim/plugin/surround.vim +0 -628
- data/lib/utils/config/vim/plugin/taglist.vim +0 -4546
- data/lib/utils/config/vim/plugin/test/IndentAnything/test.js +0 -131
- data/lib/utils/config/vim/plugin/vimballPlugin.vim +0 -40
- data/lib/utils/config/vim/syntax/Decho.vim +0 -101
- data/lib/utils/config/vim/syntax/coffee.vim +0 -217
- data/lib/utils/config/vim/syntax/eco.vim +0 -62
- data/lib/utils/config/vim/syntax/eruby.vim +0 -73
- data/lib/utils/config/vim/syntax/javascript.vim +0 -246
- data/lib/utils/config/vim/syntax/ragel.vim +0 -165
- data/lib/utils/config/vim/syntax/ruby.vim +0 -367
- data/lib/utils/config/vim/syntax/slim.vim +0 -117
- data/lib/utils/config/vimrc +0 -540
@@ -1,96 +0,0 @@
|
|
1
|
-
" =============================================================================
|
2
|
-
" File: autoload/ctrlp/changes.vim
|
3
|
-
" Description: Change list extension
|
4
|
-
" Author: Kien Nguyen <github.com/kien>
|
5
|
-
" =============================================================================
|
6
|
-
|
7
|
-
" Init {{{1
|
8
|
-
if exists('g:loaded_ctrlp_changes') && g:loaded_ctrlp_changes
|
9
|
-
fini
|
10
|
-
en
|
11
|
-
let g:loaded_ctrlp_changes = 1
|
12
|
-
|
13
|
-
cal add(g:ctrlp_ext_vars, {
|
14
|
-
\ 'init': 'ctrlp#changes#init(s:bufnr, s:crbufnr)',
|
15
|
-
\ 'accept': 'ctrlp#changes#accept',
|
16
|
-
\ 'lname': 'changes',
|
17
|
-
\ 'sname': 'chs',
|
18
|
-
\ 'exit': 'ctrlp#changes#exit()',
|
19
|
-
\ 'type': 'tabe',
|
20
|
-
\ 'sort': 0,
|
21
|
-
\ 'nolim': 1,
|
22
|
-
\ })
|
23
|
-
|
24
|
-
let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
|
25
|
-
" Utilities {{{1
|
26
|
-
fu! s:changelist(bufnr)
|
27
|
-
sil! exe 'noa hid b' a:bufnr
|
28
|
-
redi => result
|
29
|
-
sil! changes
|
30
|
-
redi END
|
31
|
-
retu map(split(result, "\n")[1:], 'tr(v:val, " ", " ")')
|
32
|
-
endf
|
33
|
-
|
34
|
-
fu! s:process(clines, ...)
|
35
|
-
let [clines, evas] = [[], []]
|
36
|
-
for each in a:clines
|
37
|
-
let parts = matchlist(each, '\v^.\s*\d+\s+(\d+)\s+(\d+)\s(.*)$')
|
38
|
-
if !empty(parts)
|
39
|
-
if parts[3] == '' | let parts[3] = ' ' | en
|
40
|
-
cal add(clines, parts[3].' |'.a:1.':'.a:2.'|'.parts[1].':'.parts[2].'|')
|
41
|
-
en
|
42
|
-
endfo
|
43
|
-
retu reverse(filter(clines, 'count(clines, v:val) == 1'))
|
44
|
-
endf
|
45
|
-
|
46
|
-
fu! s:syntax()
|
47
|
-
if !ctrlp#nosy()
|
48
|
-
cal ctrlp#hicheck('CtrlPBufName', 'Directory')
|
49
|
-
cal ctrlp#hicheck('CtrlPTabExtra', 'Comment')
|
50
|
-
sy match CtrlPBufName '\t|\d\+:\zs[^|]\+\ze|\d\+:\d\+|$'
|
51
|
-
sy match CtrlPTabExtra '\zs\t.*\ze$' contains=CtrlPBufName
|
52
|
-
en
|
53
|
-
endf
|
54
|
-
" Public {{{1
|
55
|
-
fu! ctrlp#changes#init(original_bufnr, bufnr)
|
56
|
-
let bufnr = exists('s:bufnr') ? s:bufnr : a:bufnr
|
57
|
-
let bufs = exists('s:clmode') && s:clmode ? ctrlp#buffers('id') : [bufnr]
|
58
|
-
cal filter(bufs, 'v:val > 0')
|
59
|
-
let [swb, &swb] = [&swb, '']
|
60
|
-
let lines = []
|
61
|
-
for each in bufs
|
62
|
-
let fnamet = fnamemodify(bufname(each), ':t')
|
63
|
-
cal extend(lines, s:process(s:changelist(each), each, fnamet))
|
64
|
-
endfo
|
65
|
-
sil! exe 'noa hid b' a:original_bufnr
|
66
|
-
let &swb = swb
|
67
|
-
cal ctrlp#syntax()
|
68
|
-
cal s:syntax()
|
69
|
-
retu lines
|
70
|
-
endf
|
71
|
-
|
72
|
-
fu! ctrlp#changes#accept(mode, str)
|
73
|
-
let info = matchlist(a:str, '\t|\(\d\+\):[^|]\+|\(\d\+\):\(\d\+\)|$')
|
74
|
-
if info == [] | retu | en
|
75
|
-
let bufnr = str2nr(get(info, 1))
|
76
|
-
if bufnr
|
77
|
-
cal ctrlp#acceptfile(a:mode, fnamemodify(bufname(bufnr), ':p'))
|
78
|
-
cal cursor(get(info, 2), get(info, 3))
|
79
|
-
sil! norm! zvzz
|
80
|
-
en
|
81
|
-
endf
|
82
|
-
|
83
|
-
fu! ctrlp#changes#cmd(mode, ...)
|
84
|
-
let s:clmode = a:mode
|
85
|
-
if a:0 && !empty(a:1)
|
86
|
-
let s:bufnr = bufnr('^'.fnamemodify(a:1, ':p').'$')
|
87
|
-
en
|
88
|
-
retu s:id
|
89
|
-
endf
|
90
|
-
|
91
|
-
fu! ctrlp#changes#exit()
|
92
|
-
unl! s:clmode s:bufnr
|
93
|
-
endf
|
94
|
-
"}}}
|
95
|
-
|
96
|
-
" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2
|
@@ -1,90 +0,0 @@
|
|
1
|
-
" =============================================================================
|
2
|
-
" File: autoload/ctrlp/dir.vim
|
3
|
-
" Description: Directory extension
|
4
|
-
" Author: Kien Nguyen <github.com/kien>
|
5
|
-
" =============================================================================
|
6
|
-
|
7
|
-
" Init {{{1
|
8
|
-
if exists('g:loaded_ctrlp_dir') && g:loaded_ctrlp_dir
|
9
|
-
fini
|
10
|
-
en
|
11
|
-
let [g:loaded_ctrlp_dir, g:ctrlp_newdir] = [1, 0]
|
12
|
-
|
13
|
-
let s:ars = [
|
14
|
-
\ 's:maxdepth',
|
15
|
-
\ 's:maxfiles',
|
16
|
-
\ 's:compare_lim',
|
17
|
-
\ 's:glob',
|
18
|
-
\ ]
|
19
|
-
|
20
|
-
cal add(g:ctrlp_ext_vars, {
|
21
|
-
\ 'init': 'ctrlp#dir#init('.join(s:ars, ', ').')',
|
22
|
-
\ 'accept': 'ctrlp#dir#accept',
|
23
|
-
\ 'lname': 'dirs',
|
24
|
-
\ 'sname': 'dir',
|
25
|
-
\ 'type': 'path',
|
26
|
-
\ 'specinput': 1,
|
27
|
-
\ })
|
28
|
-
|
29
|
-
let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
|
30
|
-
" Utilities {{{1
|
31
|
-
fu! s:globdirs(dirs, depth)
|
32
|
-
let entries = split(globpath(a:dirs, s:glob), "\n")
|
33
|
-
let [dirs, depth] = [ctrlp#dirnfile(entries)[0], a:depth + 1]
|
34
|
-
cal extend(g:ctrlp_alldirs, dirs)
|
35
|
-
let nr = len(g:ctrlp_alldirs)
|
36
|
-
if !empty(dirs) && !s:max(nr, s:maxfiles) && depth <= s:maxdepth
|
37
|
-
sil! cal ctrlp#progress(nr)
|
38
|
-
cal s:globdirs(join(dirs, ','), depth)
|
39
|
-
en
|
40
|
-
endf
|
41
|
-
|
42
|
-
fu! s:max(len, max)
|
43
|
-
retu a:max && a:len > a:max ? 1 : 0
|
44
|
-
endf
|
45
|
-
" Public {{{1
|
46
|
-
fu! ctrlp#dir#init(...)
|
47
|
-
let s:cwd = getcwd()
|
48
|
-
for each in range(len(s:ars))
|
49
|
-
let {s:ars[each]} = a:{each + 1}
|
50
|
-
endfo
|
51
|
-
let cadir = ctrlp#utils#cachedir().ctrlp#utils#lash().'dir'
|
52
|
-
let cafile = cadir.ctrlp#utils#lash().ctrlp#utils#cachefile('dir')
|
53
|
-
if g:ctrlp_newdir || !filereadable(cafile)
|
54
|
-
let [s:initcwd, g:ctrlp_alldirs] = [s:cwd, []]
|
55
|
-
cal s:globdirs(s:cwd, 0)
|
56
|
-
cal ctrlp#rmbasedir(g:ctrlp_alldirs)
|
57
|
-
if len(g:ctrlp_alldirs) <= s:compare_lim
|
58
|
-
cal sort(g:ctrlp_alldirs, 'ctrlp#complen')
|
59
|
-
en
|
60
|
-
cal ctrlp#utils#writecache(g:ctrlp_alldirs, cadir, cafile)
|
61
|
-
let g:ctrlp_newdir = 0
|
62
|
-
el
|
63
|
-
if !( exists('s:initcwd') && s:initcwd == s:cwd )
|
64
|
-
let s:initcwd = s:cwd
|
65
|
-
let g:ctrlp_alldirs = ctrlp#utils#readfile(cafile)
|
66
|
-
en
|
67
|
-
en
|
68
|
-
retu g:ctrlp_alldirs
|
69
|
-
endf
|
70
|
-
|
71
|
-
fu! ctrlp#dir#accept(mode, str)
|
72
|
-
let path = a:mode == 'h' ? getcwd() : s:cwd.ctrlp#utils#lash().a:str
|
73
|
-
if a:mode =~ 't\|v\|h'
|
74
|
-
cal ctrlp#exit()
|
75
|
-
en
|
76
|
-
cal ctrlp#setdir(path, a:mode =~ 't\|h' ? 'chd!' : 'lc!')
|
77
|
-
if a:mode == 'e'
|
78
|
-
sil! cal ctrlp#statusline()
|
79
|
-
cal ctrlp#setlines(s:id)
|
80
|
-
cal ctrlp#recordhist()
|
81
|
-
cal ctrlp#prtclear()
|
82
|
-
en
|
83
|
-
endf
|
84
|
-
|
85
|
-
fu! ctrlp#dir#id()
|
86
|
-
retu s:id
|
87
|
-
endf
|
88
|
-
"}}}
|
89
|
-
|
90
|
-
" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2
|
@@ -1,63 +0,0 @@
|
|
1
|
-
" =============================================================================
|
2
|
-
" File: autoload/ctrlp/line.vim
|
3
|
-
" Description: Line extension
|
4
|
-
" Author: Kien Nguyen <github.com/kien>
|
5
|
-
" =============================================================================
|
6
|
-
|
7
|
-
" Init {{{1
|
8
|
-
if exists('g:loaded_ctrlp_line') && g:loaded_ctrlp_line
|
9
|
-
fini
|
10
|
-
en
|
11
|
-
let g:loaded_ctrlp_line = 1
|
12
|
-
|
13
|
-
cal add(g:ctrlp_ext_vars, {
|
14
|
-
\ 'init': 'ctrlp#line#init()',
|
15
|
-
\ 'accept': 'ctrlp#line#accept',
|
16
|
-
\ 'lname': 'lines',
|
17
|
-
\ 'sname': 'lns',
|
18
|
-
\ 'type': 'tabe',
|
19
|
-
\ })
|
20
|
-
|
21
|
-
let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
|
22
|
-
" Utilities {{{1
|
23
|
-
fu! s:syntax()
|
24
|
-
if !ctrlp#nosy()
|
25
|
-
cal ctrlp#hicheck('CtrlPBufName', 'Directory')
|
26
|
-
cal ctrlp#hicheck('CtrlPTabExtra', 'Comment')
|
27
|
-
sy match CtrlPBufName '\t|\zs[^|]\+\ze|\d\+:\d\+|$'
|
28
|
-
sy match CtrlPTabExtra '\zs\t.*\ze$' contains=CtrlPBufName
|
29
|
-
en
|
30
|
-
endf
|
31
|
-
" Public {{{1
|
32
|
-
fu! ctrlp#line#init()
|
33
|
-
let [bufs, lines] = [ctrlp#buffers('id'), []]
|
34
|
-
for bufnr in bufs
|
35
|
-
let [lfb, bufn] = [getbufline(bufnr, 1, '$'), bufname(bufnr)]
|
36
|
-
let lfb = lfb == [] ? ctrlp#utils#readfile(fnamemodify(bufn, ':p')) : lfb
|
37
|
-
cal map(lfb, 'tr(v:val, '' '', '' '')')
|
38
|
-
let [linenr, len_lfb, buft] = [1, len(lfb), fnamemodify(bufn, ':t')]
|
39
|
-
wh linenr <= len_lfb
|
40
|
-
let lfb[linenr - 1] .= ' |'.buft.'|'.bufnr.':'.linenr.'|'
|
41
|
-
let linenr += 1
|
42
|
-
endw
|
43
|
-
cal extend(lines, filter(lfb, 'v:val !~ ''^\s*\t|[^|]\+|\d\+:\d\+|$'''))
|
44
|
-
endfo
|
45
|
-
cal s:syntax()
|
46
|
-
retu lines
|
47
|
-
endf
|
48
|
-
|
49
|
-
fu! ctrlp#line#accept(mode, str)
|
50
|
-
let info = matchlist(a:str, '\t|[^|]\+|\(\d\+\):\(\d\+\)|$')
|
51
|
-
if info == [] | retu | en
|
52
|
-
let [bufnr, linenr] = [str2nr(get(info, 1)), get(info, 2)]
|
53
|
-
if bufnr > 0
|
54
|
-
cal ctrlp#acceptfile(a:mode, fnamemodify(bufname(bufnr), ':p'), linenr)
|
55
|
-
en
|
56
|
-
endf
|
57
|
-
|
58
|
-
fu! ctrlp#line#id()
|
59
|
-
retu s:id
|
60
|
-
endf
|
61
|
-
"}}}
|
62
|
-
|
63
|
-
" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2
|
@@ -1,83 +0,0 @@
|
|
1
|
-
" =============================================================================
|
2
|
-
" File: autoload/ctrlp/mixed.vim
|
3
|
-
" Description: Mixing Files + MRU + Buffers
|
4
|
-
" Author: Kien Nguyen <github.com/kien>
|
5
|
-
" =============================================================================
|
6
|
-
|
7
|
-
" Init {{{1
|
8
|
-
if exists('g:loaded_ctrlp_mixed') && g:loaded_ctrlp_mixed
|
9
|
-
fini
|
10
|
-
en
|
11
|
-
let [g:loaded_ctrlp_mixed, g:ctrlp_newmix] = [1, 0]
|
12
|
-
|
13
|
-
cal add(g:ctrlp_ext_vars, {
|
14
|
-
\ 'init': 'ctrlp#mixed#init(s:compare_lim)',
|
15
|
-
\ 'accept': 'ctrlp#acceptfile',
|
16
|
-
\ 'lname': 'fil + mru + buf',
|
17
|
-
\ 'sname': 'mix',
|
18
|
-
\ 'type': 'path',
|
19
|
-
\ 'opmul': 1,
|
20
|
-
\ 'specinput': 1,
|
21
|
-
\ })
|
22
|
-
|
23
|
-
let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
|
24
|
-
" Utilities {{{1
|
25
|
-
fu! s:newcache(cwd)
|
26
|
-
if g:ctrlp_newmix || !has_key(g:ctrlp_allmixes, 'data') | retu 1 | en
|
27
|
-
retu g:ctrlp_allmixes['cwd'] != a:cwd
|
28
|
-
\ || g:ctrlp_allmixes['filtime'] < getftime(ctrlp#utils#cachefile())
|
29
|
-
\ || g:ctrlp_allmixes['mrutime'] < getftime(ctrlp#mrufiles#cachefile())
|
30
|
-
\ || g:ctrlp_allmixes['bufs'] < len(ctrlp#mrufiles#bufs())
|
31
|
-
endf
|
32
|
-
|
33
|
-
fu! s:getnewmix(cwd, clim)
|
34
|
-
if g:ctrlp_newmix
|
35
|
-
cal ctrlp#mrufiles#refresh('raw')
|
36
|
-
let g:ctrlp_newcache = 1
|
37
|
-
en
|
38
|
-
let g:ctrlp_lines = copy(ctrlp#files())
|
39
|
-
cal ctrlp#progress('Mixing...')
|
40
|
-
let mrufs = copy(ctrlp#mrufiles#list('raw'))
|
41
|
-
if exists('+ssl') && &ssl
|
42
|
-
cal map(mrufs, 'tr(v:val, "\\", "/")')
|
43
|
-
en
|
44
|
-
let bufs = map(ctrlp#buffers('id'), 'fnamemodify(bufname(v:val), ":p")')
|
45
|
-
let mrufs = bufs + filter(mrufs, 'index(bufs, v:val) < 0')
|
46
|
-
if len(mrufs) > len(g:ctrlp_lines)
|
47
|
-
cal filter(mrufs, 'stridx(v:val, a:cwd)')
|
48
|
-
el
|
49
|
-
let cwd_mrufs = filter(copy(mrufs), '!stridx(v:val, a:cwd)')
|
50
|
-
let cwd_mrufs = ctrlp#rmbasedir(cwd_mrufs)
|
51
|
-
for each in cwd_mrufs
|
52
|
-
let id = index(g:ctrlp_lines, each)
|
53
|
-
if id >= 0 | cal remove(g:ctrlp_lines, id) | en
|
54
|
-
endfo
|
55
|
-
en
|
56
|
-
cal map(mrufs, 'fnamemodify(v:val, ":.")')
|
57
|
-
let g:ctrlp_lines = len(mrufs) > len(g:ctrlp_lines)
|
58
|
-
\ ? g:ctrlp_lines + mrufs : mrufs + g:ctrlp_lines
|
59
|
-
if len(g:ctrlp_lines) <= a:clim
|
60
|
-
cal sort(g:ctrlp_lines, 'ctrlp#complen')
|
61
|
-
en
|
62
|
-
let g:ctrlp_allmixes = { 'filtime': getftime(ctrlp#utils#cachefile()),
|
63
|
-
\ 'mrutime': getftime(ctrlp#mrufiles#cachefile()), 'cwd': a:cwd,
|
64
|
-
\ 'bufs': len(ctrlp#mrufiles#bufs()), 'data': g:ctrlp_lines }
|
65
|
-
endf
|
66
|
-
" Public {{{1
|
67
|
-
fu! ctrlp#mixed#init(clim)
|
68
|
-
let cwd = getcwd()
|
69
|
-
if s:newcache(cwd)
|
70
|
-
cal s:getnewmix(cwd, a:clim)
|
71
|
-
el
|
72
|
-
let g:ctrlp_lines = g:ctrlp_allmixes['data']
|
73
|
-
en
|
74
|
-
let g:ctrlp_newmix = 0
|
75
|
-
retu g:ctrlp_lines
|
76
|
-
endf
|
77
|
-
|
78
|
-
fu! ctrlp#mixed#id()
|
79
|
-
retu s:id
|
80
|
-
endf
|
81
|
-
"}}}
|
82
|
-
|
83
|
-
" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2
|
@@ -1,119 +0,0 @@
|
|
1
|
-
" =============================================================================
|
2
|
-
" File: autoload/ctrlp/mrufiles.vim
|
3
|
-
" Description: Most Recently Used Files extension
|
4
|
-
" Author: Kien Nguyen <github.com/kien>
|
5
|
-
" =============================================================================
|
6
|
-
|
7
|
-
" Static variables {{{1
|
8
|
-
let [s:mrbs, s:mrufs] = [[], []]
|
9
|
-
|
10
|
-
fu! ctrlp#mrufiles#opts()
|
11
|
-
let [pref, opts] = ['g:ctrlp_mruf_', {
|
12
|
-
\ 'max': ['s:max', 250],
|
13
|
-
\ 'include': ['s:in', ''],
|
14
|
-
\ 'exclude': ['s:ex', ''],
|
15
|
-
\ 'case_sensitive': ['s:cseno', 1],
|
16
|
-
\ 'relative': ['s:re', 0],
|
17
|
-
\ }]
|
18
|
-
for [ke, va] in items(opts)
|
19
|
-
let [{va[0]}, {pref.ke}] = [pref.ke, exists(pref.ke) ? {pref.ke} : va[1]]
|
20
|
-
endfo
|
21
|
-
endf
|
22
|
-
cal ctrlp#mrufiles#opts()
|
23
|
-
" Utilities {{{1
|
24
|
-
fu! s:excl(fn)
|
25
|
-
retu !empty({s:ex}) && a:fn =~# {s:ex}
|
26
|
-
endf
|
27
|
-
|
28
|
-
fu! s:mergelists()
|
29
|
-
let diskmrufs = ctrlp#utils#readfile(ctrlp#mrufiles#cachefile())
|
30
|
-
cal filter(diskmrufs, 'index(s:mrufs, v:val) < 0')
|
31
|
-
let mrufs = s:mrufs + diskmrufs
|
32
|
-
retu s:chop(mrufs)
|
33
|
-
endf
|
34
|
-
|
35
|
-
fu! s:chop(mrufs)
|
36
|
-
if len(a:mrufs) > {s:max} | cal remove(a:mrufs, {s:max}, -1) | en
|
37
|
-
retu a:mrufs
|
38
|
-
endf
|
39
|
-
|
40
|
-
fu! s:reformat(mrufs)
|
41
|
-
if {s:re}
|
42
|
-
let cwd = exists('+ssl') ? tr(getcwd(), '/', '\') : getcwd()
|
43
|
-
cal filter(a:mrufs, '!stridx(v:val, cwd)')
|
44
|
-
en
|
45
|
-
retu map(a:mrufs, 'fnamemodify(v:val, ":.")')
|
46
|
-
endf
|
47
|
-
|
48
|
-
fu! s:record(bufnr)
|
49
|
-
if s:locked | retu | en
|
50
|
-
let bufnr = a:bufnr + 0
|
51
|
-
if bufnr <= 0 | retu | en
|
52
|
-
let bufname = bufname(bufnr)
|
53
|
-
if empty(bufname) | retu | en
|
54
|
-
let fn = fnamemodify(bufname, ':p')
|
55
|
-
let fn = exists('+ssl') ? tr(fn, '/', '\') : fn
|
56
|
-
cal filter(s:mrbs, 'v:val != bufnr')
|
57
|
-
cal insert(s:mrbs, bufnr)
|
58
|
-
if ( !empty({s:in}) && fn !~# {s:in} ) || ( !empty({s:ex}) && fn =~# {s:ex} )
|
59
|
-
\ || !empty(&bt) || !filereadable(fn) | retu
|
60
|
-
en
|
61
|
-
cal filter(s:mrufs, 'v:val !='.( {s:cseno} ? '#' : '?' ).' fn')
|
62
|
-
cal insert(s:mrufs, fn)
|
63
|
-
endf
|
64
|
-
|
65
|
-
fu! s:savetofile(mrufs)
|
66
|
-
cal ctrlp#utils#writecache(a:mrufs, s:cadir, s:cafile)
|
67
|
-
endf
|
68
|
-
" Public {{{1
|
69
|
-
fu! ctrlp#mrufiles#refresh(...)
|
70
|
-
let s:mrufs = s:mergelists()
|
71
|
-
cal filter(s:mrufs, '!empty(ctrlp#utils#glob(v:val, 1)) && !s:excl(v:val)')
|
72
|
-
if exists('+ssl')
|
73
|
-
cal map(s:mrufs, 'tr(v:val, "/", "\\")')
|
74
|
-
cal filter(s:mrufs, 'count(s:mrufs, v:val) == 1')
|
75
|
-
en
|
76
|
-
cal s:savetofile(s:mrufs)
|
77
|
-
retu a:0 && a:1 == 'raw' ? [] : s:reformat(copy(s:mrufs))
|
78
|
-
endf
|
79
|
-
|
80
|
-
fu! ctrlp#mrufiles#remove(files)
|
81
|
-
let s:mrufs = []
|
82
|
-
if a:files != []
|
83
|
-
let s:mrufs = s:mergelists()
|
84
|
-
cal filter(s:mrufs, 'index(a:files, v:val, 0, '.(!{s:cseno}).') < 0')
|
85
|
-
en
|
86
|
-
cal s:savetofile(s:mrufs)
|
87
|
-
retu s:reformat(copy(s:mrufs))
|
88
|
-
endf
|
89
|
-
|
90
|
-
fu! ctrlp#mrufiles#list(...)
|
91
|
-
retu a:0 ? a:1 == 'raw' ? s:mergelists() : 0 : s:reformat(s:mergelists())
|
92
|
-
endf
|
93
|
-
|
94
|
-
fu! ctrlp#mrufiles#bufs()
|
95
|
-
retu s:mrbs
|
96
|
-
endf
|
97
|
-
|
98
|
-
fu! ctrlp#mrufiles#cachefile()
|
99
|
-
if !exists('s:cadir') || !exists('s:cafile')
|
100
|
-
let s:cadir = ctrlp#utils#cachedir().ctrlp#utils#lash().'mru'
|
101
|
-
let s:cafile = s:cadir.ctrlp#utils#lash().'cache.txt'
|
102
|
-
en
|
103
|
-
retu s:cafile
|
104
|
-
endf
|
105
|
-
|
106
|
-
fu! ctrlp#mrufiles#init()
|
107
|
-
if !has('autocmd') | retu | en
|
108
|
-
let s:locked = 0
|
109
|
-
aug CtrlPMRUF
|
110
|
-
au!
|
111
|
-
au BufAdd,BufEnter,BufLeave,BufUnload * cal s:record(expand('<abuf>', 1))
|
112
|
-
au QuickFixCmdPre *vimgrep* let s:locked = 1
|
113
|
-
au QuickFixCmdPost *vimgrep* let s:locked = 0
|
114
|
-
au VimLeavePre * cal s:savetofile(s:mergelists())
|
115
|
-
aug END
|
116
|
-
endf
|
117
|
-
"}}}
|
118
|
-
|
119
|
-
" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2
|
@@ -1,62 +0,0 @@
|
|
1
|
-
" =============================================================================
|
2
|
-
" File: autoload/ctrlp/quickfix.vim
|
3
|
-
" Description: Quickfix extension
|
4
|
-
" Author: Kien Nguyen <github.com/kien>
|
5
|
-
" =============================================================================
|
6
|
-
|
7
|
-
" Init {{{1
|
8
|
-
if exists('g:loaded_ctrlp_quickfix') && g:loaded_ctrlp_quickfix
|
9
|
-
fini
|
10
|
-
en
|
11
|
-
let g:loaded_ctrlp_quickfix = 1
|
12
|
-
|
13
|
-
cal add(g:ctrlp_ext_vars, {
|
14
|
-
\ 'init': 'ctrlp#quickfix#init()',
|
15
|
-
\ 'accept': 'ctrlp#quickfix#accept',
|
16
|
-
\ 'lname': 'quickfix',
|
17
|
-
\ 'sname': 'qfx',
|
18
|
-
\ 'type': 'line',
|
19
|
-
\ 'sort': 0,
|
20
|
-
\ 'nolim': 1,
|
21
|
-
\ })
|
22
|
-
|
23
|
-
let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
|
24
|
-
|
25
|
-
fu! s:lineout(dict)
|
26
|
-
retu printf('%s|%d:%d| %s', bufname(a:dict['bufnr']), a:dict['lnum'],
|
27
|
-
\ a:dict['col'], matchstr(a:dict['text'], '\s*\zs.*\S'))
|
28
|
-
endf
|
29
|
-
" Utilities {{{1
|
30
|
-
fu! s:syntax()
|
31
|
-
if !ctrlp#nosy()
|
32
|
-
cal ctrlp#hicheck('CtrlPqfLineCol', 'Search')
|
33
|
-
sy match CtrlPqfLineCol '|\zs\d\+:\d\+\ze|'
|
34
|
-
en
|
35
|
-
endf
|
36
|
-
" Public {{{1
|
37
|
-
fu! ctrlp#quickfix#init()
|
38
|
-
cal s:syntax()
|
39
|
-
retu map(getqflist(), 's:lineout(v:val)')
|
40
|
-
endf
|
41
|
-
|
42
|
-
fu! ctrlp#quickfix#accept(mode, str)
|
43
|
-
let items = matchlist(a:str, '^\([^|]\+\ze\)|\(\d\+\):\(\d\+\)|')
|
44
|
-
if items == [] | retu | en
|
45
|
-
let [md, filpath] = [a:mode, fnamemodify(items[1], ':p')]
|
46
|
-
if empty(filpath) | retu | en
|
47
|
-
cal ctrlp#exit()
|
48
|
-
let cmd = md == 't' ? 'tabe' : md == 'h' ? 'new' : md == 'v' ? 'vne'
|
49
|
-
\ : ctrlp#normcmd('e')
|
50
|
-
let cmd = cmd == 'e' && &modified ? 'hid e' : cmd
|
51
|
-
exe cmd ctrlp#fnesc(filpath)
|
52
|
-
cal cursor(items[2], items[3])
|
53
|
-
sil! norm! zvzz
|
54
|
-
cal ctrlp#setlcdir()
|
55
|
-
endf
|
56
|
-
|
57
|
-
fu! ctrlp#quickfix#id()
|
58
|
-
retu s:id
|
59
|
-
endf
|
60
|
-
"}}}
|
61
|
-
|
62
|
-
" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2
|
@@ -1,49 +0,0 @@
|
|
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
|
@@ -1,112 +0,0 @@
|
|
1
|
-
" =============================================================================
|
2
|
-
" File: autoload/ctrlp/tag.vim
|
3
|
-
" Description: Tag file extension
|
4
|
-
" Author: Kien Nguyen <github.com/kien>
|
5
|
-
" =============================================================================
|
6
|
-
|
7
|
-
" Init {{{1
|
8
|
-
if exists('g:loaded_ctrlp_tag') && g:loaded_ctrlp_tag
|
9
|
-
fini
|
10
|
-
en
|
11
|
-
let g:loaded_ctrlp_tag = 1
|
12
|
-
|
13
|
-
cal add(g:ctrlp_ext_vars, {
|
14
|
-
\ 'init': 'ctrlp#tag#init()',
|
15
|
-
\ 'accept': 'ctrlp#tag#accept',
|
16
|
-
\ 'lname': 'tags',
|
17
|
-
\ 'sname': 'tag',
|
18
|
-
\ 'enter': 'ctrlp#tag#enter()',
|
19
|
-
\ 'type': 'tabs',
|
20
|
-
\ })
|
21
|
-
|
22
|
-
let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
|
23
|
-
" Utilities {{{1
|
24
|
-
fu! s:findcount(str)
|
25
|
-
let [tg, fname] = split(a:str, '\t\+\ze[^\t]\+$')
|
26
|
-
let [fname, tgs] = [expand(fname, 1), taglist('^'.tg.'$')]
|
27
|
-
if empty(tgs) | retu [1, 1] | en
|
28
|
-
let [fnd, ct, pos] = [0, 0, 0]
|
29
|
-
for each in tgs
|
30
|
-
let ct += 1
|
31
|
-
let fulname = fnamemodify(each["filename"], ':p')
|
32
|
-
if stridx(fulname, fname) >= 0
|
33
|
-
\ && strlen(fname) + stridx(fulname, fname) == strlen(fulname)
|
34
|
-
let fnd += 1
|
35
|
-
let pos = ct
|
36
|
-
en
|
37
|
-
if fnd > 1 | brea | en
|
38
|
-
endfo
|
39
|
-
retu [fnd, pos]
|
40
|
-
endf
|
41
|
-
|
42
|
-
fu! s:filter(tags)
|
43
|
-
let [nr, alltags] = [0, a:tags]
|
44
|
-
wh 0 < 1
|
45
|
-
if alltags[nr] =~ '^!' && alltags[nr] !~ '^!_TAG_'
|
46
|
-
let nr += 1
|
47
|
-
con
|
48
|
-
en
|
49
|
-
if alltags[nr] =~ '^!_TAG_' && len(alltags) > nr
|
50
|
-
cal remove(alltags, nr)
|
51
|
-
el
|
52
|
-
brea
|
53
|
-
en
|
54
|
-
endw
|
55
|
-
retu alltags
|
56
|
-
endf
|
57
|
-
|
58
|
-
fu! s:syntax()
|
59
|
-
if !ctrlp#nosy()
|
60
|
-
cal ctrlp#hicheck('CtrlPTabExtra', 'Comment')
|
61
|
-
sy match CtrlPTabExtra '\zs\t.*\ze$'
|
62
|
-
en
|
63
|
-
endf
|
64
|
-
" Public {{{1
|
65
|
-
fu! ctrlp#tag#init()
|
66
|
-
if empty(s:tagfiles) | retu [] | en
|
67
|
-
let g:ctrlp_alltags = []
|
68
|
-
let tagfiles = sort(filter(s:tagfiles, 'count(s:tagfiles, v:val) == 1'))
|
69
|
-
for each in tagfiles
|
70
|
-
let alltags = s:filter(ctrlp#utils#readfile(each))
|
71
|
-
cal extend(g:ctrlp_alltags, alltags)
|
72
|
-
endfo
|
73
|
-
cal s:syntax()
|
74
|
-
retu g:ctrlp_alltags
|
75
|
-
endf
|
76
|
-
|
77
|
-
fu! ctrlp#tag#accept(mode, str)
|
78
|
-
cal ctrlp#exit()
|
79
|
-
let str = matchstr(a:str, '^[^\t]\+\t\+[^\t]\+\ze\t')
|
80
|
-
let [tg, fnd] = [split(str, '^[^\t]\+\zs\t')[0], s:findcount(str)]
|
81
|
-
let cmds = {
|
82
|
-
\ 't': ['tab sp', 'tab stj'],
|
83
|
-
\ 'h': ['sp', 'stj'],
|
84
|
-
\ 'v': ['vs', 'vert stj'],
|
85
|
-
\ 'e': ['', 'tj'],
|
86
|
-
\ }
|
87
|
-
let cmd = fnd[0] == 1 ? cmds[a:mode][0] : cmds[a:mode][1]
|
88
|
-
let cmd = cmd == 'tj' && &modified ? 'hid '.cmd : cmd
|
89
|
-
let cmd = cmd =~ '^tab' ? tabpagenr('$').cmd : cmd
|
90
|
-
if fnd[0] == 1
|
91
|
-
if cmd != ''
|
92
|
-
exe cmd
|
93
|
-
en
|
94
|
-
exe fnd[1].'ta' tg
|
95
|
-
el
|
96
|
-
exe cmd tg
|
97
|
-
en
|
98
|
-
cal ctrlp#setlcdir()
|
99
|
-
endf
|
100
|
-
|
101
|
-
fu! ctrlp#tag#id()
|
102
|
-
retu s:id
|
103
|
-
endf
|
104
|
-
|
105
|
-
fu! ctrlp#tag#enter()
|
106
|
-
let tfs = tagfiles()
|
107
|
-
let s:tagfiles = tfs != [] ? filter(map(tfs, 'fnamemodify(v:val, ":p")'),
|
108
|
-
\ 'filereadable(v:val)') : []
|
109
|
-
endf
|
110
|
-
"}}}
|
111
|
-
|
112
|
-
" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2
|