1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-09 17:30:05 +08:00
SpaceVim/autoload/SpaceVim/options.vim
Wang Shidong 5fbd92c607
Use deoplete only for vim8 (#1604)
* Use deoplete only for vim8

* Use deoplete only for vim8

* Fix gui fonts

* Fix 74

* Fix up

* Fix issue
2018-04-09 20:07:27 +08:00

38 lines
1.1 KiB
VimL

"=============================================================================
" options.vim --- options function in SpaceVim
" Copyright (c) 2016-2017 Wang Shidong & Contributors
" Author: Wang Shidong < wsdjeg at 163.com >
" URL: https://spacevim.org
" License: GPLv3
"=============================================================================
let s:CPT = SpaceVim#api#import('vim#compatible')
function! SpaceVim#options#list() abort
let list = []
if has('patch-7.4.2010')
for var in getcompletion('g:spacevim_','var')
call add(list, var . ' = ' . string(get(g:, var[2:] , '')))
endfor
else
redraw
for var in filter(map(split(s:CPT.execute('let g:'), "\n"), "matchstr(v:val, '\\S\\+')"), "v:val =~# '^spacevim_'")
call add(list,'g:' . var . ' = ' . string(get(g:, var , '')))
endfor
endif
return list
endfunction
function! SpaceVim#options#set(argv, ...) abort
if a:0 > 0
if exists('g:spacevim_' . a:argv)
exe 'let g:spacevim_' . a:argv . '=' . a:1
endif
else
if exists('g:spacevim_' . a:argv)
exe 'echo string(g:spacevim_' . a:argv . ')'
endif
endif
endfunction
" vim:set et sw=2: