Browse files

Version 0.45

- fuzzy mode: prototype.highlight defaults to g:tlib_inputlist_higroup- tlib#scratch: Use noautocmd- tlib#input#ListW(): Use world.RestoreOrigin() instead of tlib#win#SetLayout(world.winview)- tlib#input#ListW(): Revert to tlib#win#SetLayout(world.winview)- tlib#cmd#OutputAsList(): Also save output in g:tlib#cmd#last_output- tlib#agent#Suspend(): Resume on BufEnter- tlib#input#Resume(): Make sure we are in the right buffer- tlib#agent#Suspend(): Use only BufEnter event to trigger a Resume- tlib#input#ListW(): When redisplaying a list, make sure prefix > 0- tlib#vcs: Access vcs (initially only git is supported)- tlib#vcs: improved- tlib#persistent: Persistent data file names- tlib#file#With(): Trigger BufRead autocommands- Duplicate help tags (fixes #13)- Make sure scrolloff is 0 while viewing the list (fixes tomtom/vikitasks_vim#2)MD5 checksum: 0af19ebc0e424727a598a988fdc90f4e
  • Loading branch information...
1 parent ddeeaa7 commit 88157e77d48682036db6182d0f621361d5fdc14e @tomtom tomtom committed with Aug 25, 2012
View
13 autoload/tlib/Filter_cnf.vim
@@ -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: 2008-11-25.
-" @Last Change: 2010-11-20.
-" @Revision: 0.0.79
+" @Last Change: 2011-05-18.
+" @Revision: 0.0.84
let s:prototype = tlib#Object#New({'_class': ['Filter_cnf'], 'name': 'cnf'}) "{{{2
let s:prototype.highlight = g:tlib_inputlist_higroup
@@ -31,6 +31,15 @@ endf
" :nodoc:
+function! s:prototype.Help(world) dict "{{{3
+ return [a:world.FormatHelp(
+ \ printf('"%s", "%s", %sWORD', g:tlib_inputlist_and, g:tlib_inputlist_or, g:tlib_inputlist_not),
+ \ 'AND, OR, NOT')
+ \ ]
+endf
+
+
+" :nodoc:
function! s:prototype.AssessName(world, name) dict "{{{3
let xa = 0
let prefix = self.FilterRxPrefix()
View
16 autoload/tlib/Filter_cnfd.vim
@@ -3,14 +3,14 @@
" @Website: http://www.vim.org/account/profile.php?user_id=4037
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 2008-11-25.
-" @Last Change: 2010-09-15.
-" @Revision: 0.0.35
+" @Last Change: 2011-05-19.
+" @Revision: 0.0.43
let s:prototype = tlib#Filter_cnf#New({'_class': ['Filter_cnfd'], 'name': 'cnfd'}) "{{{2
let s:prototype.highlight = g:tlib_inputlist_higroup
-" The same as |tlib#FilterCNF#New()| but a dot is expanded to '\.\{-}'.
+" The same as |tlib#Filter_cnf#New()| but a dot is expanded to '\.\{-}'.
" As a consequence, patterns cannot match dots.
" The pattern is a '/\V' very no-'/magic' regexp pattern.
function! tlib#Filter_cnfd#New(...) "{{{3
@@ -24,6 +24,16 @@ function! s:prototype.Init(world) dict "{{{3
endf
+let s:Help = s:prototype.Help
+
+" :nodoc:
+function! s:prototype.Help(world) dict "{{{3
+ let help = call(s:Help, [a:world], self)
+ let help += [a:world.FormatHelp('.', 'Any characters')]
+ return help
+endf
+
+
" :nodoc:
function! s:prototype.SetFrontFilter(world, pattern) dict "{{{3
let pattern = substitute(a:pattern, '\.', '\\.\\{-}', 'g')
View
18 autoload/tlib/Filter_fuzzy.vim
@@ -3,15 +3,15 @@
" @Website: http://www.vim.org/account/profile.php?user_id=4037
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 2008-11-25.
-" @Last Change: 2010-09-15.
-" @Revision: 0.0.38
+" @Last Change: 2012-01-30.
+" @Revision: 0.0.44
let s:prototype = tlib#Filter_cnf#New({'_class': ['Filter_fuzzy'], 'name': 'fuzzy'}) "{{{2
-let s:prototype.highlight = ''
+let s:prototype.highlight = g:tlib_inputlist_higroup
" Support for "fuzzy" pattern matching in |tlib#input#List()|.
-" Characters are interpreted as if connected with '.\{-}'.
+" Patterns are interpreted as if characters were connected with '.\{-}'.
"
" In "fuzzy" mode, the pretty printing of filenames is disabled.
function! tlib#Filter_fuzzy#New(...) "{{{3
@@ -33,6 +33,16 @@ function! s:prototype.Init(world) dict "{{{3
endf
+let s:Help = s:prototype.Help
+
+" :nodoc:
+function! s:prototype.Help(world) dict "{{{3
+ let help = call(s:Help, [a:world], self)
+ let help += ['Patterns are interpreted as if characters were connected with .\{-}']
+ return help
+endf
+
+
" :nodoc:
function! s:prototype.DisplayFilter(filter) dict "{{{3
" TLogVAR a:filter
View
98 autoload/tlib/Filter_seq.vim
@@ -1,98 +0,0 @@
-" Filter_seq.vim
-" @Author: Tom Link (mailto: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)
-" @Created: 2008-11-25.
-" @Last Change: 2010-11-20.
-" @Revision: 0.0.30
-
-let s:prototype = tlib#Filter_cnf#New({'_class': ['Filter_seq'], 'name': 'seq'}) "{{{2
-let s:prototype.highlight = g:tlib_inputlist_higroup
-
-" The search pattern for |tlib#input#List()| is interpreted as a
-" disjunction of 'magic' regular expressions with the exception of a dot
-" ".", which is interpreted as ".\{-}".
-" The pattern is a '/magic' regexp pattern.
-function! tlib#Filter_seq#New(...) "{{{3
- let object = s:prototype.New(a:0 >= 1 ? a:1 : {})
- return object
-endf
-
-
-" :nodoc:
-function! s:prototype.Init(world) dict "{{{3
-endf
-
-
-" :nodoc:
-function! s:prototype.Match(world, text) dict "{{{3
- " TLogVAR a:text
- for rx in a:world.filter_neg
- if a:text !~ rx
- " TLogDBG "filter_neg ". rx
- return 1
- endif
- endfor
- for rx in a:world.filter_pos
- if a:text =~ rx
- " TLogDBG "filter_pos ". rx
- return 1
- endif
- endfor
- return 0
-endf
-
-
-" :nodoc:
-function! s:prototype.DisplayFilter(filter) dict "{{{3
- let filter1 = deepcopy(a:filter)
- call map(filter1, '"(". join(reverse(s:Pretty(v:val)), "_") .")"')
- return join(reverse(filter1), ' OR ')
-endf
-
-
-function! s:Pretty(filter) "{{{3
- call map(a:filter, 's:prototype.CleanFilter(v:val)')
- return a:filter
-endf
-
-
-" :nodoc:
-function! s:prototype.SetFrontFilter(world, pattern) dict "{{{3
- let a:world.filter[0] = map(reverse(split(a:pattern, '\s*|\s*')), 'join(split(v:val, ''\.''), ''.\{-}'')') + a:world.filter[0][1 : -1]
-endf
-
-
-" :nodoc:
-function! s:prototype.PushFrontFilter(world, char) dict "{{{3
- let cc = nr2char(a:char)
- if cc == '.'
- let a:world.filter[0][0] .= '.\{-}'
- else
- let a:world.filter[0][0] .= nr2char(a:char)
- endif
-endf
-
-
-" :nodoc:
-function! s:prototype.ReduceFrontFilter(world) dict "{{{3
- let flt = a:world.filter[0][0]
- if flt =~ '\.\\{-}$'
- let a:world.filter[0][0] = flt[0:-6]
- else
- let a:world.filter[0][0] = flt[0:-2]
- endif
-endf
-
-
-" :nodoc:
-function! s:prototype.FilterRxPrefix() dict "{{{3
- return ''
-endf
-
-
-" :nodoc:
-function! s:prototype.CleanFilter(filter) dict "{{{3
- return substitute(a:filter, '.\\{-}', '.', 'g')
-endf
-
View
104 autoload/tlib/World.vim
@@ -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-05-01.
-" @Last Change: 2011-04-01.
-" @Revision: 0.1.915
+" @Last Change: 2012-02-28.
+" @Revision: 0.1.960
" :filedoc:
" A prototype used by |tlib#input#List|.
@@ -62,6 +62,7 @@ let s:prototype = tlib#Object#New({
\ 'state': 'display',
\ 'state_handlers': [],
\ 'sticky': 0,
+ \ 'temp_prompt': [],
\ 'timeout': 0,
\ 'timeout_resolution': 2,
\ 'type': '',
@@ -312,7 +313,11 @@ endf
" :nodoc:
function! s:prototype.GetBaseIdx0(idx) dict "{{{3
- return self.GetBaseIdx(a:idx) - 1
+ let idx0 = self.GetBaseIdx(a:idx) - 1
+ if idx0 < 0
+ call tlib#notify#Echo('TLIB: Internal Error: GetBaseIdx0: idx0 < 0', 'WarningMsg')
+ endif
+ return idx0
endf
@@ -630,7 +635,6 @@ function! s:prototype.UseInputListScratch() dict "{{{3
hi def link InputlListIndex Constant
hi def link InputlListCursor Search
hi def link InputlListSelected IncSearch
- " exec "au BufEnter <buffer> call tlib#input#Resume(". string(self.name) .")"
setlocal nowrap
" hi def link InputlListIndex Special
" let b:tlibDisplayListMarks = {}
@@ -687,49 +691,71 @@ function! s:prototype.Retrieve(anyway) dict "{{{3
endf
+function! s:prototype.FormatHelp(...) dict "{{{3
+ if a:0 == 2
+ return printf('%15s ... %s', a:1, a:2)
+ elseif a:0 == 4
+ return printf('%15s ... %-23s %15s ... %s', a:1, a:2, a:3, a:4)
+ else
+ throw 'TLIB: #FormatHelp(): Only 2 or 4 arguments allowed: ' + string(a:000)
+ endif
+endf
+
+
" :nodoc:
function! s:prototype.DisplayHelp() dict "{{{3
" \ 'Help:',
let help = [
- \ 'Mouse ... Pick an item Letter ... Filter the list',
- \ printf('<m-Number> ... Pick an item "%s", "%s", %sWORD ... AND, OR, NOT',
- \ g:tlib_inputlist_and, g:tlib_inputlist_or, g:tlib_inputlist_not),
- \ 'Enter ... Pick the current item <bs>, <c-bs> ... Reduce filter',
- \ '<c|m-r> ... Reset the display Up/Down ... Next/previous item',
- \ '<c|m-q> ... Edit top filter string Page Up/Down ... Scroll',
- \ '<Esc> ... Abort',
+ \ self.FormatHelp('Enter, <cr>', 'Pick the current item', '<Esc>', 'Abort'),
+ \ self.FormatHelp('<m-Number>', 'Pick an item', '<bs>, <c-bs>', 'Reduce filter'),
+ \ self.FormatHelp('Mouse', 'Pick an item', 'Letter', 'Filter the list'),
+ \ self.FormatHelp('<c|m-r>', 'Reset the display', 'Up/Down', 'Next/previous item'),
+ \ self.FormatHelp('<c|m-q>', 'Edit top filter string', 'Page Up/Down', 'Scroll'),
\ ]
if self.allow_suspend
- call add(help,
- \ '<c|m-z> ... Suspend/Resume <c-o> ... Switch to origin')
+ call add(help, self.FormatHelp('<c|m-z>', 'Suspend/Resume', '<c-o>', 'Switch to origin'))
endif
if stridx(self.type, 'm') != -1
let help += [
- \ '#, <c-space> ... (Un)Select the current item',
- \ '<c|m-a> ... (Un)Select all currently visible items',
- \ '<s-up/down> ... (Un)Select items',
+ \ self.FormatHelp('<s-up/down>', '(Un)Select items', '#, <c-space>', '(Un)Select the current item'),
+ \ self.FormatHelp('<c|m-a>', '(Un)Select all currently visible items')
\ ]
" \ '<c-\> ... Show only selected',
endif
+ let k0 = ''
+ let h0 = ''
+ let i0 = 0
+ let i = 0
+ let nkey_handlers = len(self.key_handlers)
for handler in self.key_handlers
+ let i += 1
let key = get(handler, 'key_name', '')
if !empty(key)
let desc = get(handler, 'help', '')
- call add(help, printf('%-12s ... %s', key, desc))
+ if i0
+ call add(help, self.FormatHelp(k0, h0, key, desc))
+ let i0 = 0
+ elseif i == nkey_handlers
+ call add(help, self.FormatHelp(key, desc))
+ else
+ let k0 = key
+ let h0 = desc
+ let i0 = 1
+ endif
endif
endfor
if !empty(self.help_extra)
let help += self.help_extra
endif
+ let help += self.matcher.Help(self)
let help += [
\ '',
\ 'Exact matches and matches at word boundaries is given more weight.',
\ 'Warning: Please don''t resize the window with the mouse.',
- \ '',
- \ 'Press any key to continue.',
\ ]
+ let self.temp_prompt = ['Press any key to continue.', 'Question']
" call tlib#normal#WithRegister('gg"tdG', 't')
call tlib#buffer#DeleteRange('1', '$')
call append(0, help)
@@ -799,6 +825,7 @@ function! s:prototype.DisplayList(query, ...) dict "{{{3
call self.ScrollToOffset()
elseif self.state == 'help'
call self.DisplayHelp()
+ call self.SetStatusline(a:query)
else
" TLogVAR query
" let ll = len(list)
@@ -850,21 +877,34 @@ endf
function! s:prototype.SetStatusline(query) dict "{{{3
- let query = a:query
- let options = [self.matcher.name]
- if self.sticky
- call add(options, '#')
- endif
- if !empty(options)
- let sopts = printf('[%s]', join(options, ', '))
- " let echo = query . repeat(' ', &columns - len(sopts) - len(query) - 20) . sopts
- let echo = query . ' ' . sopts
- " let query .= '%%='. sopts .' '
+ if !empty(self.temp_prompt)
+ let echo = get(self.temp_prompt, 0, '')
+ let hl = get(self.temp_prompt, 1, 'Normal')
+ let self.temp_prompt = []
+ else
+ let hl = 'Normal'
+ let query = a:query
+ let options = [self.matcher.name]
+ if self.sticky
+ call add(options, '#')
+ endif
+ if !empty(options)
+ let sopts = printf('[%s]', join(options, ', '))
+ " let echo = query . repeat(' ', &columns - len(sopts) - len(query) - 20) . sopts
+ let echo = query . ' ' . sopts
+ " let query .= '%%='. sopts .' '
+ endif
+ " TLogVAR &l:statusline, query
+ " let &l:statusline = query
endif
- " TLogVAR &l:statusline, query
- " let &l:statusline = query
echo
- echo echo
+ if hl != 'Normal'
+ exec 'echohl' hl
+ echo echo
+ echohl None
+ else
+ echo echo
+ endif
endf
View
22 autoload/tlib/agent.vim
@@ -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-24.
-" @Last Change: 2010-11-20.
-" @Revision: 0.1.185
+" @Last Change: 2012-03-02.
+" @Revision: 0.1.192
" :filedoc:
@@ -156,17 +156,14 @@ function! tlib#agent#Suspend(world, selected) "{{{3
" TLogDBG bufnr('%')
let br = tlib#buffer#Set(a:world.scratch)
" TLogVAR br, a:world.bufnr, a:world.scratch
- " TLogDBG bufnr('%')
+ if bufnr('%') != a:world.scratch
+ echohl WarningMsg
+ echom "tlib#agent#Suspend: Internal error: Not a scratch buffer:" bufname('%')
+ echohl NONE
+ endif
+ " TLogVAR bufnr('%'), bufname('%'), a:world.scratch
call tlib#autocmdgroup#Init()
- autocmd TLib InsertEnter,InsertChange <buffer> call tlib#input#Resume("world", 0)
- let b:tlib_suspend = {
- \ '<m-z>': 0, '<c-z>': 0, '<space>': 0,
- \ '<cr>': 1,
- \ '<LeftMouse>': 1, '<MiddleMouse>': 0, '<RightMouse>': 0, '<c-LeftMouse>': 0,
- \ '<': 2}
- for [m, pick] in items(b:tlib_suspend)
- exec 'noremap <buffer> '. m .' :call tlib#input#Resume("world", '. pick .')<cr>'
- endfor
+ exec 'autocmd TLib BufEnter <buffer='. a:world.scratch .'> call tlib#input#Resume("world", 0, '. a:world.scratch .')'
let b:tlib_world = a:world
exec br
let a:world.state = 'exit suspend'
@@ -373,6 +370,7 @@ function! tlib#agent#ViewFile(world, selected) "{{{3
let cmd1 = 'buffer'
endif
call tlib#file#With(cmd0, cmd1, a:selected, a:world)
+ " TLogVAR &filetype
exec back
let a:world.state = 'display'
endif
View
5 autoload/tlib/buffer.vim
@@ -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: 2010-09-23.
-" @Revision: 0.0.334
+" @Last Change: 2012-02-09.
+" @Revision: 0.0.351
let s:bmru = []
@@ -351,6 +351,7 @@ function! tlib#buffer#InsertText(text, ...) "{{{3
exec 'norm! '. posshift .'h'
endif
endif
+ " TLogDBG getline(lineno)
" TLogDBG string(getline(1, '$'))
return grow
endf
View
104 autoload/tlib/cache.vim
@@ -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: 2011-03-10.
-" @Revision: 0.1.182
+" @Last Change: 2012-05-11.
+" @Revision: 0.1.192
" |tlib#cache#Purge()|: Remove cache files older than N days.
@@ -24,6 +24,10 @@ TLet g:tlib#cache#script_encoding = &enc
" 2 ... Yes
TLet g:tlib#cache#run_script = 1
+" If non-nil, don't display a message that files were deleted from the
+" cache.
+TLet g:tlib#cache#silent = 0
+
" A list of regexps that are matched against partial filenames of the
" cached files. If a regexp matches, the file won't be removed by
" |tlib#cache#Purge()|.
@@ -42,10 +46,10 @@ function! tlib#cache#Dir(...) "{{{3
endf
-" :def: function! tlib#cache#Filename(type, ?file=%, ?mkdir=0)
+" :def: function! tlib#cache#Filename(type, ?file=%, ?mkdir=0, ?dir='')
function! tlib#cache#Filename(type, ...) "{{{3
" TLogDBG 'bufname='. bufname('.')
- let dir = tlib#cache#Dir()
+ let dir = a:0 >= 3 && !empty(a:3) ? a:3 : tlib#cache#Dir()
if a:0 >= 1 && !empty(a:1)
let file = a:1
else
@@ -87,70 +91,64 @@ endf
function! tlib#cache#Save(cfile, dictionary) "{{{3
- if !empty(a:cfile)
- " TLogVAR a:dictionary
- call writefile([string(a:dictionary)], a:cfile, 'b')
- endif
+ call tlib#persistent#Save(a:cfile, a:dictionary)
endf
function! tlib#cache#Get(cfile) "{{{3
call tlib#cache#MaybePurge()
- if !empty(a:cfile) && filereadable(a:cfile)
- let val = readfile(a:cfile, 'b')
- return eval(join(val, "\n"))
- else
- return {}
- endif
+ return tlib#persistent#Get(a:cfile)
endf
" Call |tlib#cache#Purge()| if the last purge was done before
- " |g:tlib#cache#purge_every_days|.
- function! tlib#cache#MaybePurge() "{{{3
- if g:tlib#cache#purge_every_days < 0
- return
- endif
- let dir = tlib#cache#Dir('g')
- let last_purge = tlib#file#Join([dir, '.last_purge'])
- let last_purge_exists = filereadable(last_purge)
+" |g:tlib#cache#purge_every_days|.
+function! tlib#cache#MaybePurge() "{{{3
+ if g:tlib#cache#purge_every_days < 0
+ return
+ endif
+ let dir = tlib#cache#Dir('g')
+ let last_purge = tlib#file#Join([dir, '.last_purge'])
+ let last_purge_exists = filereadable(last_purge)
+ if last_purge_exists
+ let threshold = localtime() - g:tlib#cache#purge_every_days * g:tlib#date#dayshift
+ let should_purge = getftime(last_purge) < threshold
+ else
+ let should_purge = 0 " should ignore empty dirs, like the tmru one: !empty(glob(tlib#file#Join([dir, '**'])))
+ endif
+ if should_purge
if last_purge_exists
- let threshold = localtime() - g:tlib#cache#purge_every_days * g:tlib#date#dayshift
- let should_purge = getftime(last_purge) < threshold
+ let yn = 'y'
else
- let should_purge = 0 " should ignore empty dirs, like the tmru one: !empty(glob(tlib#file#Join([dir, '**'])))
+ let txt = "TLib: The cache directory '". dir ."' should be purged of old files.\nDelete files older than ". g:tlib#cache#purge_days ." days now?"
+ let yn = tlib#input#Dialog(txt, ['yes', 'no'], 'no')
endif
- if should_purge
- if last_purge_exists
- let yn = 'y'
- else
- let txt = "TLib: The cache directory '". dir ."' should be purged of old files.\nDelete files older than ". g:tlib#cache#purge_days ." days now?"
- let yn = tlib#input#Dialog(txt, ['yes', 'no'], 'no')
- endif
- if yn =~ '^y\%[es]$'
- call tlib#cache#Purge()
- else
- let g:tlib#cache#purge_every_days = -1
- if !last_purge_exists
- call s:PurgeTimestamp(dir)
- endif
- echohl WarningMsg
- echom "TLib: Please run :call tlib#cache#Purge() to clean up ". dir
- echohl NONE
+ if yn =~ '^y\%[es]$'
+ call tlib#cache#Purge()
+ else
+ let g:tlib#cache#purge_every_days = -1
+ if !last_purge_exists
+ call s:PurgeTimestamp(dir)
endif
- elseif !last_purge_exists
- call s:PurgeTimestamp(dir)
+ echohl WarningMsg
+ echom "TLib: Please run :call tlib#cache#Purge() to clean up ". dir
+ echohl NONE
endif
- endf
+ elseif !last_purge_exists
+ call s:PurgeTimestamp(dir)
+ endif
+endf
" Delete old files.
function! tlib#cache#Purge() "{{{3
let threshold = localtime() - g:tlib#cache#purge_days * g:tlib#date#dayshift
let dir = tlib#cache#Dir('g')
- echohl WarningMsg
- echom "TLib: Delete files older than ". g:tlib#cache#purge_days ." days from ". dir
- echohl NONE
+ if !g:tlib#cache#silent
+ echohl WarningMsg
+ echom "TLib: Delete files older than ". g:tlib#cache#purge_days ." days from ". dir
+ echohl NONE
+ endif
let files = tlib#cache#ListFilesInCache()
let deldir = []
let newer = []
@@ -169,7 +167,6 @@ function! tlib#cache#Purge() "{{{3
call add(msg, "TLib: Could not delete cache file: ". file)
else
call add(msg, "TLib: Delete cache file: ". file)
- " echo "TLib: Delete cache file: ". file
endif
else
call add(newer, file)
@@ -179,7 +176,7 @@ function! tlib#cache#Purge() "{{{3
finally
let &more = more
endtry
- if !empty(msg)
+ if !empty(msg) && !g:tlib#cache#silent
echo join(msg, "\n")
endif
if !empty(deldir)
@@ -206,11 +203,14 @@ function! tlib#cache#Purge() "{{{3
call inputsave()
if g:tlib#cache#run_script == 0
echohl WarningMsg
- echom "TLib: Please review and execute ". scriptfile
+ if g:tlib#cache#silent
+ echom "TLib: Purged cache. Need to run script to delete directories"
+ endif
+ echom "TLib: Please review and execute: ". scriptfile
echohl NONE
else
try
- let yn = g:tlib#cache#run_script == 2 ? 'y' : tlib#input#Dialog("TLib: Could not delete some directories.\nDirectory removal script: ". scriptfile ."\nRun script to delete directories now?", ['yes', 'no', 'edit'], 'no')
+ let yn = g:tlib#cache#run_script == 2 ? 'y' : tlib#input#Dialog("TLib: About to delete directories by means of a shell script.\nDirectory removal script: ". scriptfile ."\nRun script to delete directories now?", ['yes', 'no', 'edit'], 'no')
if yn =~ '^y\%[es]$'
exec 'cd '. fnameescape(dir)
exec '! ' &shell shellescape(scriptfile, 1)
View
12 autoload/tlib/cmd.vim
@@ -3,21 +3,27 @@
" @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: 2011-04-28.
-" @Revision: 0.0.31
+" @Last Change: 2012-02-10.
+" @Revision: 0.0.35
if &cp || exists("loaded_tlib_cmd_autoload")
finish
endif
let loaded_tlib_cmd_autoload = 1
+let g:tlib#cmd#last_output = []
+
+
function! tlib#cmd#OutputAsList(command) "{{{3
+ " TLogVAR a:command
" let lines = ''
redir => lines
silent! exec a:command
redir END
- return split(lines, '\n')
+ " TLogVAR lines
+ let g:tlib#cmd#last_output = split(lines, '\n')
+ return g:tlib#cmd#last_output
endf
View
31 autoload/tlib/file.vim
@@ -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: 2010-04-03.
-" @Revision: 0.0.74
+" @Last Change: 2012-03-23.
+" @Revision: 0.0.106
if &cp || exists("loaded_tlib_file_autoload")
finish
@@ -97,22 +97,34 @@ endf
function! tlib#file#With(fcmd, bcmd, files, ...) "{{{3
" TLogVAR a:fcmd, a:bcmd, a:files
exec tlib#arg#Let([['world', {}]])
+ call tlib#autocmdgroup#Init()
+ augroup TLibFileRead
+ autocmd!
+ augroup END
for f in a:files
let bn = bufnr('^'.f.'$')
" TLogVAR f, bn
+ let bufloaded = bufloaded(bn)
+ let ok = 0
+ let s:bufread = ""
if bn != -1 && buflisted(bn)
if !empty(a:bcmd)
" TLogDBG a:bcmd .' '. bn
exec a:bcmd .' '. bn
+ let ok = 1
call s:SetScrollBind(world)
endif
else
if filereadable(f)
if !empty(a:fcmd)
- " TLogDBG a:fcmd .' '. escape(f, '%#\ ')
- " exec a:fcmd .' '. escape(f, '%#\ ')
- " exec a:fcmd .' '. escape(f, '%# ')
- exec a:fcmd .' '. tlib#arg#Ex(f)
+ " TLogDBG a:fcmd .' '. tlib#arg#Ex(f)
+ exec 'autocmd TLibFileRead BufRead' escape(f, ' ') 'let s:bufread=expand("<afile>:p")'
+ try
+ exec a:fcmd .' '. tlib#arg#Ex(f)
+ finally
+ exec 'autocmd! TLibFileRead BufRead'
+ endtry
+ let ok = 1
call s:SetScrollBind(world)
endif
else
@@ -121,7 +133,14 @@ function! tlib#file#With(fcmd, bcmd, files, ...) "{{{3
echohl NONE
endif
endif
+ " TLogVAR ok, bufloaded, &filetype
+ if empty(s:bufread) && ok && !bufloaded && empty(&filetype)
+ doautocmd BufRead
+ endif
endfor
+ augroup! TLibFileRead
+ unlet! s:bufread
+ " TLogDBG "done"
endf
View
85 autoload/tlib/input.vim
@@ -3,14 +3,21 @@
" @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: 2011-03-31.
-" @Revision: 0.0.840
+" @Last Change: 2012-07-15.
+" @Revision: 0.0.883
" :filedoc:
" Input-related, select from a list etc.
+if !exists('g:tlib#input#use_popup')
+ " If true, define a popup menu for |tlib#input#List()| and related
+ " functions.
+ let g:tlib#input#use_popup = has('menu') && (has('gui_gtk') || has('gui_gtk2') || has('gui_win32'))
+endif
+
+
" Functions related to tlib#input#List(type, ...) "{{{2
" :def: function! tlib#input#List(type. ?query='', ?list=[], ?handlers=[], ?default="", ?timeout=0)
@@ -116,7 +123,12 @@ endf
function! tlib#input#ListW(world, ...) "{{{3
TVarArg 'cmd'
if a:world.pick_last_item >= 1 && stridx(a:world.type, 'e') == -1 && len(a:world.base) <= 1
- return get(a:world.base, 0, a:world.rv)
+ let rv = get(a:world.base, 0, a:world.rv)
+ if stridx(a:world.type, 'm') != -1
+ return [rv]
+ else
+ return rv
+ endif
endif
let world = a:world
let world.filetype = &filetype
@@ -128,7 +140,7 @@ function! tlib#input#ListW(world, ...) "{{{3
if stridx(world.type, 'm') != -1
call extend(key_agents, g:tlib_keyagents_InputList_m, 'force')
endif
- if has('menu')
+ if g:tlib#input#use_popup
amenu ]TLibInputListPopupMenu.Pick\ selected\ item <cr>
amenu ]TLibInputListPopupMenu.Select #
amenu ]TLibInputListPopupMenu.Select\ all <c-a>
@@ -140,7 +152,7 @@ function! tlib#input#ListW(world, ...) "{{{3
let k = get(handler, 'key', '')
if !empty(k)
let key_agents[k] = handler.agent
- if has('menu') && has_key(handler, 'help') && !empty(handler.help)
+ if g:tlib#input#use_popup && has_key(handler, 'help') && !empty(handler.help)
exec 'amenu ]TLibInputListPopupMenu.'. escape(handler.help, ' .\')
\ .' '. handler.key_name
let world.has_menu = 1
@@ -150,6 +162,8 @@ function! tlib#input#ListW(world, ...) "{{{3
" let statusline = &l:statusline
" let laststatus = &laststatus
let lastsearch = @/
+ let scrolloff = &l:scrolloff
+ let &l:scrolloff = 0
let @/ = ''
let dlist = []
" let &laststatus = 2
@@ -282,7 +296,12 @@ function! tlib#input#ListW(world, ...) "{{{3
let dlist = ['Malformed filter']
endif
+ else
+ if world.prefidx == 0
+ let world.prefidx = 1
+ endif
endif
+ " TLogVAR world.idx, world.prefidx
" TLogDBG 7
" TLogVAR world.prefidx, world.offset
@@ -371,7 +390,7 @@ function! tlib#input#ListW(world, ...) "{{{3
endif
throw 'pick'
elseif c == "\<RightMouse>"
- if has('menu')
+ if g:tlib#input#use_popup
" if v:mouse_lnum != line('.')
" endif
let world.prefidx = world.GetLineIdx(v:mouse_lnum)
@@ -526,7 +545,8 @@ function! tlib#input#ListW(world, ...) "{{{3
" let &l:statusline = statusline
" let &laststatus = laststatus
silent! let @/ = lastsearch
- if has('menu') && world.has_menu
+ let &l:scrolloff = scrolloff
+ if g:tlib#input#use_popup && world.has_menu
silent! aunmenu ]TLibInputListPopupMenu
endif
@@ -622,26 +642,43 @@ function! tlib#input#EditList(query, list, ...) "{{{3
endf
-function! tlib#input#Resume(name, pick) "{{{3
+function! tlib#input#Resume(name, pick, bufnr) "{{{3
+ " TLogVAR a:name, a:pick
echo
- if exists('b:tlib_suspend')
- for [m, pick] in items(b:tlib_suspend)
- exec 'unmap <buffer> '. m
- endfor
- unlet b:tlib_suspend
+ if bufnr('%') != a:bufnr
+ if g:tlib_debug
+ echohl WarningMsg
+ echom "tlib#input#Resume: Internal error: Not in scratch buffer:" bufname('%')
+ echohl NONE
+ endif
+ let br = tlib#buffer#Set(a:bufnr)
endif
- call tlib#autocmdgroup#Init()
- autocmd! TLib InsertEnter,InsertChange <buffer>
- let b:tlib_{a:name}.state = 'display'
- " call tlib#input#List('resume '. a:name)
- let cmd = 'resume '. a:name
- if a:pick >= 1
- let cmd .= ' pick'
- if a:pick >= 2
- let cmd .= ' sticky'
- end
+ if !exists('b:tlib_'. a:name)
+ if g:tlib_debug
+ echohl WarningMsg
+ echom "tlib#input#Resume: Internal error: b:tlib_". a:name ." does not exist:" bufname('%')
+ echohl NONE
+ redir => varss
+ silent let b:
+ redir END
+ let vars = split(varss, '\n')
+ call filter(vars, 'v:val =~ "^b:tlib_"')
+ echom "DEBUG tlib#input#Resume" string(vars)
+ endif
+ else
+ call tlib#autocmdgroup#Init()
+ autocmd! TLib BufEnter <buffer>
+ let b:tlib_{a:name}.state = 'redisplay'
+ " call tlib#input#List('resume '. a:name)
+ let cmd = 'resume '. a:name
+ if a:pick >= 1
+ let cmd .= ' pick'
+ if a:pick >= 2
+ let cmd .= ' sticky'
+ end
+ endif
+ call tlib#input#ListW(b:tlib_{a:name}, cmd)
endif
- call tlib#input#ListW(b:tlib_{a:name}, cmd)
endf
View
7 autoload/tlib/notify.vim
@@ -3,16 +3,17 @@
" @Website: http://www.vim.org/account/profile.php?user_id=4037
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 2008-09-19.
-" @Last Change: 2011-03-10.
-" @Revision: 0.0.15
+" @Last Change: 2012-01-02.
+" @Revision: 0.0.19
let s:save_cpo = &cpo
set cpo&vim
+" :display: tlib#notify#Echo(text, ?style='')
" Print text in the echo area. Temporarily disable 'ruler' and 'showcmd'
" in order to prevent |press-enter| messages.
-function! tlib#notify#Echo(text, ...) "{{{3
+function! tlib#notify#Echo(text, ...)
TVarArg 'style'
let ruler = &ruler
let showcmd = &showcmd
View
47 autoload/tlib/persistent.vim
@@ -0,0 +1,47 @@
+" persistent.vim -- Persistent data
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2012-05-11.
+" @Last Change: 2012-05-11.
+" @Revision: 6
+
+" The directory for persistent data files. If empty, use
+" |tlib#dir#MyRuntime|.'/share'.
+TLet g:tlib_persistent = ''
+
+
+" :display: tlib#persistent#Dir(?mode = 'bg')
+" Return the full directory name for persistent data files.
+function! tlib#persistent#Dir() "{{{3
+ TVarArg ['mode', 'bg']
+ let dir = tlib#var#Get('tlib_persistent', mode)
+ if empty(dir)
+ let dir = tlib#file#Join([tlib#dir#MyRuntime(), 'share'])
+ endif
+ return dir
+endf
+
+" :def: function! tlib#persistent#Filename(type, ?file=%, ?mkdir=0)
+function! tlib#persistent#Filename(type, ...) "{{{3
+ " TLogDBG 'bufname='. bufname('.')
+ let file = a:0 >= 1 ? a:1 : ''
+ let mkdir = a:0 >= 2 ? a:2 : 0
+ return tlib#cache#Filename(a:type, file, mkdir, tlib#persistent#Dir())
+endf
+
+function! tlib#persistent#Get(cfile) "{{{3
+ if !empty(a:cfile) && filereadable(a:cfile)
+ let val = readfile(a:cfile, 'b')
+ return eval(join(val, "\n"))
+ else
+ return {}
+ endif
+endf
+
+function! tlib#persistent#Save(cfile, dictionary) "{{{3
+ if !empty(a:cfile)
+ " TLogVAR a:dictionary
+ call writefile([string(a:dictionary)], a:cfile, 'b')
+ endif
+endf
+
View
24 autoload/tlib/scratch.vim
@@ -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-07-18.
-" @Last Change: 2011-03-10.
-" @Revision: 0.0.166
+" @Last Change: 2012-02-08.
+" @Revision: 0.0.167
if &cp || exists("loaded_tlib_scratch_autoload")
finish
@@ -29,7 +29,7 @@ function! tlib#scratch#UseScratch(...) "{{{3
" TLogDBG bufnr('%')
if id =~ '^\d\+$' && bufwinnr(id) != -1
if bufnr('%') != id
- exec 'buffer! '. id
+ exec 'noautocmd buffer! '. id
endif
" let ft = &ft
let ft = '*'
@@ -47,29 +47,29 @@ function! tlib#scratch#UseScratch(...) "{{{3
let wn = bufwinnr(bn)
if wn != -1
" TLogVAR wn
- exec wn .'wincmd w'
+ exec 'noautocmd' (wn .'wincmd w')
else
if scratch_split == 1
- let cmd = wpos.' sbuffer! '
+ let cmd = wpos.' sbuffer!'
elseif scratch_split == -1
- let cmd = wpos.' tab sbuffer! '
+ let cmd = wpos.' tab sbuffer!'
else
- let cmd = 'buffer! '
+ let cmd = 'buffer!'
endif
" TLogVAR cmd
- silent exec cmd . bn
+ silent exec 'noautocmd' cmd bn
endif
else
" TLogVAR id
if scratch_split == 1
- let cmd = wpos.' split '
+ let cmd = wpos.' split'
elseif scratch_split == -1
- let cmd = wpos.' tab split '
+ let cmd = wpos.' tab split'
else
- let cmd = 'edit '
+ let cmd = 'edit'
endif
" TLogVAR cmd
- silent exec cmd . escape(id, '%#\ ')
+ silent exec 'noautocmd' cmd escape(id, '%#\ ')
" silent exec 'split '. id
endif
let ft = get(keyargs, 'scratch_filetype', '')
View
5 autoload/tlib/tag.vim
@@ -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-11-01.
-" @Last Change: 2011-03-10.
-" @Revision: 0.0.53
+" @Last Change: 2011-08-11.
+" @Revision: 0.0.56
if &cp || exists("loaded_tlib_tag_autoload")
finish
@@ -38,6 +38,7 @@ let loaded_tlib_tag_autoload = 1
" < tags from the JDK will be included.
function! tlib#tag#Retrieve(rx, ...) "{{{3
TVarArg ['extra_tags', 0]
+ " TLogVAR a:rx, extra_tags
if extra_tags
let tags_orig = &l:tags
if empty(tags_orig)
View
150 autoload/tlib/vcs.vim
@@ -0,0 +1,150 @@
+" vcs.vim
+" @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: 2012-06-11.
+" @Revision: 115
+
+
+" A dictionarie of supported VCS (currently: git, hg, svn, bzr).
+" :display: g:tlib#vcs#def {...}
+TLet g:tlib#vcs#def = {
+ \ 'git': {
+ \ 'dir': '.git',
+ \ 'ls': 'git ls-files --full-name %s',
+ \ 'diff': 'git diff --no-ext-diff -U0 %s'
+ \ },
+ \ 'hg': {
+ \ 'dir': '.hg',
+ \ 'ls': 'hg diff -U0 %s',
+ \ },
+ \ 'svn': {
+ \ 'dir': '.svn',
+ \ 'ls': 'svn diff --diff-cmd diff --extensions -U0 %s',
+ \ },
+ \ 'bzr': {
+ \ 'dir': '.bzr',
+ \ 'ls': 'bzr diff --diff-options=-U0 %s',
+ \ }
+ \ }
+
+
+" A dictionary of custom executables for VCS commands. If the value is
+" empty, support for that VCS will be removed. If no key is present, it
+" is assumed that the VCS "type" is the name of the executable.
+" :display: g:tlib#vcs#executables {...}
+TLet g:tlib#vcs#executables = {}
+
+
+" If non-empty, use it as a format string to check whether a VCS is
+" installed on your computer.
+TLet g:tlib#vcs#check = has('win16') || has('win32') || has('win64') ? '%s.exe' : '%s'
+
+
+if !empty(g:tlib#vcs#check)
+ for [s:cmd, s:def] in items(g:tlib#vcs#def)
+ if !has_key(g:tlib#vcs#executables, s:cmd)
+ let s:cmd1 = printf(g:tlib#vcs#check, s:cmd)
+ let g:tlib#vcs#executables[s:cmd] = executable(s:cmd1) ? s:cmd1 : ''
+ endif
+ endfor
+endif
+
+
+function! tlib#vcs#FindVCS(filename) "{{{3
+ let type = ''
+ let dir = ''
+ " let path = escape(fnamemodify(a:filename, ':p'), ',:') .';'
+ let filename = fnamemodify(a:filename, isdirectory(a:filename) ? ':p:h' : ':p')
+ let path = escape(filename, ';') .';'
+ " TLogVAR a:filename, path
+ let depth = -1
+ for vcs in keys(g:tlib#vcs#def)
+ let subdir = g:tlib#vcs#def[vcs].dir
+ let vcsdir = finddir(subdir, path)
+ " TLogVAR vcs, subdir, vcsdir
+ if !empty(vcsdir)
+ let vcsdir_depth = len(split(fnamemodify(vcsdir, ':p'), '\/'))
+ if vcsdir_depth > depth
+ let depth = vcsdir_depth
+ let type = vcs
+ let dir = vcsdir
+ " TLogVAR type, depth
+ endif
+ endif
+ endfor
+ " TLogVAR type, dir
+ if empty(type)
+ return ['', '']
+ else
+ return [type, dir]
+ endif
+endf
+
+
+function! s:GetCmd(vcstype, cmd)
+ let vcsdef = get(g:tlib#vcs#def, a:vcstype, {})
+ if has_key(vcsdef, a:cmd)
+ let cmd = vcsdef[a:cmd]
+ let bin = get(g:tlib#vcs#executables, a:vcstype, '')
+ if empty(bin)
+ let cmd = ''
+ elseif bin != a:vcstype
+ " let bin = escape(shellescape(bin), '\')
+ let bin = escape(bin, '\')
+ let cmd = substitute(cmd, '^.\{-}\zs'. escape(a:vcstype, '\'), bin, '')
+ endif
+ return cmd
+ else
+ return ''
+ endif
+endf
+
+
+" :display: tlib#vcs#Ls(?filename=bufname('%'), ?vcs=[type, dir])
+" Return the files under VCS.
+function! tlib#vcs#Ls(...) "{{{3
+ if a:0 >= 2
+ let vcs = a:2
+ else
+ let vcs = tlib#vcs#FindVCS(a:0 >= 1 ? a:1 : bufname('%'))
+ endif
+ " TLogVAR vcs
+ if !empty(vcs)
+ let [vcstype, vcsdir] = vcs
+ if has_key(g:tlib#vcs#def, vcstype)
+ let ls = s:GetCmd(vcstype, 'ls')
+ " TLogVAR ls
+ if !empty(ls)
+ let rootdir = fnamemodify(vcsdir, ':p:h:h')
+ " TLogVAR vcsdir, rootdir
+ let cmd = printf(ls, shellescape(rootdir))
+ " TLogVAR cmd
+ let filess = system(cmd)
+ " TLogVAR filess
+ let files = split(filess, '\n')
+ call map(files, 'join([rootdir, v:val], "/")')
+ return files
+ endif
+ endif
+ endif
+ return []
+endf
+
+
+" :display: tlib#vcs#Diff(filename, ?vcs=[type, dir])
+" Return the diff for "filename"
+function! tlib#vcs#Diff(filename, ...) "{{{3
+ let vcs = a:0 >= 1 ? a:1 : tlib#vcs#FindVCS(a:filename)
+ if !empty(vcs)
+ let [vcstype, vcsdir] = vcs
+ let diff = s:GetCmd(vcstype, 'diff')
+ if !empty(diff)
+ let cmd = printf(diff, shellescape(fnamemodify(a:filename, ':p')))
+ let patch = system(cmd)
+ return patch
+ endif
+ endif
+ return []
+endf
+
View
19 autoload/tlib/vim.vim
@@ -3,8 +3,8 @@
" @GIT: http://github.com/tomtom/tlib_vim/
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 2010-07-19.
-" @Last Change: 2010-10-24.
-" @Revision: 24
+" @Last Change: 2012-06-08.
+" @Revision: 35
let s:restoreframecmd = ''
@@ -13,14 +13,22 @@ let s:fullscreen = 0
if has('win16') || has('win32') || has('win64')
if !exists('g:tlib#vim#simalt_maximize')
+ " The alt-key for maximizing the window.
+ " CAUTION: The value of this paramter depends on your locale and
+ " maybe the windows version you are running.
let g:tlib#vim#simalt_maximize = 'x' "{{{2
endif
if !exists('g:tlib#vim#simalt_restore')
+ " The alt-key for restoring the window.
+ " CAUTION: The value of this paramter depends on your locale and
+ " maybe the windows version you are running.
let g:tlib#vim#simalt_restore = 'r' "{{{2
endif
if !exists('g:tlib#vim#use_vimtweak')
+ " If true, use the vimtweak.dll for windows. This will enable
+ " tlib to remove the caption for fullscreen windows.
let g:tlib#vim#use_vimtweak = 0 "{{{2
endif
@@ -54,6 +62,13 @@ if has('win16') || has('win32') || has('win64')
else
if !exists('g:tlib#vim#use_wmctrl')
+ " If true, use wmctrl for X windows to make a window
+ " maximized/fullscreen.
+ "
+ " This is the preferred method for maximizing windows under X
+ " windows. Some window managers have problem coping with the
+ " default method of setting 'lines' and 'columns' to a large
+ " value.
let g:tlib#vim#use_wmctrl = executable('wmctrl') "{{{2
endif
View
1,803 doc/tlib.txt
@@ -61,122 +61,81 @@ Contents~
g:tlib_scroll_lines ..................... |g:tlib_scroll_lines|
g:tlib_keyagents_InputList_m ............ |g:tlib_keyagents_InputList_m|
g:tlib_handlers_EditList ................ |g:tlib_handlers_EditList|
- tlib#autocmdgroup#Init .................. |tlib#autocmdgroup#Init()|
- tlib#tab#BufMap ......................... |tlib#tab#BufMap()|
- tlib#tab#TabWinNr ....................... |tlib#tab#TabWinNr()|
- tlib#tab#Set ............................ |tlib#tab#Set()|
- tlib#paragraph#GetMetric ................ |tlib#paragraph#GetMetric()|
- tlib#paragraph#Move ..................... |tlib#paragraph#Move()|
- tlib#scratch#UseScratch ................. |tlib#scratch#UseScratch()|
- tlib#scratch#CloseScratch ............... |tlib#scratch#CloseScratch()|
+ g:tlib_debug ............................ |g:tlib_debug|
+ tlib#notify#Echo ........................ |tlib#notify#Echo()|
+ tlib#notify#TrimMessage ................. |tlib#notify#TrimMessage()|
+ g:tlib_persistent ....................... |g:tlib_persistent|
+ tlib#persistent#Dir ..................... |tlib#persistent#Dir()|
+ tlib#persistent#Filename ................ |tlib#persistent#Filename()|
+ tlib#persistent#Get ..................... |tlib#persistent#Get()|
+ tlib#persistent#Save .................... |tlib#persistent#Save()|
+ g:tlib#vim#simalt_maximize .............. |g:tlib#vim#simalt_maximize|
+ g:tlib#vim#simalt_restore ............... |g:tlib#vim#simalt_restore|
+ g:tlib#vim#use_vimtweak ................. |g:tlib#vim#use_vimtweak|
+ tlib#vim#Maximize ....................... |tlib#vim#Maximize()|
+ tlib#vim#RestoreWindow .................. |tlib#vim#RestoreWindow()|
+ g:tlib#vim#use_wmctrl ................... |g:tlib#vim#use_wmctrl|
tlib#progressbar#Init ................... |tlib#progressbar#Init()|
tlib#progressbar#Display ................ |tlib#progressbar#Display()|
tlib#progressbar#Restore ................ |tlib#progressbar#Restore()|
- tlib#Object#New ......................... |tlib#Object#New()|
- prototype.New
- prototype.Inherit
- prototype.Extend
- prototype.IsA
- prototype.IsRelated
- prototype.RespondTo
- prototype.Super
- tlib#Object#Methods ..................... |tlib#Object#Methods()|
- tlib#win#Set ............................ |tlib#win#Set()|
- tlib#win#GetLayout ...................... |tlib#win#GetLayout()|
- tlib#win#SetLayout ...................... |tlib#win#SetLayout()|
- tlib#win#List ........................... |tlib#win#List()|
- tlib#win#Width .......................... |tlib#win#Width()|
- tlib#win#WinDo .......................... |tlib#win#WinDo()|
+ tlib#eval#FormatValue ................... |tlib#eval#FormatValue()|
+ tlib#list#Inject ........................ |tlib#list#Inject()|
+ tlib#list#Compact ....................... |tlib#list#Compact()|
+ tlib#list#Flatten ....................... |tlib#list#Flatten()|
+ tlib#list#FindAll ....................... |tlib#list#FindAll()|
+ tlib#list#Find .......................... |tlib#list#Find()|
+ tlib#list#Any ........................... |tlib#list#Any()|
+ tlib#list#All ........................... |tlib#list#All()|
+ tlib#list#Remove ........................ |tlib#list#Remove()|
+ tlib#list#RemoveAll ..................... |tlib#list#RemoveAll()|
+ tlib#list#Zip ........................... |tlib#list#Zip()|
+ tlib#list#Uniq .......................... |tlib#list#Uniq()|
tlib#cmd#OutputAsList ................... |tlib#cmd#OutputAsList()|
tlib#cmd#BrowseOutput ................... |tlib#cmd#BrowseOutput()|
tlib#cmd#BrowseOutputWithCallback ....... |tlib#cmd#BrowseOutputWithCallback()|
tlib#cmd#DefaultBrowseOutput ............ |tlib#cmd#DefaultBrowseOutput()|
tlib#cmd#ParseScriptname ................ |tlib#cmd#ParseScriptname()|
tlib#cmd#UseVertical .................... |tlib#cmd#UseVertical()|
tlib#cmd#Time ........................... |tlib#cmd#Time()|
- tlib#comments#Comments .................. |tlib#comments#Comments()|
+ tlib#syntax#Collect ..................... |tlib#syntax#Collect()|
+ tlib#syntax#Names ....................... |tlib#syntax#Names()|
+ tlib#balloon#Register ................... |tlib#balloon#Register()|
+ tlib#balloon#Remove ..................... |tlib#balloon#Remove()|
+ tlib#balloon#Expr ....................... |tlib#balloon#Expr()|
+ g:tlib#vcs#def .......................... |g:tlib#vcs#def|
+ g:tlib#vcs#executables .................. |g:tlib#vcs#executables|
+ g:tlib#vcs#check ........................ |g:tlib#vcs#check|
+ tlib#vcs#FindVCS ........................ |tlib#vcs#FindVCS()|
+ tlib#vcs#Ls ............................. |tlib#vcs#Ls()|
+ tlib#vcs#Diff ........................... |tlib#vcs#Diff()|
tlib#char#Get ........................... |tlib#char#Get()|
tlib#char#IsAvailable ................... |tlib#char#IsAvailable()|
tlib#char#GetWithTimeout ................ |tlib#char#GetWithTimeout()|
- tlib#World#New .......................... |tlib#World#New()|
- prototype.Reset
+ tlib#scratch#UseScratch ................. |tlib#scratch#UseScratch()|
+ tlib#scratch#CloseScratch ............... |tlib#scratch#CloseScratch()|
+ tlib#autocmdgroup#Init .................. |tlib#autocmdgroup#Init()|
+ g:tlib#cache#purge_days ................. |g:tlib#cache#purge_days|
+ g:tlib#cache#purge_every_days ........... |g:tlib#cache#purge_every_days|
+ g:tlib#cache#script_encoding ............ |g:tlib#cache#script_encoding|
+ g:tlib#cache#run_script ................. |g:tlib#cache#run_script|
+ g:tlib#cache#silent ..................... |g:tlib#cache#silent|
+ g:tlib#cache#dont_purge ................. |g:tlib#cache#dont_purge|
+ tlib#cache#Dir .......................... |tlib#cache#Dir()|
+ tlib#cache#Filename ..................... |tlib#cache#Filename()|
+ tlib#cache#Save ......................... |tlib#cache#Save()|
+ tlib#cache#Get .......................... |tlib#cache#Get()|
+ tlib#cache#MaybePurge ................... |tlib#cache#MaybePurge()|
+ tlib#cache#Purge ........................ |tlib#cache#Purge()|
+ tlib#cache#ListFilesInCache ............. |tlib#cache#ListFilesInCache()|
+ tlib#normal#WithRegister ................ |tlib#normal#WithRegister()|
tlib#time#MSecs ......................... |tlib#time#MSecs()|
tlib#time#Now ........................... |tlib#time#Now()|
tlib#time#Diff .......................... |tlib#time#Diff()|
tlib#time#DiffMSecs ..................... |tlib#time#DiffMSecs()|
- tlib#textobjects#StandardParagraph ...... |standard-paragraph|
- tlib#textobjects#Init ................... |tlib#textobjects#Init()|
- v_sp .................................... |v_sp|
- o_sp .................................... |o_sp|
- tlib#Filter_fuzzy#New ................... |tlib#Filter_fuzzy#New()|
- tlib#file#Split ......................... |tlib#file#Split()|
- tlib#file#Join .......................... |tlib#file#Join()|
- tlib#file#Relative ...................... |tlib#file#Relative()|
- tlib#file#With .......................... |tlib#file#With()|
- tlib#Filter_seq#New ..................... |tlib#Filter_seq#New()|
- tlib#date#DiffInDays .................... |tlib#date#DiffInDays()|
- tlib#date#Parse ......................... |tlib#date#Parse()|
- tlib#date#SecondsSince1970 .............. |tlib#date#SecondsSince1970()|
- tlib#balloon#Register ................... |tlib#balloon#Register()|
- tlib#balloon#Remove ..................... |tlib#balloon#Remove()|
- tlib#balloon#Expr ....................... |tlib#balloon#Expr()|
- tlib#buffer#EnableMRU ................... |tlib#buffer#EnableMRU()|
- tlib#buffer#DisableMRU .................. |tlib#buffer#DisableMRU()|
- tlib#buffer#Set ......................... |tlib#buffer#Set()|
- tlib#buffer#Eval ........................ |tlib#buffer#Eval()|
- tlib#buffer#GetList ..................... |tlib#buffer#GetList()|
- tlib#buffer#ViewLine .................... |tlib#buffer#ViewLine()|
- tlib#buffer#HighlightLine ............... |tlib#buffer#HighlightLine()|
- tlib#buffer#DeleteRange ................. |tlib#buffer#DeleteRange()|
- tlib#buffer#ReplaceRange ................ |tlib#buffer#ReplaceRange()|
- tlib#buffer#ScratchStart ................ |tlib#buffer#ScratchStart()|
- tlib#buffer#ScratchEnd .................. |tlib#buffer#ScratchEnd()|
- tlib#buffer#BufDo ....................... |tlib#buffer#BufDo()|
- tlib#buffer#InsertText .................. |tlib#buffer#InsertText()|
- tlib#buffer#InsertText0 ................. |tlib#buffer#InsertText0()|
- tlib#buffer#CurrentByte ................. |tlib#buffer#CurrentByte()|
- tlib#buffer#KeepCursorPosition .......... |tlib#buffer#KeepCursorPosition()|
- tlib#Filter_cnfd#New .................... |tlib#Filter_cnfd#New()|
- tlib#type#IsNumber ...................... |tlib#type#IsNumber()|
- tlib#type#IsString ...................... |tlib#type#IsString()|
- tlib#type#IsFuncref ..................... |tlib#type#IsFuncref()|
- tlib#type#IsList ........................ |tlib#type#IsList()|
- tlib#type#IsDictionary .................. |tlib#type#IsDictionary()|
- tlib#syntax#Collect ..................... |tlib#syntax#Collect()|
- tlib#syntax#Names ....................... |tlib#syntax#Names()|
- g:tlib#vim#simalt_maximize .............. |g:tlib#vim#simalt_maximize|
- g:tlib#vim#simalt_restore ............... |g:tlib#vim#simalt_restore|
- g:tlib#vim#use_vimtweak ................. |g:tlib#vim#use_vimtweak|
- tlib#vim#Maximize ....................... |tlib#vim#Maximize()|
- tlib#vim#RestoreWindow .................. |tlib#vim#RestoreWindow()|
- g:tlib#vim#use_wmctrl ................... |g:tlib#vim#use_wmctrl|
- tlib#hook#Run ........................... |tlib#hook#Run()|
- tlib#eval#FormatValue ................... |tlib#eval#FormatValue()|
- tlib#arg#Get ............................ |tlib#arg#Get()|
- tlib#arg#Let ............................ |tlib#arg#Let()|
- tlib#arg#Key ............................ |tlib#arg#Key()|
- tlib#arg#StringAsKeyArgs ................ |tlib#arg#StringAsKeyArgs()|
- tlib#arg#Ex ............................. |tlib#arg#Ex()|
tlib#var#Let ............................ |tlib#var#Let()|
tlib#var#EGet ........................... |tlib#var#EGet()|
tlib#var#Get ............................ |tlib#var#Get()|
tlib#var#List ........................... |tlib#var#List()|
- tlib#Filter_cnf#New ..................... |tlib#Filter_cnf#New()|
- tlib#rx#Escape .......................... |tlib#rx#Escape()|
- tlib#rx#EscapeReplace ................... |tlib#rx#EscapeReplace()|
- tlib#rx#Suffixes ........................ |tlib#rx#Suffixes()|
- tlib#url#Decode ......................... |tlib#url#Decode()|
- tlib#url#DecodeChar ..................... |tlib#url#DecodeChar()|
- tlib#url#EncodeChar ..................... |tlib#url#EncodeChar()|
- tlib#url#Encode ......................... |tlib#url#Encode()|
- tlib#input#List ......................... |tlib#input#List()|
- tlib#input#ListD ........................ |tlib#input#ListD()|
- tlib#input#ListW ........................ |tlib#input#ListW()|
- tlib#input#EditList ..................... |tlib#input#EditList()|
- tlib#input#Resume ....................... |tlib#input#Resume()|
- tlib#input#CommandSelect ................ |tlib#input#CommandSelect()|
- tlib#input#Edit ......................... |tlib#input#Edit()|
- tlib#input#Dialog ....................... |tlib#input#Dialog()|
tlib#agent#Exit ......................... |tlib#agent#Exit()|
tlib#agent#CopyItems .................... |tlib#agent#CopyItems()|
tlib#agent#PageUp ....................... |tlib#agent#PageUp()|
@@ -220,46 +179,100 @@ Contents~
tlib#agent#GotoLine ..................... |tlib#agent#GotoLine()|
tlib#agent#DoAtLine ..................... |tlib#agent#DoAtLine()|
tlib#agent#Wildcard ..................... |tlib#agent#Wildcard()|
- tlib#tag#Retrieve ....................... |tlib#tag#Retrieve()|
- tlib#tag#Collect ........................ |tlib#tag#Collect()|
- tlib#tag#Format ......................... |tlib#tag#Format()|
+ tlib#url#Decode ......................... |tlib#url#Decode()|
+ tlib#url#DecodeChar ..................... |tlib#url#DecodeChar()|
+ tlib#url#EncodeChar ..................... |tlib#url#EncodeChar()|
+ tlib#url#Encode ......................... |tlib#url#Encode()|
tlib#signs#ClearAll ..................... |tlib#signs#ClearAll()|
tlib#signs#ClearBuffer .................. |tlib#signs#ClearBuffer()|
tlib#signs#Mark ......................... |tlib#signs#Mark()|
- g:tlib#cache#purge_days ................. |g:tlib#cache#purge_days|
- g:tlib#cache#purge_every_days ........... |g:tlib#cache#purge_every_days|
- g:tlib#cache#script_encoding ............ |g:tlib#cache#script_encoding|
- g:tlib#cache#run_script ................. |g:tlib#cache#run_script|
- g:tlib#cache#dont_purge ................. |g:tlib#cache#dont_purge|
- tlib#cache#Dir .......................... |tlib#cache#Dir()|
- tlib#cache#Filename ..................... |tlib#cache#Filename()|
- tlib#cache#Save ......................... |tlib#cache#Save()|
- tlib#cache#Get .......................... |tlib#cache#Get()|
- tlib#cache#MaybePurge ................... |tlib#cache#MaybePurge()|
- tlib#cache#Purge ........................ |tlib#cache#Purge()|
- tlib#cache#ListFilesInCache ............. |tlib#cache#ListFilesInCache()|
+ tlib#rx#Escape .......................... |tlib#rx#Escape()|
+ tlib#rx#EscapeReplace ................... |tlib#rx#EscapeReplace()|
+ tlib#rx#Suffixes ........................ |tlib#rx#Suffixes()|
+ tlib#tag#Retrieve ....................... |tlib#tag#Retrieve()|
+ tlib#tag#Collect ........................ |tlib#tag#Collect()|
+ tlib#tag#Format ......................... |tlib#tag#Format()|
tlib#map#PumAccept ...................... |tlib#map#PumAccept()|
- tlib#normal#WithRegister ................ |tlib#normal#WithRegister()|
+ tlib#Filter_cnfd#New .................... |tlib#Filter_cnfd#New()|
+ tlib#input#List ......................... |tlib#input#List()|
+ tlib#input#ListD ........................ |tlib#input#ListD()|
+ tlib#input#ListW ........................ |tlib#input#ListW()|
+ tlib#input#EditList ..................... |tlib#input#EditList()|
+ tlib#input#Resume ....................... |tlib#input#Resume()|
+ tlib#input#CommandSelect ................ |tlib#input#CommandSelect()|
+ tlib#input#Edit ......................... |tlib#input#Edit()|
+ tlib#input#Dialog ....................... |tlib#input#Dialog()|
+ tlib#file#Split ......................... |tlib#file#Split()|
+ tlib#file#Join .......................... |tlib#file#Join()|
+ tlib#file#Relative ...................... |tlib#file#Relative()|
+ tlib#file#With .......................... |tlib#file#With()|
+ tlib#paragraph#GetMetric ................ |tlib#paragraph#GetMetric()|
+ tlib#paragraph#Move ..................... |tlib#paragraph#Move()|
+ tlib#World#New .......................... |tlib#World#New()|
+ prototype.Reset
+ prototype.SetStatusline
+ tlib#tab#BufMap ......................... |tlib#tab#BufMap()|
+ tlib#tab#TabWinNr ....................... |tlib#tab#TabWinNr()|
+ tlib#tab#Set ............................ |tlib#tab#Set()|
+ tlib#date#DiffInDays .................... |tlib#date#DiffInDays()|
+ tlib#date#Parse ......................... |tlib#date#Parse()|
+ tlib#date#SecondsSince1970 .............. |tlib#date#SecondsSince1970()|
+ tlib#type#IsNumber ...................... |tlib#type#IsNumber()|
+ tlib#type#IsString ...................... |tlib#type#IsString()|
+ tlib#type#IsFuncref ..................... |tlib#type#IsFuncref()|
+ tlib#type#IsList ........................ |tlib#type#IsList()|
+ tlib#type#IsDictionary .................. |tlib#type#IsDictionary()|
+ tlib#Filter_fuzzy#New ................... |tlib#Filter_fuzzy#New()|
+ tlib#textobjects#StandardParagraph ...... |standard-paragraph|
+ tlib#textobjects#Init ................... |tlib#textobjects#Init()|
+ v_sp .................................... |v_sp|
+ o_sp .................................... |o_sp|
+ tlib#arg#Get ............................ |tlib#arg#Get()|
+ tlib#arg#Let ............................ |tlib#arg#Let()|
+ tlib#arg#Key ............................ |tlib#arg#Key()|
+ tlib#arg#StringAsKeyArgs ................ |tlib#arg#StringAsKeyArgs()|
+ tlib#arg#Ex ............................. |tlib#arg#Ex()|
tlib#dir#CanonicName .................... |tlib#dir#CanonicName()|
tlib#dir#PlainName ...................... |tlib#dir#PlainName()|
tlib#dir#Ensure ......................... |tlib#dir#Ensure()|
tlib#dir#MyRuntime ...................... |tlib#dir#MyRuntime()|
tlib#dir#CD ............................. |tlib#dir#CD()|
tlib#dir#Push ........................... |tlib#dir#Push()|
tlib#dir#Pop ............................ |tlib#dir#Pop()|
- tlib#notify#Echo ........................ |tlib#notify#Echo()|
- tlib#notify#TrimMessage ................. |tlib#notify#TrimMessage()|
- tlib#list#Inject ........................ |tlib#list#Inject()|
- tlib#list#Compact ....................... |tlib#list#Compact()|
- tlib#list#Flatten ....................... |tlib#list#Flatten()|
- tlib#list#FindAll ....................... |tlib#list#FindAll()|
- tlib#list#Find .......................... |tlib#list#Find()|
- tlib#list#Any ........................... |tlib#list#Any()|
- tlib#list#All ........................... |tlib#list#All()|
- tlib#list#Remove ........................ |tlib#list#Remove()|
- tlib#list#RemoveAll ..................... |tlib#list#RemoveAll()|
- tlib#list#Zip ........................... |tlib#list#Zip()|
- tlib#list#Uniq .......................... |tlib#list#Uniq()|
+ tlib#win#Set ............................ |tlib#win#Set()|
+ tlib#win#GetLayout ...................... |tlib#win#GetLayout()|
+ tlib#win#SetLayout ...................... |tlib#win#SetLayout()|
+ tlib#win#List ........................... |tlib#win#List()|
+ tlib#win#Width .......................... |tlib#win#Width()|
+ tlib#win#WinDo .......................... |tlib#win#WinDo()|
+ tlib#comments#Comments .................. |tlib#comments#Comments()|
+ tlib#Filter_cnf#New ..................... |tlib#Filter_cnf#New()|
+ tlib#Object#New ......................... |tlib#Object#New()|
+ prototype.New
+ prototype.Inherit
+ prototype.Extend
+ prototype.IsA
+ prototype.IsRelated
+ prototype.RespondTo
+ prototype.Super
+ tlib#Object#Methods ..................... |tlib#Object#Methods()|
+ tlib#buffer#EnableMRU ................... |tlib#buffer#EnableMRU()|
+ tlib#buffer#DisableMRU .................. |tlib#buffer#DisableMRU()|
+ tlib#buffer#Set ......................... |tlib#buffer#Set()|
+ tlib#buffer#Eval ........................ |tlib#buffer#Eval()|
+ tlib#buffer#GetList ..................... |tlib#buffer#GetList()|
+ tlib#buffer#ViewLine .................... |tlib#buffer#ViewLine()|
+ tlib#buffer#HighlightLine ............... |tlib#buffer#HighlightLine()|
+ tlib#buffer#DeleteRange ................. |tlib#buffer#DeleteRange()|
+ tlib#buffer#ReplaceRange ................ |tlib#buffer#ReplaceRange()|
+ tlib#buffer#ScratchStart ................ |tlib#buffer#ScratchStart()|
+ tlib#buffer#ScratchEnd .................. |tlib#buffer#ScratchEnd()|
+ tlib#buffer#BufDo ....................... |tlib#buffer#BufDo()|
+ tlib#buffer#InsertText .................. |tlib#buffer#InsertText()|
+ tlib#buffer#InsertText0 ................. |tlib#buffer#InsertText0()|
+ tlib#buffer#CurrentByte ................. |tlib#buffer#CurrentByte()|
+ tlib#buffer#KeepCursorPosition .......... |tlib#buffer#KeepCursorPosition()|
+ tlib#hook#Run ........................... |tlib#hook#Run()|
tlib#string#RemoveBackslashes ........... |tlib#string#RemoveBackslashes()|
tlib#string#Chomp ....................... |tlib#string#Chomp()|
tlib#string#Format ...................... |tlib#string#Format()|
@@ -276,7 +289,7 @@ plugin/02tlib.vim~
*:TRequire*
TRequire NAME [VERSION [FILE]]
Make a certain vim file is loaded.
-
+
Conventions: If FILE isn't defined, plugin/NAME.vim is loaded. The
file must provide a variable loaded_{NAME} that represents the version
number.
@@ -331,21 +344,21 @@ TBrowseOutput COMMAND
argument and presents the output via |tlib#input#List()| so that you
can easily search for a keyword (e.g. the name of a variable or
function) and the like.
-
+
If you press enter, the selected line will be copied to the command
line. Press ESC to cancel browsing.
-
+
EXAMPLES: >
TBrowseOutput 20verb TeaseTheCulprit
<
*:TBrowseScriptnames*
TBrowseScriptnames
List all sourced script names (the output of ':scriptnames').
-
+
When you press enter, the selected script will be opened in the current
window. Press ESC to cancel.
-
+
EXAMPLES: >
TBrowseScriptnames
<
@@ -464,7 +477,7 @@ g:tlib_keyagents_InputList_s
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: >
-
+
let g:tlib_keyagents_InputList_s[10] = 'tlib#agent#Down' " <c-j>
let g:tlib_keyagents_InputList_s[11] = 'tlib#agent#Up' " <c-k>
<
@@ -479,67 +492,90 @@ g:tlib_keyagents_InputList_m
*g:tlib_handlers_EditList*
g:tlib_handlers_EditList
+ *g:tlib_debug*
+g:tlib_debug
+
========================================================================
-autoload/tlib/autocmdgroup.vim~
+autoload/tlib/notify.vim~
- *tlib#autocmdgroup#Init()*
-tlib#autocmdgroup#Init()
+ *tlib#notify#Echo()*
+tlib#notify#Echo(text, ?style='')
+ Print text in the echo area. Temporarily disable 'ruler' and 'showcmd'
+ in order to prevent |press-enter| messages.
+
+ *tlib#notify#TrimMessage()*
+tlib#notify#TrimMessage(message)
+ Contributed by Erik Falor:
+ If the line containing the message is too long, echoing it will cause
+ a 'Hit ENTER' prompt to appear. This function cleans up the line so
+ that does not happen.
+ The echoed line is too long if it is wider than the width of the
+ window, minus cmdline space taken up by the ruler and showcmd
+ features.
========================================================================
-autoload/tlib/tab.vim~
+autoload/tlib/persistent.vim~
- *tlib#tab#BufMap()*
-tlib#tab#BufMap()
- Return a dictionary of bufnumbers => [[tabpage, winnr] ...]
+ *g:tlib_persistent*
+g:tlib_persistent (default: '')
+ The directory for persistent data files. If empty, use
+ |tlib#dir#MyRuntime|.'/share'.
- *tlib#tab#TabWinNr()*
-tlib#tab#TabWinNr(buffer)
- Find a buffer's window at some tab page.
+ *tlib#persistent#Dir()*
+tlib#persistent#Dir(?mode = 'bg')
+ Return the full directory name for persistent data files.
- *tlib#tab#Set()*
-tlib#tab#Set(tabnr)
+ *tlib#persistent#Filename()*
+tlib#persistent#Filename(type, ?file=%, ?mkdir=0)
+
+ *tlib#persistent#Get()*
+tlib#persistent#Get(cfile)
+
+ *tlib#persistent#Save()*
+tlib#persistent#Save(cfile, dictionary)
========================================================================
-autoload/tlib/paragraph.vim~
+autoload/tlib/vim.vim~
- *tlib#paragraph#GetMetric()*
-tlib#paragraph#GetMetric()
- Return an object describing a |paragraph|.
+ *g:tlib#vim#simalt_maximize*
+g:tlib#vim#simalt_maximize (default: 'x')
+ The alt-key for maximizing the window.
+ CAUTION: The value of this paramter depends on your locale and
+ maybe the windows version you are running.
- *tlib#paragraph#Move()*
-tlib#paragraph#Move(direction, count)
- This function can be used with the tinymode plugin to move around
- paragraphs.
-
- Example configuration: >
-
- call tinymode#EnterMap("para_move", "gp")
- call tinymode#ModeMsg("para_move", "Move paragraph: j/k")
- call tinymode#Map("para_move", "j", "silent call tlib#paragraph#Move('Down', '[N]')")
- call tinymode#Map("para_move", "k", "silent call tlib#paragraph#Move('Up', '[N]')")
- call tinymode#ModeArg("para_move", "owncount", 1)
-<
+ *g:tlib#vim#simalt_restore*
+g:tlib#vim#simalt_restore (default: 'r')
+ The alt-key for restoring the window.
+ CAUTION: The value of this paramter depends on your locale and
+ maybe the windows version you are running.
+ *g:tlib#vim#use_vimtweak*
+g:tlib#vim#use_vimtweak (default: 0)
+ If true, use the vimtweak.dll for windows. This will enable
+ tlib to remove the caption for fullscreen windows.
-========================================================================
-autoload/tlib/scratch.vim~
+ *tlib#vim#Maximize()*
+tlib#vim#Maximize(fullscreen)
+ Maximize the window.
+ You might need to redefine |g:tlib#vim#simalt_maximize| if it doesn't
+ work for you.
- *tlib#scratch#UseScratch()*
-tlib#scratch#UseScratch(?keyargs={})
- Display a scratch buffer (a buffer with no file). See :TScratch for an
- example.
- Return the scratch buffer's number.
- Values for keyargs:
- scratch_split ... 1: split, 0: window, -1: tab
+ *tlib#vim#RestoreWindow()*
+tlib#vim#RestoreWindow()
+ Restore the original vimsize after having called |tlib#vim#Maximize()|.
- *tlib#scratch#CloseScratch()*
-tlib#scratch#CloseScratch(keyargs, ...)
- Close a scratch buffer as defined in keyargs (usually a World).
- Return 1 if the scratch buffer is closed (or if it already was
- closed).
+ *g:tlib#vim#use_wmctrl*
+g:tlib#vim#use_wmctrl (default: executable('wmctrl'))
+ If true, use wmctrl for X windows to make a window
+ maximized/fullscreen.
+
+ This is the preferred method for maximizing windows under X
+ windows. Some window managers have problem coping with the
+ default method of setting 'lines' and 'columns' to a large
+ value.
========================================================================
@@ -567,91 +603,90 @@ tlib#progressbar#Restore()
========================================================================
-autoload/tlib/Object.vim~
-Provides a prototype plus some OO-like methods.
-
- *tlib#Object#New()*
-tlib#Object#New(?fields={})
- This function creates a prototype that provides some kind of
- inheritance mechanism and a way to call parent/super methods.
-
- The usage demonstrated in the following example works best when every
- class/prototype is defined in a file of its own.
-
- The reason for why there is a dedicated constructor function is that
- this layout facilitates the use of templates and that methods are
- hidden from the user. Other solutions are possible.
-
- EXAMPLES: >
- let s:prototype = tlib#Object#New({
- \ '_class': ['FooBar'],
- \ 'foo': 1,
- \ 'bar': 2,
- \ })
- " Constructor
- function! FooBar(...)
- let object = s:prototype.New(a:0 >= 1 ? a:1 : {})
- return object
- endf
- function! s:prototype.babble() {
- echo "I think, therefore I am ". (self.foo * self.bar) ." months old."
- }
-
-< This could now be used like this: >
- let myfoo = FooBar({'foo': 3})
- call myfoo.babble()
- => I think, therefore I am 6 months old.
- echo myfoo.IsA('FooBar')
- => 1
- echo myfoo.IsA('object')
- => 1
- echo myfoo.IsA('Foo')
- => 0
- echo myfoo.RespondTo('babble')
- => 1
- echo myfoo.RespondTo('speak')
- => 0
-<
+autoload/tlib/eval.vim~
-prototype.New
+ *tlib#eval#FormatValue()*
+tlib#eval#FormatValue(value, ...)
-prototype.Inherit
-prototype.Extend
+========================================================================
+autoload/tlib/list.vim~
-prototype.IsA
+ *tlib#list#Inject()*
+tlib#list#Inject(list, initial_value, funcref)
+ EXAMPLES: >
+ echo tlib#list#Inject([1,2,3], 0, function('Add')
+ => 6
+<
-prototype.IsRelated
+ *tlib#list#Compact()*
+tlib#list#Compact(list)
+ EXAMPLES: >
+ tlib#list#Compact([0,1,2,3,[], {}, ""])
+ => [1,2,3]
+<
-prototype.RespondTo
+ *tlib#list#Flatten()*
+tlib#list#Flatten(list)
+ EXAMPLES: >
+ tlib#list#Flatten([0,[1,2,[3,""]]])
+ => [0,1,2,3,""]
+<
-prototype.Super
+ *tlib#list#FindAll()*
+tlib#list#FindAll(list, filter, ?process_expr="")
+ Basically the same as filter()
- *tlib#Object#Methods()*
-tlib#Object#Methods(object, ...)
+ EXAMPLES: >
+ tlib#list#FindAll([1,2,3], 'v:val >= 2')
+ => [2, 3]
+<
+ *tlib#list#Find()*
+tlib#list#Find(list, filter, ?default="", ?process_expr="")
-========================================================================
-autoload/tlib/win.vim~
+ EXAMPLES: >
+ tlib#list#Find([1,2,3], 'v:val >= 2')
+ => 2
+<
- *tlib#win#Set()*
-tlib#win#Set(winnr)
- Return vim code to jump back to the original window.
+ *tlib#list#Any()*
+tlib#list#Any(list, expr)
+ EXAMPLES: >
+ tlib#list#Any([1,2,3], 'v:val >= 2')
+ => 1
+<
- *tlib#win#GetLayout()*
-tlib#win#GetLayout(?save_view=0)
+ *tlib#list#All()*
+tlib#list#All(list, expr)
+ EXAMPLES: >
+ tlib#list#All([1,2,3], 'v:val >= 2')
+ => 0
+<
- *tlib#win#SetLayout()*
-tlib#win#SetLayout(layout)
+ *tlib#list#Remove()*
+tlib#list#Remove(list, element)
+ EXAMPLES: >
+ tlib#list#Remove([1,2,1,2], 2)
+ => [1,1,2]
+<
- *tlib#win#List()*
-tlib#win#List()
+ *tlib#list#RemoveAll()*
+tlib#list#RemoveAll(list, element)
+ EXAMPLES: >
+ tlib#list#RemoveAll([1,2,1,2], 2)
+ => [1,1]
+<
- *tlib#win#Width()*
-tlib#win#Width(wnr)
+ *tlib#list#Zip()*
+tlib#list#Zip(lists, ?default='')
+ EXAMPLES: >
+ tlib#list#Zip([[1,2,3], [4,5,6]])
+ => [[1,4], [2,5], [3,6]]
+<
- *tlib#win#WinDo()*
-tlib#win#WinDo(ex)
+ *tlib#list#Uniq()*
+tlib#list#Uniq(list, ...)
========================================================================
@@ -669,16 +704,16 @@ tlib#cmd#BrowseOutputWithCallback(callback, command)
Execute COMMAND and present its output in a |tlib#input#List()|;
when a line is selected, execute the function named as the CALLBACK
and pass in that line as an argument.
-
+
The CALLBACK function gives you an opportunity to massage the COMMAND output
and possibly act on it in a meaningful way. For example, if COMMAND listed
all URIs found in the current buffer, CALLBACK could validate and then open
the selected URI in the system's default browser.
-
+
This function is meant to be a tool to help compose the implementations of
powerful commands that use |tlib#input#List()| as a common interface. See
|TBrowseScriptnames| as an example.
-
+
EXAMPLES: >
call tlib#cmd#BrowseOutputWithCallback('tlib#cmd#ParseScriptname', 'scriptnames')
<
@@ -702,11 +737,56 @@ tlib#cmd#Time(cmd)
========================================================================
-autoload/tlib/comments.vim~
+autoload/tlib/syntax.vim~
- *tlib#comments#Comments()*
-tlib#comments#Comments(...)
- function! tlib#comments#Comments(?rx='')
+ *tlib#syntax#Collect()*
+tlib#syntax#Collect()
+
+ *tlib#syntax#Names()*
+tlib#syntax#Names(?rx='')
+
+
+========================================================================
+autoload/tlib/balloon.vim~
+
+ *tlib#balloon#Register()*
+tlib#balloon#Register(expr)
+
+ *tlib#balloon#Remove()*
+tlib#balloon#Remove(expr)
+
+ *tlib#balloon#Expr()*
+tlib#balloon#Expr()
+
+
+========================================================================
+autoload/tlib/vcs.vim~
+
+ *g:tlib#vcs#def*
+g:tlib#vcs#def {...}
+ A dictionarie of supported VCS (currently: git, hg, svn, bzr).
+
+ *g:tlib#vcs#executables*
+g:tlib#vcs#executables {...}
+ A dictionary of custom executables for VCS commands. If the value is
+ empty, support for that VCS will be removed. If no key is present, it
+ is assumed that the VCS "type" is the name of the executable.
+
+ *g:tlib#vcs#check*
+g:tlib#vcs#check (default: has('win16') || has('win32') || has('win64') ? '%s.exe' : '%s')
+ If non-empty, use it as a format string to check whether a VCS is
+ installed on your computer.
+
+ *tlib#vcs#FindVCS()*
+tlib#vcs#FindVCS(filename)
+
+ *tlib#vcs#Ls()*
+tlib#vcs#Ls(?filename=bufname('%'), ?vcs=[type, dir])
+ Return the files under VCS.
+
+ *tlib#vcs#Diff()*
+tlib#vcs#Diff(filename, ?vcs=[type, dir])
+ Return the diff for "filename"
========================================================================
@@ -715,7 +795,7 @@ autoload/tlib/char.vim~
*tlib#char#Get()*
tlib#char#Get(?timeout=0)
Get a character.
-
+
EXAMPLES: >
echo tlib#char#Get()
echo tlib#char#Get(5)
@@ -729,392 +809,344 @@ tlib#char#GetWithTimeout(timeout, ...)
========================================================================
-autoload/tlib/World.vim~
-A prototype used by |tlib#input#List|.
-Inherits from |tlib#Object#New|.
-
- *tlib#World#New()*
-tlib#World#New(...)
+autoload/tlib/scratch.vim~
-prototype.Reset
+ *tlib#scratch#UseScratch()*
+tlib#scratch#UseScratch(?keyargs={})
+ Display a scratch buffer (a buffer with no file). See :TScratch for an
+ example.
+ Return the scratch buffer's number.
+ Values for keyargs:
+ scratch_split ... 1: split, 0: window, -1: tab
+
+ *tlib#scratch#CloseScratch()*
+tlib#scratch#CloseScratch(keyargs, ...)
+ Close a scratch buffer as defined in keyargs (usually a World).
+ Return 1 if the scratch buffer is closed (or if it already was
+ closed).
========================================================================
-autoload/tlib/time.vim~
+autoload/tlib/autocmdgroup.vim~
- *tlib#time#MSecs()*
-tlib#time#MSecs()
+ *tlib#autocmdgroup#Init()*
+tlib#autocmdgroup#Init()
- *tlib#time#Now()*
-tlib#time#Now()
- *tlib#time#Diff()*
-tlib#time#Diff(a, b, ...)
+========================================================================
+autoload/tlib/cache.vim~
- *tlib#time#DiffMSecs()*
-tlib#time#DiffMSecs(a, b, ...)
+ *g:tlib#cache#purge_days*
+g:tlib#cache#purge_days (default: 31)
+ |tlib#cache#Purge()|: Remove cache files older than N days.
+ *g:tlib#cache#purge_every_days*
+g:tlib#cache#purge_every_days (default: 31)
+ Purge the cache every N days. Disable automatic purging by setting
+ this value to a negative value.
-========================================================================
-autoload/tlib/textobjects.vim~
+ *g:tlib#cache#script_encoding*
+g:tlib#cache#script_encoding (default: &enc)
+ The encoding used for the purge-cache script.
+ Default: 'enc'
- *standard-paragraph*
-tlib#textobjects#StandardParagraph()
- Select a "Standard Paragraph", i.e. a text block followed by blank
- lines. Other than |ap|, the last paragraph in a document is handled
- just the same.
-
- The |text-object| can be accessed as "sp". Example: >
-
- vsp ... select the current standard paragraph
-
-< Return 1, if the paragraph is the last one in the document.
+ *g:tlib#cache#run_script*
+g:tlib#cache#run_script (default: 1)
+ Whether to run the directory removal script:
+ 0 ... No
+ 1 ... Query user
+ 2 ... Yes
- *tlib#textobjects#Init()*
-tlib#textobjects#Init()
+ *g:tlib#cache#silent*
+g:tlib#cache#silent (default: 0)
+ If non-nil, don't display a message that files were deleted from the
+ cache.
- *v_sp*
-v_sp ... <Esc>:call tlib#textobjects#StandardParagraph()<CR>
- sp ... Standard paragraph (for use as |text-objects|).
+ *g:tlib#cache#dont_purge*
+g:tlib#cache#dont_purge (default: ['[\/]\.last_purge$'])
+ A list of regexps that are matched against partial filenames of the
+ cached files. If a regexp matches, the file won't be removed by
+ |tlib#cache#Purge()|.
- *o_sp*
-o_sp ... :<C-u>normal Vsp<CR>
+ *tlib#cache#Dir()*
+tlib#cache#Dir(?mode = 'bg')
+ The default cache directory.
+
+ *tlib#cache#Filename()*
+tlib#cache#Filename(type, ?file=%, ?mkdir=0, ?dir='')
+
+ *tlib#cache#Save()*
+tlib#cache#Save(cfile, dictionary)
+
+ *tlib#cache#Get()*
+tlib#cache#Get(cfile)
+
+ *tlib#cache#MaybePurge()*
+tlib#cache#MaybePurge()
+ Call |tlib#cache#Purge()| if the last purge was done before
+ |g:tlib#cache#purge_every_days|.
+
+ *tlib#cache#Purge()*
+tlib#cache#Purge()
+ Delete old files.
+
+ *tlib#cache#ListFilesInCache()*
+tlib#cache#ListFilesInCache(...)
========================================================================
-autoload/tlib/Filter_fuzzy.vim~
+autoload/tlib/normal.vim~
- *tlib#Filter_fuzzy#New()*
-tlib#Filter_fuzzy#New(...)
- Support for "fuzzy" pattern matching in |tlib#input#List()|.
- Characters are interpreted as if connected with '.\{-}'.
-
- In "fuzzy" mode, the pretty printing of filenames is disabled.
+ *tlib#normal#WithRegister()*
+tlib#normal#WithRegister(cmd, ?register='t', ?norm_cmd='norm!')
+ Execute a normal command while maintaining all registers.
- TLogVAR a:world.display_format
+========================================================================
+autoload/tlib/time.vim~
+
+ *tlib#time#MSecs()*
+tlib#time#MSecs()
+
+ *tlib#time#Now()*
+tlib#time#Now()
+
+ *tlib#time#Diff()*
+tlib#time#Diff(a, b, ...)
+
+ *tlib#time#DiffMSecs()*
+tlib#time#DiffMSecs(a, b, ...)
========================================================================
-autoload/tlib/file.vim~
+autoload/tlib/var.vim~
+
+ *tlib#var#Let()*
+tlib#var#Let(name, val)
+ Define a variable called NAME if yet undefined.
+ You can also use the :TLLet command.
- *tlib#file#Split()*
-tlib#file#Split(filename)
EXAMPLES: >
- tlib#file#Split('foo/bar/filename.txt')
- => ['foo', 'bar', 'filename.txt']
+ exec tlib#var#Let('g:foo', 1)
+ TLet g:foo = 1
<
- *tlib#file#Join()*
-tlib#file#Join(filename_parts, ?strip_slashes=0)
+ *tlib#var#EGet()*
+tlib#var#EGet(var, namespace, ?default='')
+ Retrieve a variable by searching several namespaces.
+
EXAMPLES: >
- tlib#file#Join(['foo', 'bar', 'filename.txt'])
- => 'foo/bar/filename.txt'
+ let g:foo = 1
+ let b:foo = 2
+ let w:foo = 3
+ echo eval(tlib#var#EGet('foo', 'vg')) => 1
+ echo eval(tlib#var#EGet('foo', 'bg')) => 2
+ echo eval(tlib#var#EGet('foo', 'wbg')) => 3
<
- *tlib#file#Relative()*
-tlib#file#Relative(filename, basedir)
+ *tlib#var#Get()*
+tlib#var#Get(var, namespace, ?default='')
+ Retrieve a variable by searching several namespaces.
+
EXAMPLES: >
- tlib#file#Relative('foo/bar/filename.txt', 'foo')
- => 'bar/filename.txt'
+ let g:foo = 1
+ let b:foo = 2
+ let w:foo = 3
+ echo tlib#var#Get('foo', 'bg') => 1
+ echo tlib#var#Get('foo', 'bg') => 2
+ echo tlib#var#Get('foo', 'wbg') => 3
<
- *tlib#file#With()*
-tlib#file#With(fcmd, bcmd, files, ?world={})
+ *tlib#var#List()*
+tlib#var#List(rx, ?prefix='')
+ Get a list of variables matching rx.
+ EXAMPLE:
+ echo tlib#var#List('tlib_', 'g:')
========================================================================
-autoload/tlib/Filter_seq.vim~
+autoload/tlib/agent.vim~
+Various agents for use as key handlers in tlib#input#List()
- *tlib#Filter_seq#New()*
-tlib#Filter_seq#New(...)