aboutsummaryrefslogtreecommitdiff
path: root/vim/bundle/tlib_vim/macros/tlib.vim
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2016-06-30 16:03:25 +0200
committerKarel Kočí <cynerd@email.cz>2016-06-30 16:03:25 +0200
commite573b3020c032400eed60b649a2cbf55266e6bb0 (patch)
tree8f572394ac8433529c7a8e70d160a2fbe8268b4e /vim/bundle/tlib_vim/macros/tlib.vim
parentb8c667bd64b3edd38d56c63c5bd1db53a23b4499 (diff)
downloadmyconfigs-e573b3020c032400eed60b649a2cbf55266e6bb0.tar.gz
myconfigs-e573b3020c032400eed60b649a2cbf55266e6bb0.tar.bz2
myconfigs-e573b3020c032400eed60b649a2cbf55266e6bb0.zip
Add current configurations from old repository
Diffstat (limited to 'vim/bundle/tlib_vim/macros/tlib.vim')
-rw-r--r--vim/bundle/tlib_vim/macros/tlib.vim38
1 files changed, 38 insertions, 0 deletions
diff --git a/vim/bundle/tlib_vim/macros/tlib.vim b/vim/bundle/tlib_vim/macros/tlib.vim
new file mode 100644
index 0000000..3e5a791
--- /dev/null
+++ b/vim/bundle/tlib_vim/macros/tlib.vim
@@ -0,0 +1,38 @@
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @GIT: http://github.com/tomtom/tlib_vim/
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Last Change: 2015-11-09.
+" @Revision: 10
+
+if &cp || exists("loaded_tlib_macros")
+ finish
+endif
+let loaded_tlib_macros = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+
+" :display: :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.
+command! -nargs=+ TRequire let s:require = [<f-args>]
+ \ | if !exists('loaded_'. get(s:require, 0))
+ \ | exec 'runtime '. get(s:require, 2, 'plugin/'. get(s:require, 0) .'.vim')
+ \ | if !exists('loaded_'. get(s:require, 0)) || loaded_{get(s:require, 0)} < get(s:require, 1, loaded_{get(s:require, 0)})
+ \ | echoerr 'Require '. get(s:require, 0) .' >= '. get(s:require, 1, 'any version will do')
+ \ | finish
+ \ | endif
+ \ | endif | unlet s:require
+
+
+" :display: :Ttimecommand CMD
+" Time the execution time of CMD.
+command! -nargs=1 -complete=command Ttimecommand call tlib#cmd#Time(<q-args>)
+
+
+let &cpo = s:save_cpo
+unlet s:save_cpo