Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Version 0.39

- tlib#World#Resize: set winfix{height|width}
- g:tlib#cache#dont_purge
- tlib#vim#RestoreWindow()
- tlib#ballon#...()
  • Loading branch information...
commit fc9b9d2fcdac32a800355538564b36637f9b850f 1 parent 8956e71
@tomtom tomtom authored committed
View
10 autoload/tlib/Object.vim
@@ -1,10 +1,10 @@
" Object.vim -- Prototype objects?
" @Author: Tom Link (micathom AT gmail com?subject=[vim])
-" @Website: http://members.a1.net/t.link/
+" @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: 2009-02-15.
-" @Revision: 0.1.121
+" @Last Change: 2010-09-05.
+" @Revision: 0.1.124
" :filedoc:
" Provides a prototype plus some OO-like methods.
@@ -147,9 +147,9 @@ function! s:prototype.Super(method, arglist) dict "{{{3
endf
-function! s:prototype.Methods(...) dict "{{{3
+function! tlib#Object#Methods(object, ...) "{{{3
TVarArg ['pattern', '\d\+']
- let o = items(self)
+ let o = items(a:object)
call filter(o, 'type(v:val[1]) == 2 && string(v:val[1]) =~ "^function(''\\d\\+'')"')
let acc = {}
for e in o
View
6 autoload/tlib/Test.vim
@@ -1,10 +1,10 @@
" Test.vim -- A test class
" @Author: Tom Link (micathom AT gmail com?subject=[vim])
-" @Website: http://members.a1.net/t.link/
+" @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: 2009-02-15.
-" @Revision: 0.1.9
+" @Last Change: 2010-09-05.
+" @Revision: 0.1.10
" :enddoc:
View
6 autoload/tlib/TestChild.vim
@@ -1,10 +1,10 @@
" TestChild.vim
" @Author: Tom Link (micathom AT gmail com?subject=[vim])
-" @Website: http://members.a1.net/t.link/
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 2007-05-18.
-" @Last Change: 2009-02-15.
-" @Revision: 0.1.13
+" @Last Change: 2010-09-05.
+" @Revision: 0.1.14
" :enddoc:
View
52 autoload/tlib/World.vim
@@ -1,10 +1,10 @@
" World.vim -- The World prototype for tlib#input#List()
" @Author: Tom Link (micathom AT gmail com?subject=[vim])
-" @Website: http://members.a1.net/t.link/
+" @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: 2010-03-28.
-" @Revision: 0.1.834
+" @Last Change: 2010-09-05.
+" @Revision: 0.1.871
" :filedoc:
" A prototype used by |tlib#input#List|.
@@ -18,6 +18,7 @@ let s:prototype = tlib#Object#New({
\ 'base': [],
\ 'bufnr': -1,
\ 'display_format': '',
+ \ 'fileencoding': &fileencoding,
\ 'fmt_display': {},
\ 'fmt_filter': {},
\ 'filetype': '',
@@ -25,6 +26,7 @@ let s:prototype = tlib#Object#New({
\ 'filter_format': '',
\ 'filter_options': '',
\ 'follow_cursor': '',
+ \ 'has_menu': 0,
\ 'index_table': [],
\ 'initial_filter': [['']],
\ 'initial_index': 1,
@@ -57,6 +59,9 @@ let s:prototype = tlib#Object#New({
\ 'timeout_resolution': 2,
\ 'type': '',
\ 'win_wnr': -1,
+ \ 'win_height': -1,
+ \ 'win_width': -1,
+ \ 'win_pct': 25,
\ })
" \ 'handlers': [],
" \ 'filter_options': '\c',
@@ -317,6 +322,14 @@ endf
" :nodoc:
+function! s:prototype.GetLineIdx(lnum) dict "{{{3
+ let line = getline(a:lnum)
+ let prefidx = substitute(matchstr(line, '^\d\+\ze[*:]'), '^0\+', '', '')
+ return prefidx
+endf
+
+
+" :nodoc:
function! s:prototype.SetPrefIdx() dict "{{{3
" let pref = sort(range(1, self.llen), 'self.SortPrefs')
" let self.prefidx = get(pref, 0, self.initial_index)
@@ -698,20 +711,40 @@ function! s:prototype.Resize(hsize, vsize) dict "{{{3
if self.scratch_vertical
if a:vsize
let world_resize = 'vert resize '. a:vsize
+ " let w:winresize = {'v': a:vsize}
+ setlocal winfixwidth
endif
else
if a:hsize
let world_resize = 'resize '. a:hsize
+ " let w:winresize = {'h': a:hsize}
+ setlocal winfixheight
endif
endif
if !empty(world_resize)
" TLogVAR world_resize
exec world_resize
- redraw!
+ " redraw!
endif
endf
+" :nodoc:
+function! s:prototype.GetResize(size) dict "{{{3
+ let resize0 = get(self, 'resize', 0)
+ let resize = empty(resize0) ? 0 : eval(resize0)
+ " TLogVAR resize0, resize
+ let resize = resize == 0 ? a:size : min([a:size, resize])
+ " let min = self.scratch_vertical ? &cols : &lines
+ let min1 = (self.scratch_vertical ? self.win_width : self.win_height) * g:tlib_inputlist_pct
+ let min2 = (self.scratch_vertical ? &columns : &lines) * self.win_pct
+ let min = max([min1, min2])
+ let resize = min([resize, (min / 100)])
+ " TLogVAR resize, a:size, min, min1, min2
+ return resize
+endf
+
+
" function! s:prototype.DisplayList(query, ?list)
" :nodoc:
function! s:prototype.DisplayList(query, ...) dict "{{{3
@@ -734,13 +767,7 @@ function! s:prototype.DisplayList(query, ...) dict "{{{3
let x = self.index_width + 1
" TLogVAR ll
if self.state =~ '\<display\>'
- let resize0 = get(self, 'resize', 0)
- let resize = empty(resize0) ? 0 : eval(resize0)
- " TLogVAR resize0, resize
- let resize = resize == 0 ? ll : min([ll, resize])
- let resize = min([resize, (&lines * g:tlib_inputlist_pct / 100)])
- " TLogVAR resize, ll, &lines
- call self.Resize(resize, eval(get(self, 'resize_vertical', 0)))
+ call self.Resize(self.GetResize(ll), eval(get(self, 'resize_vertical', 0)))
call tlib#normal#WithRegister('gg"tdG', 't')
let w = winwidth(0) - &fdc
" let w = winwidth(0) - &fdc - 1
@@ -896,6 +923,9 @@ function! s:prototype.SetOrigin(...) dict "{{{3
" TLogDBG winnr()
" TLogDBG winnr('$')
let self.win_wnr = winnr()
+ let self.win_height = winheight(self.win_wnr)
+ let self.win_width = winwidth(self.win_wnr)
+ " TLogVAR self.win_wnr, self.win_height, self.win_width
let self.bufnr = bufnr('%')
let self.cursor = getpos('.')
if winview
View
6 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-03-27.
-" @Revision: 0.1.178
+" @Last Change: 2010-09-05.
+" @Revision: 0.1.180
" :filedoc:
@@ -162,7 +162,7 @@ function! tlib#agent#Suspend(world, selected) "{{{3
let b:tlib_suspend = {
\ '<m-z>': 0, '<c-z>': 0, '<space>': 0,
\ '<cr>': 1,
- \ '<LeftMouse>': 1, '<c-LeftMouse>': 0, '<MiddleMouse>': 0,
+ \ '<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>'
View
8 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-03-29.
-" @Revision: 0.0.315
+" @Last Change: 2010-04-28.
+" @Revision: 0.0.318
let s:bmru = []
@@ -178,6 +178,7 @@ function! s:UndoHighlightLine() "{{{3
3match none
autocmd! TLib CursorMoved,CursorMovedI <buffer>
autocmd! TLib CursorHold,CursorHoldI <buffer>
+ autocmd! TLib InsertEnter,InsertChange,InsertLeave <buffer>
autocmd! TLib BufLeave,BufWinLeave,WinLeave,BufHidden <buffer>
endf
@@ -189,7 +190,8 @@ function! tlib#buffer#HighlightLine(...) "{{{3
call tlib#autocmdgroup#Init()
exec 'autocmd TLib CursorMoved,CursorMovedI <buffer> if line(".") != '. line .' | call s:UndoHighlightLine() | endif'
autocmd TLib CursorHold,CursorHoldI <buffer> call s:UndoHighlightLine()
- autocmd TLib BufLeave,BufWinLeave,WinLeave,BufHidden <buffer> call s:UndoHighlightLine()
+ autocmd TLib InsertEnter <buffer> call s:UndoHighlightLine()
+ " autocmd TLib BufLeave,BufWinLeave,WinLeave,BufHidden <buffer> call s:UndoHighlightLine()
endf
View
201 autoload/tlib/cache.vim
@@ -3,17 +3,49 @@
" @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-01-05.
-" @Revision: 0.1.33
+" @Last Change: 2010-08-10.
+" @Revision: 0.1.165
-" :def: function! tlib#cache#Filename(type, ?file=%, ?mkdir=0)
-function! tlib#cache#Filename(type, ...) "{{{3
- " TLogDBG 'bufname='. bufname('.')
- let dir = tlib#var#Get('tlib_cache', 'bg')
+" |tlib#cache#Purge()|: Remove cache files older than N days.
+TLet g:tlib#cache#purge_days = 31
+
+" Purge the cache every N days. Disable automatic purging by setting
+" this value to a negative value.
+TLet g:tlib#cache#purge_every_days = 31
+
+" The encoding used for the purge-cache script.
+" Default: 'enc'
+TLet g:tlib#cache#script_encoding = &enc
+
+" Whether to run the directory removal script:
+" 0 ... No
+" 1 ... Query user
+" 2 ... Yes
+TLet g:tlib#cache#run_script = 1
+
+" 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()|.
+TLet g:tlib#cache#dont_purge = ['[\/]\.last_purge$']
+
+
+" :display: tlib#cache#Dir(?mode = 'bg')
+" The default cache directory
+function! tlib#cache#Dir(...) "{{{3
+ TVarArg ['mode', 'bg']
+ let dir = tlib#var#Get('tlib_cache', mode)
if empty(dir)
let dir = tlib#file#Join([tlib#dir#MyRuntime(), 'cache'])
endif
+ return dir
+endf
+
+
+" :def: function! tlib#cache#Filename(type, ?file=%, ?mkdir=0)
+function! tlib#cache#Filename(type, ...) "{{{3
+ " TLogDBG 'bufname='. bufname('.')
+ let dir = tlib#cache#Dir()
if a:0 >= 1 && !empty(a:1)
let file = a:1
else
@@ -36,7 +68,7 @@ function! tlib#cache#Filename(type, ...) "{{{3
let dir = tlib#dir#PlainName(dir)
" TLogVAR dir
let file = fnamemodify(file, ':t')
- " TLogVAR file, dir
+ " TLogVAR file, dir, mkdir
if mkdir && !isdirectory(dir)
call mkdir(dir, 'p')
endif
@@ -55,6 +87,7 @@ 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"))
@@ -64,3 +97,157 @@ function! tlib#cache#Get(cfile) "{{{3
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)
+ 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 = !empty(glob(tlib#file#Join([dir, '**'])))
+ 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', 'edit'], '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
+ endif
+ 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
+ let files = tlib#cache#ListFilesInCache()
+ let deldir = []
+ let newer = []
+ let msg = []
+ let more = &more
+ set nomore
+ try
+ for file in files
+ if isdirectory(file)
+ if empty(filter(copy(newer), 'strpart(v:val, 0, len(file)) ==# file'))
+ call add(deldir, file)
+ endif
+ else
+ if getftime(file) < threshold
+ if delete(file)
+ 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)
+ endif
+ endif
+ endfor
+ finally
+ let &more = more
+ endtry
+ if !empty(msg)
+ echo join(msg, "\n")
+ endif
+ if !empty(deldir)
+ if &shell =~ 'sh\(\.exe\)\?$'
+ let scriptfile = 'deldir.sh'
+ let rmdir = 'rm -rf %s'
+ else
+ let scriptfile = 'deldir.bat'
+ let rmdir = 'rmdir /S /Q %s'
+ endif
+ let enc = g:tlib#cache#script_encoding
+ if has('multi_byte') && enc != &enc
+ call map(deldir, 'iconv(v:val, &enc, enc)')
+ endif
+ let scriptfile = tlib#file#Join([dir, scriptfile])
+ if filereadable(scriptfile)
+ let script = readfile(scriptfile)
+ else
+ let script = []
+ endif
+ let script += map(copy(deldir), 'printf(rmdir, shellescape(v:val, 1))')
+ let script = tlib#list#Uniq(script)
+ call writefile(script, scriptfile)
+ call inputsave()
+ if g:tlib#cache#run_script == 0
+ echohl WarningMsg
+ 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')
+ if yn =~ '^y\%[es]$'
+ exec 'cd '. fnameescape(dir)
+ exec '! ' &shell shellescape(scriptfile, 1)
+ exec 'cd -'
+ call delete(scriptfile)
+ elseif yn =~ '^e\%[dit]$'
+ exec 'edit '. fnameescape(scriptfile)
+ endif
+ finally
+ call inputrestore()
+ endtry
+ endif
+ endif
+ call s:PurgeTimestamp(dir)
+endf
+
+
+function! s:PurgeTimestamp(dir) "{{{3
+ let last_purge = tlib#file#Join([a:dir, '.last_purge'])
+ " TLogVAR last_purge
+ call writefile([" "], last_purge)
+endf
+
+function! tlib#cache#ListFilesInCache(...) "{{{3
+ let dir = a:0 >= 1 ? a:1 : tlib#cache#Dir('g')
+ if v:version > 702 || (v:version == 702 && has('patch51'))
+ let filess = glob(tlib#file#Join([dir, '**']), 1)
+ else
+ let filess = glob(tlib#file#Join([dir, '**']))
+ endif
+ let files = reverse(split(filess, '\n'))
+ let pos0 = len(tlib#dir#CanonicName(dir))
+ call filter(files, 's:ShouldPurge(strpart(v:val, pos0))')
+ return files
+endf
+
+
+function! s:ShouldPurge(partial_filename) "{{{3
+ " TLogVAR a:partial_filename
+ for rx in g:tlib#cache#dont_purge
+ if a:partial_filename =~ rx
+ " TLogVAR a:partial_filename, rx
+ return 0
+ endif
+ endfor
+ return 1
+endf
+
View
8 autoload/tlib/date.vim
@@ -3,8 +3,8 @@
" @Website: http://www.lithom.net
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 2010-03-25.
-" @Last Change: 2010-03-31.
-" @Revision: 0.0.12
+" @Last Change: 2010-09-13.
+" @Revision: 0.0.16
let s:save_cpo = &cpo
set cpo&vim
@@ -13,7 +13,7 @@ set cpo&vim
if !exists('g:tlib#date#ShortDatePrefix') | let g:tlib#date#ShortDatePrefix = '20' | endif "{{{2
if !exists('g:tlib#date#TimeZoneShift') | let g:tlib#date#TimeZoneShift = 0 | endif "{{{2
-let g:tlib#date#Dayshift = 60 * 60 * 24
+let g:tlib#date#dayshift = 60 * 60 * 24
" :display: tlib#date#DiffInDays(date1, ?date2=localtime(), ?allow_zero=0)
@@ -21,7 +21,7 @@ function! tlib#date#DiffInDays(date, ...)
let allow_zero = a:0 >= 2 ? a:2 : 0
let s0 = tlib#date#SecondsSince1970(a:date, 0, allow_zero)
let s1 = a:0 >= 1 ? tlib#date#SecondsSince1970(a:1, 0, allow_zero) : localtime()
- let dd = (s0 - s1) / g:tlib#date#Dayshift
+ let dd = (s0 - s1) / g:tlib#date#dayshift
" TLogVAR dd
return dd
endf
View
5 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-01-04.
-" @Revision: 0.0.69
+" @Last Change: 2010-04-03.
+" @Revision: 0.0.74
if &cp || exists("loaded_tlib_file_autoload")
finish
@@ -124,3 +124,4 @@ function! tlib#file#With(fcmd, bcmd, files, ...) "{{{3
endfor
endf
+
View
68 autoload/tlib/input.vim
@@ -4,8 +4,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-03-27.
-" @Revision: 0.0.704
+" @Last Change: 2010-09-05.
+" @Revision: 0.0.788
" :filedoc:
@@ -117,6 +117,7 @@ function! tlib#input#ListW(world, ...) "{{{3
TVarArg 'cmd'
let world = a:world
let world.filetype = &filetype
+ let world.fileencoding = &fileencoding
call world.SetMatchMode(tlib#var#Get('tlib_inputlist_match', 'wb'))
call s:Init(world, cmd)
" TLogVAR world.state, world.sticky, world.initial_index
@@ -124,10 +125,23 @@ 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')
+ amenu ]TLibInputListPopupMenu.Pick\ selected\ item <cr>
+ amenu ]TLibInputListPopupMenu.Select #
+ amenu ]TLibInputListPopupMenu.Select\ all <c-a>
+ amenu ]TLibInputListPopupMenu.Reset\ list <c-r>
+ amenu ]TLibInputListPopupMenu.Cancel <esc>
+ amenu ]TLibInputListPopupMenu.-StandardEntries- :
+ endif
for handler in world.key_handlers
let k = get(handler, 'key', '')
if !empty(k)
let key_agents[k] = handler.agent
+ if has('menu') && has_key(handler, 'help') && !empty(handler.help)
+ exec 'amenu ]TLibInputListPopupMenu.'. escape(handler.help, ' .\')
+ \ .' '. handler.key_name
+ let world.has_menu = 1
+ endif
endif
endfor
" let statusline = &l:statusline
@@ -331,6 +345,7 @@ function! tlib#input#ListW(world, ...) "{{{3
elseif has_key(key_agents, c)
let sr = @/
silent! let @/ = lastsearch
+ " TLogVAR c, key_agents[c]
" TLog "Agent: ". string(key_agents[c])
let world = call(key_agents[c], [world, world.GetSelectedItems(world.CurrentItem())])
call s:CheckAgentReturnValue(c, world)
@@ -341,10 +356,9 @@ function! tlib#input#ListW(world, ...) "{{{3
elseif c == 27
let world.state = 'exit empty'
elseif c == "\<LeftMouse>"
- let line = getline(v:mouse_lnum)
- let world.prefidx = substitute(matchstr(line, '^\d\+\ze[*:]'), '^0\+', '', '')
+ let world.prefidx = world.GetLineIdx(v:mouse_lnum)
" let world.offset = world.prefidx
- " TLogVAR v:mouse_lnum, line, world.prefidx
+ " TLogVAR v:mouse_lnum, world.prefidx
if empty(world.prefidx)
" call feedkeys(c, 't')
let c = tlib#char#Get(world.timeout)
@@ -352,6 +366,22 @@ function! tlib#input#ListW(world, ...) "{{{3
continue
endif
throw 'pick'
+ elseif c == "\<RightMouse>"
+ if has('menu')
+ " if v:mouse_lnum != line('.')
+ " endif
+ let world.prefidx = world.GetLineIdx(v:mouse_lnum)
+ let world.state = 'redisplay'
+ call world.DisplayList('')
+ if line('w$') - v:mouse_lnum < 6
+ popup ]TLibInputListPopupMenu
+ else
+ popup! ]TLibInputListPopupMenu
+ endif
+ else
+ let world.state = 'redisplay'
+ endif
+ " TLogVAR world.prefidx, world.state
elseif c >= 32
let world.state = 'display'
let numbase = get(world.numeric_chars, c, -99999)
@@ -490,6 +520,10 @@ function! tlib#input#ListW(world, ...) "{{{3
" let &l:statusline = statusline
" let &laststatus = laststatus
silent! let @/ = lastsearch
+ if has('menu') && world.has_menu
+ silent! aunmenu ]TLibInputListPopupMenu
+ endif
+
" TLogDBG 'finally 2'
" TLogDBG string(world.Methods())
" TLogVAR world.state
@@ -713,3 +747,27 @@ function! s:EditCallback(...) "{{{3
call call(cb, args + [ok, text])
endf
+
+function! tlib#input#Dialog(text, options, default) "{{{3
+ if has('dialog_con') || has('dialog_gui')
+ let opts = join(map(a:options, '"&". v:val'), "\n")
+ let val = confirm(a:text, opts)
+ if val
+ let yn = a:options[val - 1]
+ else
+ let yn = a:default
+ endif
+ else
+ let oi = index(a:options, a:default)
+ if oi == -1
+ let opts = printf("(%s|%s)", join(a:options, '/'), a:default)
+ else
+ let options = copy(a:options)
+ let options[oi] = toupper(options[oi])
+ let opts = printf("(%s)", join(a:options, '/'))
+ endif
+ let yn = inputdialog(a:text .' '. opts)
+ endif
+ return yn
+endf
+
View
15 autoload/tlib/list.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: 2009-08-09.
-" @Revision: 0.0.32
+" @Last Change: 2010-04-03.
+" @Revision: 0.0.34
if &cp || exists("loaded_tlib_list_autoload")
finish
@@ -146,22 +146,23 @@ endf
function! tlib#list#Uniq(list, ...) "{{{3
TVarArg ['get_value', '']
- let s:uniq_values = []
+ let s:uniq_values = {}
if empty(get_value)
call filter(a:list, 's:UniqValue(v:val)')
else
call filter(a:list, 's:UniqValue(eval(printf(get_value, string(v:val))))')
endif
+ unlet s:uniq_values
return a:list
endf
function! s:UniqValue(value) "{{{3
- if index(s:uniq_values, a:value) == -1
- call add(s:uniq_values, a:value)
- return 1
- else
+ if get(s:uniq_values, a:value, 0)
return 0
+ else
+ let s:uniq_values[a:value] = 1
+ return 1
endif
endf
View
6 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: 2010-03-12.
-" @Revision: 0.0.154
+" @Last Change: 2010-05-19.
+" @Revision: 0.0.157
if &cp || exists("loaded_tlib_scratch_autoload")
finish
@@ -84,7 +84,7 @@ function! tlib#scratch#CloseScratch(keyargs, ...) "{{{3
let scratch = get(a:keyargs, 'scratch', '')
" TLogVAR scratch, reset_scratch
" TLogDBG string(tlib#win#List())
- if !empty(scratch)
+ if !empty(scratch) && winnr('$') > 1
let wn = bufwinnr(scratch)
" TLogVAR wn
try
View
107 autoload/tlib/vim.vim
@@ -0,0 +1,107 @@
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @GIT: http://github.com/tomtom/vimtlib/
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2010-07-19.
+" @Last Change: 2010-09-14.
+" @Revision: 23
+
+
+let s:restoreframecmd = ''
+let s:fullscreen = 0
+
+if has('win16') || has('win32') || has('win64')
+
+ if !exists('g:tlib#vim#simalt_maximize')
+ let g:tlib#vim#simalt_maximize = 'x' "{{{2
+ endif
+
+ if !exists('g:tlib#vim#simalt_restore')
+ let g:tlib#vim#simalt_restore = 'r' "{{{2
+ endif
+
+ if !exists('g:tlib#vim#use_vimtweak')
+ let g:tlib#vim#use_vimtweak = 0 "{{{2
+ endif
+
+ " Maximize the window.
+ " You might need to redefine |g:tlib#vim#simalt_maximize| if it doesn't
+ " work for you.
+ fun! tlib#vim#Maximize(fullscreen) "{{{3
+ if !has("gui_running")
+ return
+ endif
+ call s:SaveFrameParams()
+ let s:fullscreen = a:fullscreen
+ if g:tlib#vim#use_vimtweak && a:fullscreen
+ call libcallnr("vimtweak.dll", "EnableCaption", 0)
+ endif
+ exec 'simalt ~'. g:tlib#vim#simalt_maximize
+ endf
+
+ " Restore the original vimsize after having called |tlib#vim#Maximize()|.
+ function! tlib#vim#RestoreWindow() "{{{3
+ if !has("gui_running")
+ return
+ endif
+ if g:tlib#vim#use_vimtweak
+ call libcallnr("vimtweak.dll", "EnableCaption", 1)
+ endif
+ exec 'simalt ~'. g:tlib#vim#simalt_restore
+ call s:RestoreFrameParams()
+ endf
+
+else
+
+ if !exists('g:tlib#vim#use_wmctrl')
+ let g:tlib#vim#use_wmctrl = executable('wmctrl') "{{{2
+ endif
+
+ " :nodoc:
+ fun! tlib#vim#Maximize(fullscreen) "{{{3
+ if !has("gui_running")
+ return
+ endif
+ call s:SaveFrameParams()
+ let s:fullscreen = a:fullscreen
+ if g:tlib#vim#use_wmctrl
+ if a:fullscreen
+ silent !wmctrl -r :ACTIVE: -b add,fullscreen
+ else
+ silent !wmctrl -r :ACTIVE: -b add,maximized_vert,maximized_horz
+ endif
+ else
+ set lines=1000 columns=1000
+ endif
+ endf
+
+ " :nodoc:
+ function! tlib#vim#RestoreWindow() "{{{3
+ if !has("gui_running")
+ return
+ endif
+ if g:tlib#vim#use_wmctrl
+ if s:fullscreen
+ silent !wmctrl -r :ACTIVE: -b remove,fullscreen
+ else
+ silent !wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
+ endif
+ endif
+ call s:RestoreFrameParams()
+ endf
+
+endif
+
+
+function! s:SaveFrameParams() "{{{3
+ let s:restoreframecmd = printf("set lines=%d columns=%d | winpos %d %d", &lines, &columns, getwinposx(), getwinposy())
+endf
+
+
+function! s:RestoreFrameParams() "{{{3
+ if !empty(s:restoreframecmd)
+ exec s:restoreframecmd
+ let s:restoreframecmd = ''
+ endif
+endf
+
View
1,669 doc/tlib.txt
@@ -1,7 +1,6 @@
*tlib.txt* tlib -- A library of vim functions
Author: Tom Link, micathom at gmail com
-
This library provides some utility functions. There isn't much need to
install it unless another plugin requires you to do so.
@@ -58,6 +57,118 @@ 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()|
+ 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#cmd#OutputAsList ................... |tlib#cmd#OutputAsList()|
+ tlib#cmd#BrowseOutput ................... |tlib#cmd#BrowseOutput()|
+ tlib#cmd#UseVertical .................... |tlib#cmd#UseVertical()|
+ tlib#cmd#Time ........................... |tlib#cmd#Time()|
+ tlib#comments#Comments .................. |tlib#comments#Comments()|
+ 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#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#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()|
@@ -100,41 +211,26 @@ Contents~
tlib#agent#PreviewLine .................. |tlib#agent#PreviewLine()|
tlib#agent#GotoLine ..................... |tlib#agent#GotoLine()|
tlib#agent#DoAtLine ..................... |tlib#agent#DoAtLine()|
- 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#autocmdgroup#Init .................. |tlib#autocmdgroup#Init()|
- 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#tag#Retrieve ....................... |tlib#tag#Retrieve()|
+ tlib#tag#Collect ........................ |tlib#tag#Collect()|
+ tlib#tag#Format ......................... |tlib#tag#Format()|
+ 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#char#Get ........................... |tlib#char#Get()|
- tlib#char#IsAvailable ................... |tlib#char#IsAvailable()|
- tlib#char#GetWithTimeout ................ |tlib#char#GetWithTimeout()|
- tlib#cmd#OutputAsList ................... |tlib#cmd#OutputAsList()|
- tlib#cmd#BrowseOutput ................... |tlib#cmd#BrowseOutput()|
- tlib#cmd#UseVertical .................... |tlib#cmd#UseVertical()|
- tlib#cmd#Time ........................... |tlib#cmd#Time()|
- tlib#comments#Comments .................. |tlib#comments#Comments()|
- tlib#date#DiffInDays .................... |tlib#date#DiffInDays()|
- tlib#date#SecondsSince1970 .............. |tlib#date#SecondsSince1970()|
+ tlib#cache#MaybePurge ................... |tlib#cache#MaybePurge()|
+ tlib#cache#Purge ........................ |tlib#cache#Purge()|
+ tlib#cache#ListFilesInCache ............. |tlib#cache#ListFilesInCache()|
+ tlib#map#PumAccept ...................... |tlib#map#PumAccept()|
+ tlib#normal#WithRegister ................ |tlib#normal#WithRegister()|
tlib#dir#CanonicName .................... |tlib#dir#CanonicName()|
tlib#dir#PlainName ...................... |tlib#dir#PlainName()|
tlib#dir#Ensure ......................... |tlib#dir#Ensure()|
@@ -142,23 +238,8 @@ Contents~
tlib#dir#CD ............................. |tlib#dir#CD()|
tlib#dir#Push ........................... |tlib#dir#Push()|
tlib#dir#Pop ............................ |tlib#dir#Pop()|
- tlib#eval#FormatValue ................... |tlib#eval#FormatValue()|
- 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_cnf#New ..................... |tlib#Filter_cnf#New()|
- tlib#Filter_cnfd#New .................... |tlib#Filter_cnfd#New()|
- tlib#Filter_fuzzy#New ................... |tlib#Filter_fuzzy#New()|
- tlib#Filter_seq#New ..................... |tlib#Filter_seq#New()|
- tlib#hook#Run ........................... |tlib#hook#Run()|
- 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#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()|
@@ -170,32 +251,6 @@ Contents~
tlib#list#RemoveAll ..................... |tlib#list#RemoveAll()|
tlib#list#Zip ........................... |tlib#list#Zip()|
tlib#list#Uniq .......................... |tlib#list#Uniq()|
- tlib#map#PumAccept ...................... |tlib#map#PumAccept()|
- tlib#normal#WithRegister ................ |tlib#normal#WithRegister()|
- tlib#notify#Echo ........................ |tlib#notify#Echo()|
- tlib#notify#TrimMessage ................. |tlib#notify#TrimMessage()|
- tlib#Object#New ......................... |tlib#Object#New()|
- prototype.New
- prototype.Inherit
- prototype.Extend
- prototype.IsA
- prototype.IsRelated
- prototype.RespondTo
- prototype.Super
- prototype.Methods
- tlib#paragraph#GetMetric ................ |tlib#paragraph#GetMetric()|
- tlib#paragraph#Move ..................... |tlib#paragraph#Move()|
- tlib#progressbar#Init ................... |tlib#progressbar#Init()|
- tlib#progressbar#Display ................ |tlib#progressbar#Display()|
- tlib#progressbar#Restore ................ |tlib#progressbar#Restore()|
- tlib#rx#Escape .......................... |tlib#rx#Escape()|
- tlib#rx#EscapeReplace ................... |tlib#rx#EscapeReplace()|
- tlib#rx#Suffixes ........................ |tlib#rx#Suffixes()|
- tlib#scratch#UseScratch ................. |tlib#scratch#UseScratch()|
- tlib#scratch#CloseScratch ............... |tlib#scratch#CloseScratch()|
- tlib#signs#ClearAll ..................... |tlib#signs#ClearAll()|
- tlib#signs#ClearBuffer .................. |tlib#signs#ClearBuffer()|
- tlib#signs#Mark ......................... |tlib#signs#Mark()|
tlib#string#RemoveBackslashes ........... |tlib#string#RemoveBackslashes()|
tlib#string#Chomp ....................... |tlib#string#Chomp()|
tlib#string#Format ...................... |tlib#string#Format()|
@@ -204,43 +259,6 @@ Contents~
tlib#string#TrimRight ................... |tlib#string#TrimRight()|
tlib#string#Strip ....................... |tlib#string#Strip()|
tlib#string#Count ....................... |tlib#string#Count()|
- tlib#syntax#Collect ..................... |tlib#syntax#Collect()|
- tlib#syntax#Names ....................... |tlib#syntax#Names()|
- tlib#tab#BufMap ......................... |tlib#tab#BufMap()|
- tlib#tab#TabWinNr ....................... |tlib#tab#TabWinNr()|
- tlib#tab#Set ............................ |tlib#tab#Set()|
- tlib#tag#Retrieve ....................... |tlib#tag#Retrieve()|
- tlib#tag#Collect ........................ |tlib#tag#Collect()|
- tlib#tag#Format ......................... |tlib#tag#Format()|
- tlib#textobjects#StandardParagraph ...... |standard-paragraph|
- tlib#textobjects#Init ................... |tlib#textobjects#Init()|
- v_sp .................................... |v_sp|
- o_sp .................................... |o_sp|
- 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#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#url#Decode ......................... |tlib#url#Decode()|
- tlib#url#DecodeChar ..................... |tlib#url#DecodeChar()|
- tlib#url#EncodeChar ..................... |tlib#url#EncodeChar()|
- tlib#url#Encode ......................... |tlib#url#Encode()|
- 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#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#World#New .......................... |tlib#World#New()|
- prototype.Reset
========================================================================
@@ -331,7 +349,7 @@ g:tlib_scratch_pos (default: 'botright')
Scratch window position
*g:tlib_inputlist_pct*
-g:tlib_inputlist_pct (default: 70)
+g:tlib_inputlist_pct (default: 50)
Size of the input list window (in percent) from the main size (of &lines).
*g:tlib_inputlist_width_filename*
@@ -428,182 +446,337 @@ g:tlib_handlers_EditList
========================================================================
-autoload/tlib/agent.vim~
-Various agents for use as key handlers in tlib#input#List()
+autoload/tlib/autocmdgroup.vim~
- *tlib#agent#Exit()*
-tlib#agent#Exit(world, selected)
+ *tlib#autocmdgroup#Init()*
+tlib#autocmdgroup#Init()
- *tlib#agent#CopyItems()*
-tlib#agent#CopyItems(world, selected)
- *tlib#agent#PageUp()*
-tlib#agent#PageUp(world, selected)
+========================================================================
+autoload/tlib/tab.vim~
- *tlib#agent#PageDown()*
-tlib#agent#PageDown(world, selected)
+ *tlib#tab#BufMap()*
+tlib#tab#BufMap()
+ Return a dictionary of bufnumbers => [[tabpage, winnr] ...]
- *tlib#agent#Up()*
-tlib#agent#Up(world, selected, ...)
+ *tlib#tab#TabWinNr()*
+tlib#tab#TabWinNr(buffer)
+ Find a buffer's window at some tab page.
- *tlib#agent#Down()*
-tlib#agent#Down(world, selected, ...)
+ *tlib#tab#Set()*
+tlib#tab#Set(tabnr)
- *tlib#agent#UpN()*
-tlib#agent#UpN(world, selected)
- *tlib#agent#DownN()*
-tlib#agent#DownN(world, selected)
+========================================================================
+autoload/tlib/paragraph.vim~
- *tlib#agent#ShiftLeft()*
-tlib#agent#ShiftLeft(world, selected)
+ *tlib#paragraph#GetMetric()*
+tlib#paragraph#GetMetric()
+ Return an object describing an |paragraph|.
- *tlib#agent#ShiftRight()*
-tlib#agent#ShiftRight(world, selected)
+ *tlib#paragraph#Move()*
+tlib#paragraph#Move(direction, count)
- *tlib#agent#Reset()*
-tlib#agent#Reset(world, selected)
- *tlib#agent#Input()*
-tlib#agent#Input(world, selected)
+========================================================================
+autoload/tlib/scratch.vim~
- *tlib#agent#SuspendToParentWindow()*
-tlib#agent#SuspendToParentWindow(world, selected)
- Suspend (see |tlib#agent#Suspend|) the input loop and jump back to the
- original position in the parent window.
+ *tlib#scratch#UseScratch()*
+tlib#scratch#UseScratch(?keyargs={})
+ Display a scratch buffer (a buffer with no file). See :TScratch for an
+ example.
+ Return the scratch's buffer number.
- *tlib#agent#Suspend()*
-tlib#agent#Suspend(world, selected)
- Suspend lets you temporarily leave the input loop of
- |tlib#input#List|. You can resume editing the list by pressing <c-z>,
- <m-z>. <space>, <c-LeftMouse> or <MiddleMouse> in the suspended window.
- <cr> and <LeftMouse> will immediatly select the item under the cursor.
- < will select the item but the window will remain opened.
+ *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).
- *tlib#agent#Help()*
-tlib#agent#Help(world, selected)
- *tlib#agent#OR()*
-tlib#agent#OR(world, selected)
+========================================================================
+autoload/tlib/progressbar.vim~
- *tlib#agent#AND()*
-tlib#agent#AND(world, selected)
+ *tlib#progressbar#Init()*
+tlib#progressbar#Init(max, ...)
+ EXAMPLE: >
+ call tlib#progressbar#Init(20)
+ try
+ for i in range(20)
+ call tlib#progressbar#Display(i)
+ call DoSomethingThatTakesSomeTime(i)
+ endfor
+ finally
+ call tlib#progressbar#Restore()
+ endtry
+<
- *tlib#agent#ReduceFilter()*
-tlib#agent#ReduceFilter(world, selected)
+ *tlib#progressbar#Display()*
+tlib#progressbar#Display(value, ...)
- *tlib#agent#PopFilter()*
-tlib#agent#PopFilter(world, selected)
+ *tlib#progressbar#Restore()*
+tlib#progressbar#Restore()
- *tlib#agent#Debug()*
-tlib#agent#Debug(world, selected)
- *tlib#agent#Select()*
-tlib#agent#Select(world, selected)
+========================================================================
+autoload/tlib/Object.vim~
+Provides a prototype plus some OO-like methods.
- *tlib#agent#SelectUp()*
-tlib#agent#SelectUp(world, selected)
+ *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's 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
+<
- *tlib#agent#SelectDown()*
-tlib#agent#SelectDown(world, selected)
+prototype.New
- *tlib#agent#SelectAll()*
-tlib#agent#SelectAll(world, selected)
+prototype.Inherit
- *tlib#agent#ToggleStickyList()*
-tlib#agent#ToggleStickyList(world, selected)
+prototype.Extend
- *tlib#agent#EditItem()*
-tlib#agent#EditItem(world, selected)
+prototype.IsA
- *tlib#agent#NewItem()*
-tlib#agent#NewItem(world, selected)
- Insert a new item below the current one.
+prototype.IsRelated
- *tlib#agent#DeleteItems()*
-tlib#agent#DeleteItems(world, selected)
+prototype.RespondTo
- *tlib#agent#Cut()*
-tlib#agent#Cut(world, selected)
+prototype.Super
- *tlib#agent#Copy()*
-tlib#agent#Copy(world, selected)
+ *tlib#Object#Methods()*
+tlib#Object#Methods(object, ...)
- *tlib#agent#Paste()*
-tlib#agent#Paste(world, selected)
- *tlib#agent#EditReturnValue()*
-tlib#agent#EditReturnValue(world, rv)
+========================================================================
+autoload/tlib/win.vim~
- *tlib#agent#ViewFile()*
-tlib#agent#ViewFile(world, selected)
+ *tlib#win#Set()*
+tlib#win#Set(winnr)
+ Return vim code to jump back to the original window.
- *tlib#agent#EditFile()*
-tlib#agent#EditFile(world, selected)
+ *tlib#win#GetLayout()*
+tlib#win#GetLayout(?save_view=0)
- *tlib#agent#EditFileInSplit()*
-tlib#agent#EditFileInSplit(world, selected)
+ *tlib#win#SetLayout()*
+tlib#win#SetLayout(layout)
- *tlib#agent#EditFileInVSplit()*
-tlib#agent#EditFileInVSplit(world, selected)
+ *tlib#win#List()*
+tlib#win#List()
- *tlib#agent#EditFileInTab()*
-tlib#agent#EditFileInTab(world, selected)
+ *tlib#win#Width()*
+tlib#win#Width(wnr)
+
+ *tlib#win#WinDo()*
+tlib#win#WinDo(ex)
+
+
+========================================================================
+autoload/tlib/cmd.vim~
+
+ *tlib#cmd#OutputAsList()*
+tlib#cmd#OutputAsList(command)
+
+ *tlib#cmd#BrowseOutput()*
+tlib#cmd#BrowseOutput(command)
+ See |:TBrowseOutput|.
+
+ *tlib#cmd#UseVertical()*
+tlib#cmd#UseVertical(?rx='')
+ Look at the history whether the command was called with vertical. If
+ an rx is provided check first if the last entry in the history matches
+ this rx.
+
+ *tlib#cmd#Time()*
+tlib#cmd#Time(cmd)
+ Print the time in seconds a command takes.
+
+
+========================================================================
+autoload/tlib/comments.vim~
+
+ *tlib#comments#Comments()*
+tlib#comments#Comments(...)
+ function! tlib#comments#Comments(?rx='')
+
+
+========================================================================
+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)
+<
+
+ *tlib#char#IsAvailable()*
+tlib#char#IsAvailable()
+
+ *tlib#char#GetWithTimeout()*
+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(...)
+
+prototype.Reset
+
+
+========================================================================
+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/textobjects.vim~
+
+ *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.
+
+ *tlib#textobjects#Init()*
+tlib#textobjects#Init()
+
+ *v_sp*
+v_sp ... <Esc>:call tlib#textobjects#StandardParagraph()<CR>
+ sp ... Standard paragraph (for use as |text-objects|).
+
+ *o_sp*
+o_sp ... :<C-u>normal Vsp<CR>
+
+
+========================================================================
+autoload/tlib/Filter_fuzzy.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 '.\{-}'.
+
+
+========================================================================
+autoload/tlib/file.vim~
+
+ *tlib#file#Split()*
+tlib#file#Split(filename)
+ EXAMPLES: >
+ tlib#file#Split('foo/bar/filename.txt')
+ => ['foo', 'bar', 'filename.txt']
+<
+
+ *tlib#file#Join()*
+tlib#file#Join(filename_parts, ?strip_slashes=0)
+ EXAMPLES: >
+ tlib#file#Join(['foo', 'bar', 'filename.txt'])
+ => 'foo/bar/filename.txt'
+<
- *tlib#agent#ToggleScrollbind()*
-tlib#agent#ToggleScrollbind(world, selected)
+ *tlib#file#Relative()*
+tlib#file#Relative(filename, basedir)
+ EXAMPLES: >
+ tlib#file#Relative('foo/bar/filename.txt', 'foo')
+ => 'bar/filename.txt'
+<
- *tlib#agent#ShowInfo()*
-tlib#agent#ShowInfo(world, selected)
+ *tlib#file#With()*
+tlib#file#With(fcmd, bcmd, files, ?world={})
- *tlib#agent#PreviewLine()*
-tlib#agent#PreviewLine(world, selected)
- *tlib#agent#GotoLine()*
-tlib#agent#GotoLine(world, selected)
- If not called from the scratch, we assume/guess that we don't have to
- suspend the input-evaluation loop.
+========================================================================
+autoload/tlib/Filter_seq.vim~
- *tlib#agent#DoAtLine()*
-tlib#agent#DoAtLine(world, selected)
+ *tlib#Filter_seq#New()*
+tlib#Filter_seq#New(...)
+ 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.
========================================================================
-autoload/tlib/arg.vim~
-
- *tlib#arg#Get()*
-tlib#arg#Get(n, var, ?default="", ?test='')
- Set a positional argument from a variable argument list.
- See tlib#string#RemoveBackslashes() for an example.
+autoload/tlib/date.vim~
- *tlib#arg#Let()*
-tlib#arg#Let(list, ?default='')
- Set a positional arguments from a variable argument list.
- See tlib#input#List() for an example.
+ *tlib#date#DiffInDays()*
+tlib#date#DiffInDays(date1, ?date2=localtime(), ?allow_zero=0)
- *tlib#arg#Key()*
-tlib#arg#Key(dict, list, ?default='')
- See |:TKeyArg|.
+ *tlib#date#SecondsSince1970()*
+tlib#date#SecondsSince1970(date, ...)
+ tlib#date#SecondsSince1970(date, ?daysshift=0, ?allow_zero=0)
- *tlib#arg#StringAsKeyArgs()*
-tlib#arg#StringAsKeyArgs(string, ?keys=[], ?evaluate=0)
- *tlib#arg#Ex()*
-tlib#arg#Ex(arg, ?chars='%#! ')
- Escape some characters in a string.
-
- Use |fnamescape()| if available.
-
- EXAMPLES: >
- exec 'edit '. tlib#arg#Ex('foo%#bar.txt')
-<
+========================================================================
+autoload/tlib/balloon.vim~
+ *tlib#balloon#Register()*
+tlib#balloon#Register(expr)
-========================================================================
-autoload/tlib/autocmdgroup.vim~
+ *tlib#balloon#Remove()*
+tlib#balloon#Remove(expr)
- *tlib#autocmdgroup#Init()*
-tlib#autocmdgroup#Init()
+ *tlib#balloon#Expr()*
+tlib#balloon#Expr()
========================================================================
@@ -682,145 +855,160 @@ tlib#buffer#KeepCursorPosition(cmd)
========================================================================
-autoload/tlib/cache.vim~
-
- *tlib#cache#Filename()*
-tlib#cache#Filename(type, ?file=%, ?mkdir=0)
-
- *tlib#cache#Save()*
-tlib#cache#Save(cfile, dictionary)
+autoload/tlib/Filter_cnfd.vim~
- *tlib#cache#Get()*
-tlib#cache#Get(cfile)
+ *tlib#Filter_cnfd#New()*
+tlib#Filter_cnfd#New(...)
+ The same as |tlib#FilterCNF#New()| but a dot is expanded to '\.\{-}'.
+ As a consequence, patterns cannot match dots.
+ The pattern is a '/\V' very no-'/magic' regexp pattern.
========================================================================
-autoload/tlib/char.vim~
+autoload/tlib/type.vim~
- *tlib#char#Get()*
-tlib#char#Get(?timeout=0)
- Get a character.
-
- EXAMPLES: >
- echo tlib#char#Get()
- echo tlib#char#Get(5)
-<
+ *tlib#type#IsNumber()*
+tlib#type#IsNumber(expr)
- *tlib#char#IsAvailable()*
-tlib#char#IsAvailable()
+ *tlib#type#IsString()*
+tlib#type#IsString(expr)
- *tlib#char#GetWithTimeout()*
-tlib#char#GetWithTimeout(timeout, ...)
+ *tlib#type#IsFuncref()*
+tlib#type#IsFuncref(expr)
+ *tlib#type#IsList()*
+tlib#type#IsList(expr)
-========================================================================
-autoload/tlib/cmd.vim~
+ *tlib#type#IsDictionary()*
+tlib#type#IsDictionary(expr)
- *tlib#cmd#OutputAsList()*
-tlib#cmd#OutputAsList(command)
- *tlib#cmd#BrowseOutput()*
-tlib#cmd#BrowseOutput(command)
- See |:TBrowseOutput|.
+========================================================================
+autoload/tlib/syntax.vim~
- *tlib#cmd#UseVertical()*
-tlib#cmd#UseVertical(?rx='')
- Look at the history whether the command was called with vertical. If
- an rx is provided check first if the last entry in the history matches
- this rx.
+ *tlib#syntax#Collect()*
+tlib#syntax#Collect()
- *tlib#cmd#Time()*
-tlib#cmd#Time(cmd)
- Print the time in seconds a command takes.
+ *tlib#syntax#Names()*
+tlib#syntax#Names(?rx='')
========================================================================
-autoload/tlib/comments.vim~
+autoload/tlib/vim.vim~
- *tlib#comments#Comments()*
-tlib#comments#Comments(...)
- function! tlib#comments#Comments(?rx='')
+ *g:tlib#vim#simalt_maximize*
+g:tlib#vim#simalt_maximize (default: 'x')
+ *g:tlib#vim#simalt_restore*
+g:tlib#vim#simalt_restore (default: 'r')
-========================================================================
-autoload/tlib/date.vim~
+ *g:tlib#vim#use_vimtweak*
+g:tlib#vim#use_vimtweak (default: 0)
- *tlib#date#DiffInDays()*
-tlib#date#DiffInDays(date1, ?date2=localtime(), ?allow_zero=0)
+ *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#date#SecondsSince1970()*
-tlib#date#SecondsSince1970(date, ...)
- tlib#date#SecondsSince1970(date, ?daysshift=0, ?allow_zero=0)
+ *tlib#vim#RestoreWindow()*
+tlib#vim#RestoreWindow()
+ Restore the original vimsize after having called |tlib#vim#Maximize()|.
+
+ *g:tlib#vim#use_wmctrl*
+g:tlib#vim#use_wmctrl (default: executable('wmctrl'))
========================================================================
-autoload/tlib/dir.vim~
+autoload/tlib/hook.vim~
- *tlib#dir#CanonicName()*
-tlib#dir#CanonicName(dirname)
- EXAMPLES: >
- tlib#dir#CanonicName('foo/bar')
- => 'foo/bar/'
-<
+ *tlib#hook#Run()*
+tlib#hook#Run(hook, ?dict={})
+ Execute dict[hook], w:{hook}, b:{hook}, or g:{hook} if existent.
- *tlib#dir#PlainName()*
-tlib#dir#PlainName(dirname)
- EXAMPLES: >
- tlib#dir#PlainName('foo/bar/')
- => 'foo/bar'
-<
- *tlib#dir#Ensure()*
-tlib#dir#Ensure(dir)
- Create a directory if it doesn't already exist.
+========================================================================
+autoload/tlib/eval.vim~
- *tlib#dir#MyRuntime()*
-tlib#dir#MyRuntime()
- Return the first directory in &rtp.
+ *tlib#eval#FormatValue()*
+tlib#eval#FormatValue(value, ...)
- *tlib#dir#CD()*
-tlib#dir#CD(dir, ?locally=0)
- *tlib#dir#Push()*
-tlib#dir#Push(dir, ?locally=0)
+========================================================================
+autoload/tlib/arg.vim~
- *tlib#dir#Pop()*
-tlib#dir#Pop()
+ *tlib#arg#Get()*
+tlib#arg#Get(n, var, ?default="", ?test='')
+ Set a positional argument from a variable argument list.
+ See tlib#string#RemoveBackslashes() for an example.
+
+ *tlib#arg#Let()*
+tlib#arg#Let(list, ?default='')
+ Set a positional arguments from a variable argument list.
+ See tlib#input#List() for an example.
+ *tlib#arg#Key()*
+tlib#arg#Key(dict, list, ?default='')
+ See |:TKeyArg|.
-========================================================================
-autoload/tlib/eval.vim~
+ *tlib#arg#StringAsKeyArgs()*
+tlib#arg#StringAsKeyArgs(string, ?keys=[], ?evaluate=0)
- *tlib#eval#FormatValue()*
-tlib#eval#FormatValue(value, ...)
+ *tlib#arg#Ex()*
+tlib#arg#Ex(arg, ?chars='%#! ')
+ Escape some characters in a string.
+
+ Use |fnamescape()| if available.
+
+ EXAMPLES: >
+ exec 'edit '. tlib#arg#Ex('foo%#bar.txt')
+<
========================================================================
-autoload/tlib/file.vim~
+autoload/tlib/var.vim~
- *tlib#file#Split()*
-tlib#file#Split(filename)
+ *tlib#var#Let()*
+tlib#var#Let(name, val)
+ Define a variable called NAME if yet undefined.
+ You can also use the :TLLet command.
+
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:')
========================================================================
@@ -836,41 +1024,39 @@ tlib#Filter_cnf#New(...)
========================================================================
-autoload/tlib/Filter_cnfd.vim~
-
- *tlib#Filter_cnfd#New()*
-tlib#Filter_cnfd#New(...)
- The same as |tlib#FilterCNF#New()| but a dot is expanded to '\.\{-}'.
- As a consequence, patterns cannot match dots.
- The pattern is a '/\V' very no-'/magic' regexp pattern.
+autoload/tlib/rx.vim~
+ *tlib#rx#Escape()*
+tlib#rx#Escape(text, ?magic='m')
+ magic can be one of: m, M, v, V
+ See :help 'magic'
-========================================================================
-autoload/tlib/Filter_fuzzy.vim~
+ *tlib#rx#EscapeReplace()*
+tlib#rx#EscapeReplace(text, ?magic='m')
+ Escape return |sub-replace-special|.
- *tlib#Filter_fuzzy#New()*
-tlib#Filter_fuzzy#New(...)
- Support for "fuzzy" pattern matching in |tlib#input#List()|.
- Characters are interpreted as if connected with '.\{-}'.
+ *tlib#rx#Suffixes()*
+tlib#rx#Suffixes(...)
========================================================================
-autoload/tlib/Filter_seq.vim~
+autoload/tlib/url.vim~
- *tlib#Filter_seq#New()*
-tlib#Filter_seq#New(...)
- 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.
+ *tlib#url#Decode()*
+tlib#url#Decode(url)
+ Decode an encoded URL.
+ *tlib#url#DecodeChar()*
+tlib#url#DecodeChar(char)
+ Decode a single character.
-========================================================================
-autoload/tlib/hook.vim~
+ *tlib#url#EncodeChar()*
+tlib#url#EncodeChar(char)
+ Encode a single character.
- *tlib#hook#Run()*
-tlib#hook#Run(hook, ?dict={})
- Execute dict[hook], w:{hook}, b:{hook}, or g:{hook} if existent.
+ *tlib#url#Encode()*
+tlib#url#Encode(url, ...)
+ Encode an url.
========================================================================
@@ -924,379 +1110,187 @@ tlib#input#ListW(world, ?command='')
The same as |tlib#input#List| but the arguments are packed into world
(an instance of tlib#World as returned by |tlib#World#New|).
- *tlib#input#EditList()*
-tlib#input#EditList(query, list, ?timeout=0)
- Edit a list.
-
- EXAMPLES: >
- echo tlib#input#EditList('Edit:', [100,200,300])
-<
-
- *tlib#input#Resume()*
-tlib#input#Resume(name, pick)
-
- *tlib#input#CommandSelect()*
-tlib#input#CommandSelect(command, ?keyargs={})
- Take a command, view the output, and let the user select an item from
- its output.
-
- EXAMPLE: >
- command! TMarks exec 'norm! `'. matchstr(tlib#input#CommandSelect('marks'), '^ \+\zs.')
- command! TAbbrevs exec 'norm i'. matchstr(tlib#input#CommandSelect('abbrev'), '^\S\+\s\+\zs\S\+')
-<
-
- *tlib#input#Edit()*
-tlib#input#Edit(name, value, callback, ?cb_args=[])
-
- Edit a value (asynchronously) in a scratch buffer. Use name for
- identification. Call callback when done (or on cancel).
- In the scratch buffer:
- Press <c-s> or <c-w><cr> to enter the new value, <c-w>c to cancel
- editing.
- EXAMPLES: >
- fun! FooContinue(success, text)
- if a:success
- let b:var = a:text
- endif
- endf
- call tlib#input#Edit('foo', b:var, 'FooContinue')
-<
-
-
-========================================================================
-autoload/tlib/list.vim~
-
- *tlib#list#Inject()*
-tlib#list#Inject(list, initial_value, funcref)
- EXAMPLES: >
- echo tlib#list#Inject([1,2,3], 0, function('Add')
- => 6
-<
-
- *tlib#list#Compact()*
-tlib#list#Compact(list)
- EXAMPLES: >
- tlib#list#Compact([0,1,2,3,[], {}, ""])
- => [1,2,3]
-<
-
- *tlib#list#Flatten()*
-tlib#list#Flatten(list)
- EXAMPLES: >
- tlib#list#Flatten([0,[1,2,[3,""]]])
- => [0,1,2,3,""]
-<
-
- *tlib#list#FindAll()*
-tlib#list#FindAll(list, filter, ?process_expr="")
- Basically the same as filter()
-
- EXAMPLES: >
- tlib#list#FindAll([1,2,3], 'v:val >= 2')
- => [2, 3]
-<
-
- *tlib#list#Find()*
-tlib#list#Find(list, filter, ?default="", ?process_expr="")
-
- EXAMPLES: >
- tlib#list#Find([1,2,3], 'v:val >= 2')
- => 2
-<
-
- *tlib#list#Any()*
-tlib#list#Any(list, expr)
- EXAMPLES: >
- tlib#list#Any([1,2,3], 'v:val >= 2')
- => 1
-<
-
- *tlib#list#All()*
-tlib#list#All(list, expr)
- EXAMPLES: >
- tlib#list#All([1,2,3], 'v:val >= 2')
- => 0
-<
-
- *tlib#list#Remove()*
-tlib#list#Remove(list, element)
- EXAMPLES: >
- tlib#list#Remove([1,2,1,2], 2)
- => [1,1,2]
-<
-
- *tlib#list#RemoveAll()*
-tlib#list#RemoveAll(list, element)
- EXAMPLES: >
- tlib#list#RemoveAll([1,2,1,2], 2)
- => [1,1]
-<
-
- *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#list#Uniq()*
-tlib#list#Uniq(list, ...)
-
-
-========================================================================
-autoload/tlib/map.vim~
-
- *tlib#map#PumAccept()*
-tlib#map#PumAccept(key)
- If |pumvisible()| is true, return "\<c-y>". Otherwise return a:key.
- For use in maps like: >
- imap <expr> <cr> tlib#map#PumAccept("\<cr>")
-<
-
-
-========================================================================
-autoload/tlib/normal.vim~
-
- *tlib#normal#WithRegister()*
-tlib#normal#WithRegister(cmd, ...)
-
-
-========================================================================
-autoload/tlib/notify.vim~
-
- *tlib#notify#Echo()*
-tlib#notify#Echo(text, ...)
- 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 doesn't 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/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's 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
-<
-
-
-prototype.New
-
-
-prototype.Inherit
-
-
-prototype.Extend
-
-
-prototype.IsA
-
-
-prototype.IsRelated
-
-
-prototype.RespondTo
+ *tlib#input#EditList()*
+tlib#input#EditList(query, list, ?timeout=0)
+ Edit a list.
+
+ EXAMPLES: >
+ echo tlib#input#EditList('Edit:', [100,200,300])
+<
+ *tlib#input#Resume()*
+tlib#input#Resume(name, pick)
-prototype.Super
+ *tlib#input#CommandSelect()*
+tlib#input#CommandSelect(command, ?keyargs={})
+ Take a command, view the output, and let the user select an item from
+ its output.
+
+ EXAMPLE: >
+ command! TMarks exec 'norm! `'. matchstr(tlib#input#CommandSelect('marks'), '^ \+\zs.')
+ command! TAbbrevs exec 'norm i'. matchstr(tlib#input#CommandSelect('abbrev'), '^\S\+\s\+\zs\S\+')
+<
+ *tlib#input#Edit()*
+tlib#input#Edit(name, value, callback, ?cb_args=[])
+
+ Edit a value (asynchronously) in a scratch buffer. Use name for
+ identification. Call callback when done (or on cancel).
+ In the scratch buffer:
+ Press <c-s> or <c-w><cr> to enter the new value, <c-w>c to cancel
+ editing.
+ EXAMPLES: >
+ fun! FooContinue(success, text)
+ if a:success
+ let b:var = a:text
+ endif
+ endf
+ call tlib#input#Edit('foo', b:var, 'FooContinue')
+<
-prototype.Methods
+ *tlib#input#Dialog()*
+tlib#input#Dialog(text, options, default)
========================================================================
-autoload/tlib/paragraph.vim~
+autoload/tlib/agent.vim~
+Various agents for use as key handlers in tlib#input#List()
- *tlib#paragraph#GetMetric()*
-tlib#paragraph#GetMetric()
- Return an object describing an |paragraph|.
+ *tlib#agent#Exit()*
+tlib#agent#Exit(world, selected)
- *tlib#paragraph#Move()*
-tlib#paragraph#Move(direction, count)
+ *tlib#agent#CopyItems()*
+tlib#agent#CopyItems(world, selected)
+ *tlib#agent#PageUp()*
+tlib#agent#PageUp(world, selected)
-========================================================================
-autoload/tlib/progressbar.vim~
+ *tlib#agent#PageDown()*
+tlib#agent#PageDown(world, selected)
- *tlib#progressbar#Init()*
-tlib#progressbar#Init(max, ...)
- EXAMPLE: >
- call tlib#progressbar#Init(20)
- try
- for i in range(20)
- call tlib#progressbar#Display(i)
- call DoSomethingThatTakesSomeTime(i)
- endfor
- finally
- call tlib#progressbar#Restore()
- endtry
-<
+ *tlib#agent#Up()*
+tlib#agent#Up(world, selected, ...)
- *tlib#progressbar#Display()*
-tlib#progressbar#Display(value, ...)
+ *tlib#agent#Down()*
+tlib#agent#Down(world, selected, ...)
- *tlib#progressbar#Restore()*
-tlib#progressbar#Restore()
+ *tlib#agent#UpN()*
+tlib#agent#UpN(world, selected)
+ *tlib#agent#DownN()*
+tlib#agent#DownN(world, selected)
-========================================================================
-autoload/tlib/rx.vim~
+ *tlib#agent#ShiftLeft()*
+tlib#agent#ShiftLeft(world, selected)
- *tlib#rx#Escape()*
-tlib#rx#Escape(text, ?magic='m')
- magic can be one of: m, M, v, V
- See :help 'magic'
+ *tlib#agent#ShiftRight()*
+tlib#agent#ShiftRight(world, selected)
- *tlib#rx#EscapeReplace()*
-tlib#rx#EscapeReplace(text, ?magic='m')
- Escape return |sub-replace-special|.
+ *tlib#agent#Reset()*
+tlib#agent#Reset(world, selected)
- *tlib#rx#Suffixes()*
-tlib#rx#Suffixes(...)
+ *tlib#agent#Input()*
+tlib#agent#Input(world, selected)
+ *tlib#agent#SuspendToParentWindow()*
+tlib#agent#SuspendToParentWindow(world, selected)
+ Suspend (see |tlib#agent#Suspend|) the input loop and jump back to the
+ original position in the parent window.
-========================================================================
-autoload/tlib/scratch.vim~
+ *tlib#agent#Suspend()*
+tlib#agent#Suspend(world, selected)
+ Suspend lets you temporarily leave the input loop of
+ |tlib#input#List|. You can resume editing the list by pressing <c-z>,
+ <m-z>. <space>, <c-LeftMouse> or <MiddleMouse> in the suspended window.
+ <cr> and <LeftMouse> will immediatly select the item under the cursor.
+ < will select the item but the window will remain opened.
- *tlib#scratch#UseScratch()*
-tlib#scratch#UseScratch(?keyargs={})
- Display a scratch buffer (a buffer with no file). See :TScratch for an
- example.
- Return the scratch's buffer number.
+ *tlib#agent#Help()*
+tlib#agent#Help(world, selected)
- *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).
+ *tlib#agent#OR()*
+tlib#agent#OR(world, selected)
+ *tlib#agent#AND()*
+tlib#agent#AND(world, selected)
-========================================================================
-autoload/tlib/signs.vim~
+ *tlib#agent#ReduceFilter()*
+tlib#agent#ReduceFilter(world, selected)
- *tlib#signs#ClearAll()*
-tlib#signs#ClearAll(sign)
- Clear all signs with name SIGN.
+ *tlib#agent#PopFilter()*
+tlib#agent#PopFilter(world, selected)
- *tlib#signs#ClearBuffer()*
-tlib#signs#ClearBuffer(sign, bufnr)
- Clear all signs with name SIGN in buffer BUFNR.
+ *tlib#agent#Debug()*
+tlib#agent#Debug(world, selected)
- *tlib#signs#Mark()*
-tlib#signs#Mark(sign, list)
- Add signs for all locations in LIST. LIST must confirm with the
- quickfix list format (see |getqflist()|; only the fields lnum and
- bufnr are required).
-
- list:: a quickfix or location list
- sign:: a sign defined with |:sign-define|
+ *tlib#agent#Select()*
+tlib#agent#Select(world, selected)
+ *tlib#agent#SelectUp()*
+tlib#agent#SelectUp(world, selected)
-========================================================================
-autoload/tlib/string.vim~
+ *tlib#agent#SelectDown()*
+tlib#agent#SelectDown(world, selected)
- *tlib#string#RemoveBackslashes()*
-tlib#string#RemoveBackslashes(text, ?chars=' ')
- Remove backslashes from text (but only in front of the characters in
- chars).
+ *tlib#agent#SelectAll()*
+tlib#agent#SelectAll(world, selected)
- *tlib#string#Chomp()*
-tlib#string#Chomp(string)
+ *tlib#agent#ToggleStickyList()*
+tlib#agent#ToggleStickyList(world, selected)
- *tlib#string#Format()*
-tlib#string#Format(template, dict)
+ *tlib#agent#EditItem()*
+tlib#agent#EditItem(world, selected)
- *tlib#string#Printf1()*
-tlib#string#Printf1(format, string)
- This function deviates from |printf()| in certain ways.
- Additional items:
- %{rx} ... insert escaped regexp
- %{fuzzyrx} ... insert typo-tolerant regexp
+ *tlib#agent#NewItem()*
+tlib#agent#NewItem(world, selected)
+ Insert a new item below the current one.
- *tlib#string#TrimLeft()*
-tlib#string#TrimLeft(string)
+ *tlib#agent#DeleteItems()*
+tlib#agent#DeleteItems(world, selected)
- *tlib#string#TrimRight()*
-tlib#string#TrimRight(string)
+ *tlib#agent#Cut()*
+tlib#agent#Cut(world, selected)
- *tlib#string#Strip()*
-tlib#string#Strip(string)
+ *tlib#agent#Copy()*
+tlib#agent#Copy(world, selected)
- *tlib#string#Count()*
-tlib#string#Count(string, rx)
+ *tlib#agent#Paste()*
+tlib#agent#Paste(world, selected)
+ *tlib#agent#EditReturnValue()*
+tlib#agent#EditReturnValue(world, rv)
-========================================================================
-autoload/tlib/syntax.vim~
+ *tlib#agent#ViewFile()*
+tlib#agent#ViewFile(world, selected)
- *tlib#syntax#Collect()*
-tlib#syntax#Collect()
+ *tlib#agent#EditFile()*
+tlib#agent#EditFile(world, selected)
- *tlib#syntax#Names()*
-tlib#syntax#Names(?rx='')
+ *tlib#agent#EditFileInSplit()*
+tlib#agent#EditFileInSplit(world, selected)
+ *tlib#agent#EditFileInVSplit()*
+tlib#agent#EditFileInVSplit(world, selected)
-========================================================================
-autoload/tlib/tab.vim~
+ *tlib#agent#EditFileInTab()*
+tlib#agent#EditFileInTab(world, selected)
- *tlib#tab#BufMap()*
-tlib#tab#BufMap()
- Return a dictionary of bufnumbers => [[tabpage, winnr] ...]
+ *tlib#agent#ToggleScrollbind()*
+tlib#agent#ToggleScrollbind(world, selected)
- *tlib#tab#TabWinNr()*
-tlib#tab#TabWinNr(buffer)
- Find a buffer's window at some tab page.
+ *tlib#agent#ShowInfo()*
+tlib#agent#ShowInfo(world, selected)
- *tlib#tab#Set()*
-tlib#tab#Set(tabnr)
+ *tlib#agent#PreviewLine()*
+tlib#agent#PreviewLine(world, selected)
+
+ *tlib#agent#GotoLine()*
+tlib#agent#GotoLine(world, selected)
+ If not called from the scratch, we assume/guess that we don't have to
+ suspend the input-evaluation loop.
+
+ *tlib#agent#DoAtLine()*
+tlib#agent#DoAtLine(world, selected)
========================================================================
@@ -1340,165 +1334,266 @@ tlib#tag#Format(tag)
========================================================================
-autoload/tlib/textobjects.vim~
+autoload/tlib/signs.vim~
+
+ *tlib#signs#ClearAll()*
+tlib#signs#ClearAll(sign)
+ Clear all signs with name SIGN.
+
+ *tlib#signs#ClearBuffer()*
+tlib#signs#ClearBuffer(sign, bufnr)
+ Clear all signs with name SIGN in buffer BUFNR.
+
+ *tlib#signs#Mark()*
+tlib#signs#Mark(sign, list)
+ Add signs for all locations in LIST. LIST must confirm with the
+ quickfix list format (see |getqflist()|; only the fields lnum and
+ bufnr are required).
+
+ list:: a quickfix or location list
+ sign:: a sign defined with |:sign-define|
+
+
+========================================================================
+autoload/tlib/cache.vim~
- *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#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.
+
+ *g:tlib#cache#script_encoding*
+g:tlib#cache#script_encoding (default: &enc)
+ The encoding used for the purge-cache script.
+ Default: 'enc'
+
+ *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
+
+ *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()|.
+
+ *tlib#cache#Dir()*
+tlib#cache#Dir(?mode = 'bg')
+ The default cache directory
- *tlib#textobjects#Init()*
-tlib#textobjects#Init()
+ *tlib#cache#Filename()*
+tlib#cache#Filename(type, ?file=%, ?mkdir=0)
- *v_sp*
-v_sp ... <Esc>:call tlib#textobjects#StandardParagraph()<CR>
- sp ... Standard paragraph (for use as |text-objects|).
+ *tlib#cache#Save()*
+tlib#cache#Save(cfile, dictionary)
- *o_sp*
-o_sp ... :<C-u>normal Vsp<CR>
+ *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/time.vim~
+autoload/tlib/map.vim~
- *tlib#time#MSecs()*
-tlib#time#MSecs()
+ *tlib#map#PumAccept()*
+tlib#map#PumAccept(key)
+ If |pumvisible()| is true, return "\<c-y>". Otherwise return a:key.
+ For use in maps like: >
+ imap <expr> <cr> tlib#map#PumAccept("\<cr>")
+<
- *tlib#time#Now()*
-tlib#time#Now()
- *tlib#time#Diff()*
-tlib#time#Diff(a, b, ...)
+========================================================================
+autoload/tlib/normal.vim~
- *tlib#time#DiffMSecs()*
-tlib#time#DiffMSecs(a, b, ...)
+ *tlib#normal#WithRegister()*
+tlib#normal#WithRegister(cmd, ...)
========================================================================
-autoload/tlib/type.vim~
+autoload/tlib/dir.vim~
- *tlib#type#IsNumber()*
-tlib#type#IsNumber(expr)
+ *tlib#dir#CanonicName()*
+tlib#dir#CanonicName(dirname)
+ EXAMPLES: >
+ tlib#dir#CanonicName('foo/bar')
+ => 'foo/bar/'
+<
- *tlib#type#IsString()*
-tlib#type#IsString(expr)
+ *tlib#dir#PlainName()*
+tlib#dir#PlainName(dirname)
+ EXAMPLES: >
+ tlib#dir#PlainName('foo/bar/')
+ => 'foo/bar'
+<
- *tlib#type#IsFuncref()*
-tlib#type#IsFuncref(expr)
+ *tlib#dir#Ensure()*
+tlib#dir#Ensure(dir)
+ Create a directory if it doesn't already exist.
- *tlib#type#IsList()*
-tlib#type#IsList(expr)
+ *tlib#dir#MyRuntime()*
+tlib#dir#MyRuntime()
+ Return the first directory in &rtp.
- *tlib#type#IsDictionary()*
-tlib#type#IsDictionary(expr)
+ *tlib#dir#CD()*
+tlib#dir#CD(dir, ?locally=0)
+ *tlib#dir#Push()*
+tlib#dir#Push(dir, ?locally=0)
-========================================================================
-autoload/tlib/url.vim~
+ *tlib#dir#Pop()*
+tlib#dir#Pop()
- *tlib#url#Decode()*
-tlib#url#Decode(url)
- Decode an encoded URL.
- *tlib#url#DecodeChar()*
-tlib#url#DecodeChar(char)
- Decode a single character.
+===========================================================