1
0
mirror of https://github.com/gryf/.vim.git synced 2025-12-18 12:00:30 +01:00

Update of plugins: mark, ctrlp, taglisttoo and syntastic

This commit is contained in:
2012-04-01 19:42:57 +02:00
parent 1178b8be6d
commit f378edfbcb
17 changed files with 423 additions and 241 deletions

View File

@@ -17,6 +17,7 @@ let s:changes_var = {
\ 'sname': 'chs',
\ 'exit': 'ctrlp#changes#exit()',
\ 'type': 'tabe',
\ 'sort': 0,
\ }
let g:ctrlp_ext_vars = exists('g:ctrlp_ext_vars') && !empty(g:ctrlp_ext_vars)

View File

@@ -16,6 +16,7 @@ let s:var_qf = {
\ 'lname': 'quickfix',
\ 'sname': 'qfx',
\ 'type': 'line',
\ 'sort': 0,
\ }
let g:ctrlp_ext_vars = exists('g:ctrlp_ext_vars') && !empty(g:ctrlp_ext_vars)

View File

@@ -11,10 +11,11 @@ en
let g:loaded_ctrlp_tag = 1
let s:tag_var = {
\ 'init': 'ctrlp#tag#init(s:tagfiles)',
\ 'init': 'ctrlp#tag#init()',
\ 'accept': 'ctrlp#tag#accept',
\ 'lname': 'tags',
\ 'sname': 'tag',
\ 'enter': 'ctrlp#tag#enter()',
\ 'type': 'tabs',
\ }
@@ -57,10 +58,10 @@ fu! s:filter(tags)
retu alltags
endf
" Public {{{1
fu! ctrlp#tag#init(tagfiles)
if empty(a:tagfiles) | retu [] | en
fu! ctrlp#tag#init()
if empty(s:tagfiles) | retu [] | en
let g:ctrlp_alltags = []
let tagfiles = sort(filter(a:tagfiles, 'count(a:tagfiles, v:val) == 1'))
let tagfiles = sort(filter(s:tagfiles, 'count(s:tagfiles, v:val) == 1'))
for each in tagfiles
let alltags = s:filter(ctrlp#utils#readfile(each))
cal extend(g:ctrlp_alltags, alltags)
@@ -101,6 +102,12 @@ endf
fu! ctrlp#tag#id()
retu s:id
endf
fu! ctrlp#tag#enter()
let tfs = tagfiles()
let s:tagfiles = tfs != [] ? filter(map(tfs, 'fnamemodify(v:val, ":p")'),
\ 'filereadable(v:val)') : []
endf
"}}}
" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2

View File

@@ -11,12 +11,14 @@ en
let g:loaded_ctrlp_undo = 1
let s:undo_var = {
\ 'init': 'ctrlp#undo#init(s:undos)',
\ 'init': 'ctrlp#undo#init()',
\ 'accept': 'ctrlp#undo#accept',
\ 'lname': 'undo',
\ 'sname': 'udo',
\ 'enter': 'ctrlp#undo#enter()',
\ 'exit': 'ctrlp#undo#exit()',
\ 'type': 'line',
\ 'sort': 0,
\ }
let g:ctrlp_ext_vars = exists('g:ctrlp_ext_vars') && !empty(g:ctrlp_ext_vars)
@@ -27,6 +29,18 @@ let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
let s:text = map(['second', 'seconds', 'minutes', 'hours', 'days', 'weeks',
\ 'months', 'years'], '" ".v:val." ago"')
" Utilities {{{1
fu! s:getundo()
if exists('*undotree')
\ && ( v:version > 703 || ( v:version == 703 && has('patch005') ) )
retu [1, undotree()]
el
redi => result
sil! undol
redi END
retu [0, split(result, "\n")[1:]]
en
endf
fu! s:flatten(tree, cur)
let flatdict = {}
for each in a:tree
@@ -104,16 +118,16 @@ fu! s:formatul(...)
retu parts[2].' ['.parts[1].']'.( parts[3] != '' ? ' saved' : '' )
endf
" Public {{{1
fu! ctrlp#undo#init(undo)
let entries = a:undo[0] ? a:undo[1]['entries'] : a:undo[1]
fu! ctrlp#undo#init()
let entries = s:undos[0] ? s:undos[1]['entries'] : s:undos[1]
if empty(entries) | retu [] | en
if has('syntax') && exists('g:syntax_on')
cal s:syntax()
en
let g:ctrlp_nolimit = 1
if !exists('s:lines')
if a:undo[0]
let entries = s:dict2list(s:flatten(entries, a:undo[1]['seq_cur']))
if s:undos[0]
let entries = s:dict2list(s:flatten(entries, s:undos[1]['seq_cur']))
let s:lines = map(sort(entries, 's:compval'), 's:format(v:val)')
el
let s:lines = map(reverse(entries), 's:formatul(v:val)')
@@ -133,6 +147,10 @@ fu! ctrlp#undo#id()
retu s:id
endf
fu! ctrlp#undo#enter()
let s:undos = s:getundo()
endf
fu! ctrlp#undo#exit()
unl! s:lines
endf