Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Option handling with xolox#misc#option#get({name}, {default})

  • Loading branch information...
commit e228b0e4e2cece3bbcbd3a752e7c718a455ab7c6 1 parent 38996d3
Peter Odding authored June 26, 2011

Showing 1 changed file with 11 additions and 1 deletion. Show diff stats Hide diff stats

  1. 12  option.vim
12  option.vim
... ...
@@ -1,8 +1,18 @@
1 1
 " Vim auto-load script
2 2
 " Author: Peter Odding <peter@peterodding.com>
3  
-" Last Change: March 15, 2011
  3
+" Last Change: June 26, 2011
4 4
 " URL: http://peterodding.com/code/vim/misc/
5 5
 
  6
+function! xolox#misc#option#get(name, default)
  7
+  if exists('g:' . a:name)
  8
+    return eval('g:' . a:name)
  9
+  elseif exists('b:' . a:name)
  10
+    return eval('b:' . a:name)
  11
+  else
  12
+    return a:default
  13
+  endif
  14
+endfunction
  15
+
6 16
 " Functions to parse multi-valued Vim options like &tags and &runtimepath.
7 17
 
8 18
 function! xolox#misc#option#split(value)

0 notes on commit e228b0e

Please sign in to comment.
Something went wrong with that request. Please try again.