2 " @Author: Thomas Link (micathom AT gmail com?subject=[vim])
3 " @Website: http://www.vim.org/account/profile.php?user_id=4037
4 " @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5 " @Created: 2007-08-23.
6 " @Last Change: 2008-03-06.
9 if &cp || exists("loaded_tlib_cmd_autoload")
12 let loaded_tlib_cmd_autoload = 1
15 function! tlib#cmd#OutputAsList(command) "{{{3
18 silent! exec a:command
20 return split(lines, '\n')
24 " See |:TBrowseOutput|.
25 function! tlib#cmd#BrowseOutput(command) "{{{3
26 let list = tlib#cmd#OutputAsList(a:command)
27 let cmd = tlib#input#List('s', 'Output of: '. a:command, list)
29 call feedkeys(':'. cmd)
34 " :def: function! tlib#cmd#UseVertical(?rx='')
35 " Look at the history whether the command was called with vertical. If
36 " an rx is provided check first if the last entry in the history matches
38 function! tlib#cmd#UseVertical(...) "{{{3
41 let rx0 = '\C\<vert\%[ical]\>\s\+'
50 " Print the time in seconds a command takes.
51 function! tlib#cmd#Time(cmd) "{{{3
52 let start = localtime()
54 echom 'Time: '. (localtime() - start) .'s: '. a:cmd