2018-02-19 22:07:04 +08:00
|
|
|
"=============================================================================
|
|
|
|
" options.vim --- options function in SpaceVim
|
2022-02-03 17:24:51 +08:00
|
|
|
" Copyright (c) 2016-2022 Wang Shidong & Contributors
|
2022-03-27 13:38:54 +08:00
|
|
|
" Author: Wang Shidong < wsdjeg@outlook.com >
|
2018-02-19 22:07:04 +08:00
|
|
|
" URL: https://spacevim.org
|
|
|
|
" License: GPLv3
|
|
|
|
"=============================================================================
|
2022-04-15 17:13:41 +08:00
|
|
|
let s:CMP = SpaceVim#api#import('vim#compatible')
|
2018-02-19 22:07:04 +08:00
|
|
|
|
2017-01-24 00:16:35 +08:00
|
|
|
function! SpaceVim#options#list() abort
|
2017-03-06 23:26:26 +08:00
|
|
|
let list = []
|
2018-04-09 20:07:27 +08:00
|
|
|
if has('patch-7.4.2010')
|
2017-03-06 23:26:26 +08:00
|
|
|
for var in getcompletion('g:spacevim_','var')
|
2018-07-28 15:25:12 +08:00
|
|
|
call add(list, ' ' . var[11:] . ' = ' . string(get(g:, var[2:] , '')))
|
2017-03-06 23:26:26 +08:00
|
|
|
endfor
|
|
|
|
else
|
|
|
|
redraw
|
2022-04-15 17:13:41 +08:00
|
|
|
for var in filter(map(split(s:CMP.execute('let g:'), "\n"), "matchstr(v:val, '\\S\\+')"), "v:val =~# '^spacevim_'")
|
2018-07-28 15:25:12 +08:00
|
|
|
call add(list, ' ' . var[11:] . ' = ' . string(get(g:, var , '')))
|
2017-03-06 23:26:26 +08:00
|
|
|
endfor
|
|
|
|
endif
|
|
|
|
return list
|
2017-01-24 00:16:35 +08:00
|
|
|
endfunction
|
2017-01-31 21:11:31 +08:00
|
|
|
|
2017-03-07 23:31:51 +08:00
|
|
|
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
|
|
|
|
|
2017-03-06 23:26:26 +08:00
|
|
|
" vim:set et sw=2:
|