mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 17:40:06 +08:00
Add SPVersion command
This commit is contained in:
parent
8477030590
commit
743232f74a
@ -4,6 +4,11 @@ function! SpaceVim#commands#load() abort
|
||||
" of layer names.
|
||||
command! -nargs=+ SPLayer call SpaceVim#layers#load(<f-args>)
|
||||
""
|
||||
" Print the version of SpaceVim. The following lines contain information
|
||||
" about which features were enabled. When there is a preceding '+', the
|
||||
" feature is included, when there is a '-' it is excluded.
|
||||
command! -nargs=0 SPVersion call SpaceVim#commands#version()
|
||||
""
|
||||
" Set or check SpaceVim option. {opt} should be the option name of
|
||||
" spacevim, This command will use [value] as the value of option name.
|
||||
command! -nargs=+ SPSet call SpaceVim#options#set(<f-args>)
|
||||
@ -42,4 +47,122 @@ function! SpaceVim#commands#config(...) abort
|
||||
endfunction
|
||||
|
||||
|
||||
function! SpaceVim#commands#version() abort
|
||||
echo 'SpaceVim ' . g:spacevim_version . '-' . "\n" .
|
||||
\ "\n" .
|
||||
\ 'Optional features included (+) or not (-):' . "\n"
|
||||
\ s:check_features([
|
||||
\ 'tui',
|
||||
\ 'jemalloc',
|
||||
\ 'acl',
|
||||
\ 'arabic',
|
||||
\ 'autocmd',
|
||||
\ 'browse',
|
||||
\ 'byte_offset',
|
||||
\ 'cindent',
|
||||
\ 'clientserver',
|
||||
\ 'clipboard',
|
||||
\ 'cmdline_compl',
|
||||
\ 'cmdline_hist',
|
||||
\ 'cmdline_info',
|
||||
\ 'comments',
|
||||
\ 'conceal',
|
||||
\ 'cscope',
|
||||
\ 'cursorbind',
|
||||
\ 'cursorshape',
|
||||
\ 'debug',
|
||||
\ 'dialog_gui',
|
||||
\ 'dialog_con',
|
||||
\ 'dialog_con_gui',
|
||||
\ 'digraphs',
|
||||
\ 'eval',
|
||||
\ 'ex_extra',
|
||||
\ 'extra_search',
|
||||
\ 'farsi',
|
||||
\ 'file_in_path',
|
||||
\ 'find_in_path',
|
||||
\ 'folding',
|
||||
\ 'gettext',
|
||||
\ 'iconv',
|
||||
\ 'iconv/dyn',
|
||||
\ 'insert_expand',
|
||||
\ 'jumplist',
|
||||
\ 'keymap',
|
||||
\ 'langmap',
|
||||
\ 'libcall',
|
||||
\ 'linebreak',
|
||||
\ 'lispindent',
|
||||
\ 'listcmds',
|
||||
\ 'localmap',
|
||||
\ 'menu',
|
||||
\ 'mksession',
|
||||
\ 'modify_fname',
|
||||
\ 'mouse',
|
||||
\ 'mouseshape',
|
||||
\ 'multi_byte',
|
||||
\ 'multi_byte_ime',
|
||||
\ 'multi_lang',
|
||||
\ 'path_extra',
|
||||
\ 'persistent_undo',
|
||||
\ 'postscript',
|
||||
\ 'printer',
|
||||
\ 'profile',
|
||||
\ 'python',
|
||||
\ 'python3',
|
||||
\ 'quickfix',
|
||||
\ 'reltime',
|
||||
\ 'rightleft',
|
||||
\ 'scrollbind',
|
||||
\ 'shada',
|
||||
\ 'signs',
|
||||
\ 'smartindent',
|
||||
\ 'startuptime',
|
||||
\ 'statusline',
|
||||
\ 'syntax',
|
||||
\ 'tablineat',
|
||||
\ 'tag_binary',
|
||||
\ 'tag_old_static',
|
||||
\ 'tag_any_white',
|
||||
\ 'termguicolors',
|
||||
\ 'terminfo',
|
||||
\ 'termresponse',
|
||||
\ 'textobjects',
|
||||
\ 'tgetent',
|
||||
\ 'timers',
|
||||
\ 'title',
|
||||
\ 'toolbar',
|
||||
\ 'user_commands',
|
||||
\ 'vertsplit',
|
||||
\ 'virtualedit',
|
||||
\ 'visual',
|
||||
\ 'visualextra',
|
||||
\ 'vreplace',
|
||||
\ 'wildignore',
|
||||
\ 'wildmenu',
|
||||
\ 'windows',
|
||||
\ 'writebackup',
|
||||
\ 'xim',
|
||||
\ 'xfontset',
|
||||
\ 'xpm',
|
||||
\ 'xpm_w32',
|
||||
\ ])
|
||||
endfunction
|
||||
|
||||
function! s:check_features(features) abort
|
||||
let flist = map(a:features, "(has(v:val) ? '+' : '-') . v:val")
|
||||
let rst = ' '
|
||||
let id = 1
|
||||
for f in flist
|
||||
let rst .= f . repeat(' ', 20 - len(f))
|
||||
if id == 3
|
||||
let rst .= "\n "
|
||||
let id = 1
|
||||
else
|
||||
let id += 1
|
||||
endif
|
||||
endfor
|
||||
return substitute(rst, '\n*\s*$', '', 'g')
|
||||
endfunction
|
||||
|
||||
|
||||
" vim:set et sw=2 cc=80:
|
||||
|
@ -276,6 +276,11 @@ COMMANDS *SpaceVim-commands*
|
||||
Load exist layer, {layers} can be a string of a layer name, or a list of
|
||||
layer names.
|
||||
|
||||
:SPVersion *:SPVersion*
|
||||
Print the version of SpaceVim. The following lines contain information
|
||||
about which features were enabled. When there is a preceding '+', the
|
||||
feature is included, when there is a '-' it is excluded.
|
||||
|
||||
:SPSet {opt} [value] *:SPSet*
|
||||
Set or check SpaceVim option. {opt} should be the option name of spacevim,
|
||||
This command will use [value] as the value of option name.
|
||||
|
Loading…
Reference in New Issue
Block a user