Skip to content

Commit

Permalink
Option handling with xolox#misc#option#get({name}, {default})
Browse files Browse the repository at this point in the history
  • Loading branch information
xolox committed Jun 26, 2011
1 parent 38996d3 commit e228b0e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion option.vim
@@ -1,8 +1,18 @@
" Vim auto-load script " Vim auto-load script
" Author: Peter Odding <peter@peterodding.com> " Author: Peter Odding <peter@peterodding.com>
" Last Change: March 15, 2011 " Last Change: June 26, 2011
" URL: http://peterodding.com/code/vim/misc/ " 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)
return eval('b:' . a:name)
else
return a:default
endif
endfunction

" Functions to parse multi-valued Vim options like &tags and &runtimepath. " Functions to parse multi-valued Vim options like &tags and &runtimepath.


function! xolox#misc#option#split(value) function! xolox#misc#option#split(value)
Expand Down

0 comments on commit e228b0e

Please sign in to comment.