diff options
author | Peter Odding <peter@peterodding.com> | 2011-06-27 02:46:26 +0200 |
---|---|---|
committer | Peter Odding <peter@peterodding.com> | 2011-06-27 02:46:26 +0200 |
commit | 82d2b7eb53f57bdae77e0f9f1ad2b8a0bf9dcac5 (patch) | |
tree | f7473c5a5956b5e580d07f59ccaf2cb62c0fe9ed | |
parent | 67616b25971ff0f4d785d67592128909ef5a5e49 (diff) | |
parent | 0b1c06ef1d296590b23bbe4da46faeef6541a8ba (diff) | |
download | vim-easytags-82d2b7eb53f57bdae77e0f9f1ad2b8a0bf9dcac5.tar.gz |
Merge branch 'master' of https://github.com/xolox/vim-misc
-rw-r--r-- | autoload/xolox/misc/option.vim | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/autoload/xolox/misc/option.vim b/autoload/xolox/misc/option.vim index 8c6d63d..8727ea1 100644 --- a/autoload/xolox/misc/option.vim +++ b/autoload/xolox/misc/option.vim @@ -1,15 +1,18 @@ " Vim auto-load script " Author: Peter Odding <peter@peterodding.com> -" Last Change: June 26, 2011 +" Last Change: June 27, 2011 " URL: http://peterodding.com/code/vim/misc/ -function! xolox#misc#option#get(name, default) - if exists('g:' . a:name) - return eval('g:' . a:name) - elseif exists('b:' . a:name) +function! xolox#misc#option#get(name, ...) + if exists('b:' . a:name) + " Buffer local variable. return eval('b:' . a:name) - else - return a:default + elseif exists('g:' . a:name) + " Global variable. + return eval('g:' . a:name) + elseif exists('a:1') + " Default value. + return a:1 endif endfunction |