mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
" @Author: Tom Link (micathom AT gmail com?subject=[vim])
|
||||
" @Website: http://www.vim.org/account/profile.php?user_id=4037
|
||||
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
|
||||
" @Revision: 1393
|
||||
" @Revision: 1397
|
||||
|
||||
" :filedoc:
|
||||
" A prototype used by |tlib#input#List|.
|
||||
@ -688,7 +688,7 @@ endf
|
||||
function! s:prototype.SetInitialFilter(filter) dict "{{{3
|
||||
" let self.initial_filter = [[''], [a:filter]]
|
||||
if type(a:filter) == 3
|
||||
let self.initial_filter = copy(a:filter)
|
||||
let self.initial_filter = deepcopy(a:filter)
|
||||
else
|
||||
let self.initial_filter = [[a:filter]]
|
||||
endif
|
||||
@ -815,7 +815,11 @@ function! s:prototype.UseInputListScratch() dict "{{{3
|
||||
endif
|
||||
if !exists('w:tlib_list_init')
|
||||
" TLogVAR scratch
|
||||
syntax match InputlListIndex /^\d\+:/
|
||||
if has_key(self, 'index_next_syntax')
|
||||
exec 'syntax match InputlListIndex /^\d\+:\s/ nextgroup='. self.index_next_syntax
|
||||
else
|
||||
syntax match InputlListIndex /^\d\+:\s/
|
||||
endif
|
||||
syntax match InputlListCursor /^\d\+\* .*$/ contains=InputlListIndex
|
||||
syntax match InputlListSelected /^\d\+# .*$/ contains=InputlListIndex
|
||||
hi def link InputlListIndex Constant
|
||||
@ -1119,10 +1123,11 @@ function! s:prototype.DisplayList(...) dict "{{{3
|
||||
if self.state =~ '\<display\>'
|
||||
call self.Resize(self.GetResize(ll), eval(get(self, 'resize_vertical', 0)))
|
||||
call tlib#normal#WithRegister('gg"tdG', 't')
|
||||
let lines = copy(list)
|
||||
let lines = map(lines, 'substitute(v:val, ''[[:cntrl:][:space:]]'', " ", "g")')
|
||||
let w = winwidth(0) - &fdc
|
||||
" let w = winwidth(0) - &fdc - 1
|
||||
let lines = copy(list)
|
||||
let lines = map(lines, 'printf("%-'. w .'.'. w .'s", substitute(v:val, ''[[:cntrl:][:space:]]'', " ", "g"))')
|
||||
let lines = map(lines, 'printf("%-'. w .'.'. w .'s", v:val)')
|
||||
" TLogVAR lines
|
||||
call append(0, lines)
|
||||
call tlib#normal#WithRegister('G"tddgg', 't')
|
||||
|
@ -3,8 +3,8 @@
|
||||
" @Website: http://www.vim.org/account/profile.php?user_id=4037
|
||||
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
|
||||
" @Created: 2007-08-23.
|
||||
" @Last Change: 2014-02-05.
|
||||
" @Revision: 0.0.53
|
||||
" @Last Change: 2014-10-21.
|
||||
" @Revision: 0.0.54
|
||||
|
||||
if &cp || exists("loaded_tlib_cmd_autoload")
|
||||
finish
|
||||
@ -109,3 +109,11 @@ function! tlib#cmd#Time(cmd) "{{{3
|
||||
echom 'Time: '. diff .': '. a:cmd
|
||||
endf
|
||||
|
||||
|
||||
function! tlib#cmd#Capture(cmd) "{{{3
|
||||
redir => s
|
||||
silent exec a:cmd
|
||||
redir END
|
||||
return s
|
||||
endf
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
" @Author: Tom Link (micathom AT gmail com?subject=[vim])
|
||||
" @Website: http://www.vim.org/account/profile.php?user_id=4037
|
||||
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
|
||||
" @Revision: 1317
|
||||
" @Revision: 1338
|
||||
|
||||
|
||||
" :filedoc:
|
||||
@ -113,12 +113,17 @@ TLet g:tlib#input#numeric_chars = {
|
||||
|
||||
|
||||
" :nodefault:
|
||||
" The default key bindings for single-item-select list views. If you
|
||||
" want to use <c-j>, <c-k> to move the cursor up and down, add these two
|
||||
" lines to after/plugin/02tlib.vim: >
|
||||
" The default key bindings for single-item-select list views.
|
||||
"
|
||||
" let g:tlib#input#keyagents_InputList_s[10] = 'tlib#agent#Down' " <c-j>
|
||||
" let g:tlib#input#keyagents_InputList_s[11] = 'tlib#agent#Up' " <c-k>
|
||||
" This variable is best customized via the variable
|
||||
" g:tlib_extend_keyagents_InputList_s. If you want to use <c-j>, <c-k>
|
||||
" to move the cursor up and down, add these two lines to your |vimrc|
|
||||
" file:
|
||||
"
|
||||
" let g:tlib_extend_keyagents_InputList_s = {
|
||||
" \ 10: 'tlib#agent#Down',
|
||||
" \ 11: 'tlib#agent#Up'
|
||||
" \ }
|
||||
TLet g:tlib#input#keyagents_InputList_s = {
|
||||
\ "\<PageUp>": 'tlib#agent#PageUp',
|
||||
\ "\<PageDown>": 'tlib#agent#PageDown',
|
||||
@ -154,6 +159,10 @@ TLet g:tlib#input#keyagents_InputList_s = {
|
||||
\ }
|
||||
" \ 63: 'tlib#agent#Help',
|
||||
|
||||
if exists('g:tlib_extend_keyagents_InputList_s')
|
||||
let g:tlib#input#keyagents_InputList_s = extend(g:tlib#input#keyagents_InputList_s, g:tlib_extend_keyagents_InputList_s)
|
||||
endif
|
||||
|
||||
|
||||
" :nodefault:
|
||||
TLet g:tlib#input#keyagents_InputList_m = {
|
||||
@ -166,6 +175,11 @@ TLet g:tlib#input#keyagents_InputList_m = {
|
||||
\ }
|
||||
" "\<c-space>": 'tlib#agent#Select'
|
||||
|
||||
if exists('g:tlib_extend_keyagents_InputList_m')
|
||||
let g:tlib#input#keyagents_InputList_m = extend(g:tlib#input#keyagents_InputList_m, g:tlib_extend_keyagents_InputList_m)
|
||||
endif
|
||||
|
||||
|
||||
|
||||
" :nodefault:
|
||||
TLet g:tlib#input#handlers_EditList = [
|
||||
@ -184,6 +198,11 @@ TLet g:tlib#input#handlers_EditList = [
|
||||
\ ]
|
||||
|
||||
|
||||
" A dictionary KEY => {'agent': AGENT, 'key_name': KEY_NAME} to
|
||||
" customize keyboard shortcuts in the list view.
|
||||
TLet g:tlib#input#user_shortcuts = {}
|
||||
|
||||
|
||||
" If true, define a popup menu for |tlib#input#List()| and related
|
||||
" functions.
|
||||
TLet g:tlib#input#use_popup = has('menu') && (has('gui_gtk') || has('gui_gtk2') || has('gui_win32'))
|
||||
@ -381,10 +400,13 @@ function! tlib#input#ListW(world, ...) "{{{3
|
||||
|
||||
" TLogVAR world.filter
|
||||
" TLogVAR world.sticky
|
||||
if world.state =~ '\<pick\>'
|
||||
if world.state =~ '\<picked\>'
|
||||
" TLogVAR world.rv
|
||||
throw 'picked'
|
||||
elseif world.state =~ '\<pick\>'
|
||||
let world.rv = world.CurrentItem()
|
||||
" TLogVAR world.rv
|
||||
throw 'pick'
|
||||
throw 'picked'
|
||||
elseif world.state =~ 'display'
|
||||
if world.state =~ '^display'
|
||||
" let time03 = str2float(reltimestr(reltime())) " DBG
|
||||
@ -679,6 +701,11 @@ function! tlib#input#ListW(world, ...) "{{{3
|
||||
" let world.state = 'continue'
|
||||
endif
|
||||
|
||||
catch /^picked$/
|
||||
call world.ClearAllMarks()
|
||||
call world.MarkCurrent(world.prefidx)
|
||||
let world.state = 'exit'
|
||||
|
||||
catch /^pick$/
|
||||
call world.ClearAllMarks()
|
||||
call world.MarkCurrent(world.prefidx)
|
||||
@ -686,7 +713,7 @@ function! tlib#input#ListW(world, ...) "{{{3
|
||||
" TLogDBG 'Pick item #'. world.prefidx
|
||||
|
||||
finally
|
||||
" TLogDBG 'finally 1'
|
||||
" TLogDBG 'finally 1', world.state
|
||||
if world.state =~ '\<suspend\>'
|
||||
" if !world.allow_suspend
|
||||
" echom "Cannot be suspended"
|
||||
@ -695,10 +722,10 @@ function! tlib#input#ListW(world, ...) "{{{3
|
||||
elseif !empty(world.list) && !empty(world.base)
|
||||
" TLogVAR world.list
|
||||
if empty(world.state)
|
||||
" TLogVAR world.state
|
||||
let world.rv = world.CurrentItem()
|
||||
" TLogVAR world.state, world.rv
|
||||
endif
|
||||
" TLog "postprocess"
|
||||
" TLogVAR "postprocess"
|
||||
for handler in world.post_handlers
|
||||
let state = get(handler, 'postprocess', '')
|
||||
" TLogVAR handler
|
||||
@ -746,7 +773,6 @@ function! tlib#input#ListW(world, ...) "{{{3
|
||||
return ''
|
||||
endif
|
||||
elseif !empty(world.return_agent)
|
||||
" TLog "return_agent"
|
||||
" TLogDBG 'return agent'
|
||||
" TLogVAR world.return_agent
|
||||
call world.CloseScratch()
|
||||
|
@ -3,8 +3,8 @@
|
||||
" @Website: http://www.vim.org/account/profile.php?user_id=4037
|
||||
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
|
||||
" @Created: 2007-06-30.
|
||||
" @Last Change: 2014-07-03.
|
||||
" @Revision: 0.0.26
|
||||
" @Last Change: 2014-07-08.
|
||||
" @Revision: 0.0.29
|
||||
|
||||
if &cp || exists("loaded_tlib_var_autoload")
|
||||
finish
|
||||
@ -75,12 +75,16 @@ endf
|
||||
" EXAMPLE:
|
||||
" echo tlib#var#List('tlib_', 'g:')
|
||||
function! tlib#var#List(rx, ...) "{{{3
|
||||
TVarArg ['prefix', '']
|
||||
redir => vars
|
||||
silent! exec 'let '. prefix
|
||||
redir END
|
||||
let varlist = split(vars, '\n')
|
||||
call map(varlist, 'matchstr(v:val, ''^\S\+'')')
|
||||
TVarArg ['prefix', 'g:']
|
||||
if v:version >= 704
|
||||
exec 'let varlist = keys('. prefix .')'
|
||||
else
|
||||
redir => vars
|
||||
silent! exec 'let '. prefix
|
||||
redir END
|
||||
let varlist = split(vars, '\n')
|
||||
call map(varlist, 'matchstr(v:val, ''^\S\+'')')
|
||||
endif
|
||||
call filter(varlist, 'v:val =~ a:rx')
|
||||
return varlist
|
||||
endf
|
||||
|
@ -2,8 +2,8 @@
|
||||
" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
|
||||
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
|
||||
" @Created: 2012-03-08.
|
||||
" @Last Change: 2014-07-01.
|
||||
" @Revision: 131
|
||||
" @Last Change: 2014-09-30.
|
||||
" @Revision: 133
|
||||
|
||||
|
||||
" A dictionarie of supported VCS (currently: git, hg, svn, bzr).
|
||||
|
Reference in New Issue
Block a user