mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-23 17:49:57 +08:00
Merge branch 'commands' into dev
This commit is contained in:
commit
108520708e
@ -348,6 +348,7 @@ function! SpaceVim#default() abort
|
|||||||
call SpaceVim#default#SetOptions()
|
call SpaceVim#default#SetOptions()
|
||||||
call SpaceVim#default#SetPlugins()
|
call SpaceVim#default#SetPlugins()
|
||||||
call SpaceVim#default#SetMappings()
|
call SpaceVim#default#SetMappings()
|
||||||
|
call SpaceVim#commands#load()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! SpaceVim#defindFuncs() abort
|
function! SpaceVim#defindFuncs() abort
|
||||||
|
14
autoload/SpaceVim/commands.vim
Normal file
14
autoload/SpaceVim/commands.vim
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
function! SpaceVim#commands#load() abort
|
||||||
|
""
|
||||||
|
" Load exist layer, {layers} can be a string of a layer name, or a list
|
||||||
|
" of layer names.
|
||||||
|
command! -nargs=+ SPLayer call SpaceVim#layers#load(<f-args>)
|
||||||
|
""
|
||||||
|
" 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>)
|
||||||
|
""
|
||||||
|
" print the debug information of spacevim, [!] forces the output into a
|
||||||
|
" new buffer.
|
||||||
|
command! -nargs=0 -bang SPDebugInfo echo SpaceVim#logger#viewLog('<bang>' == '!')
|
||||||
|
endfunction
|
@ -5,10 +5,15 @@
|
|||||||
|
|
||||||
""
|
""
|
||||||
" Load the {layer} you want. For all the layers SpaceVim supports, see @section(layers).
|
" Load the {layer} you want. For all the layers SpaceVim supports, see @section(layers).
|
||||||
function! SpaceVim#layers#load(layer) abort
|
function! SpaceVim#layers#load(layer, ...) abort
|
||||||
if index(g:spacevim_plugin_groups, a:layer) == -1
|
if index(g:spacevim_plugin_groups, a:layer) == -1
|
||||||
call add(g:spacevim_plugin_groups, a:layer)
|
call add(g:spacevim_plugin_groups, a:layer)
|
||||||
endif
|
endif
|
||||||
|
if a:0 > 1
|
||||||
|
for l in a:000
|
||||||
|
call SpaceVim#layers#load(l)
|
||||||
|
endfor
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" vim:set et sw=2:
|
" vim:set et sw=2:
|
||||||
|
@ -74,7 +74,23 @@ function! SpaceVim#logger#viewLog(...) abort
|
|||||||
\ . s:levels[l] . "\]'"), "\n")
|
\ . s:levels[l] . "\]'"), "\n")
|
||||||
endif
|
endif
|
||||||
let info .= "\n```\n"
|
let info .= "\n```\n"
|
||||||
return info
|
if a:0 > 0
|
||||||
|
if a:1 == 1
|
||||||
|
tabnew +setl\ nobuflisted
|
||||||
|
nnoremap <buffer><silent> q :bd!<CR>
|
||||||
|
for msg in split(info, "\n")
|
||||||
|
call append(line('$'), msg)
|
||||||
|
endfor
|
||||||
|
normal! "_dd
|
||||||
|
setl nomodifiable
|
||||||
|
setl buftype=nofile
|
||||||
|
setl filetype=markdown
|
||||||
|
else
|
||||||
|
return info
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
return info
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
""
|
""
|
||||||
|
@ -13,6 +13,18 @@ function! SpaceVim#options#list() abort
|
|||||||
return list
|
return list
|
||||||
endfunction
|
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
|
||||||
|
|
||||||
function! s:execute(cmd) abort
|
function! s:execute(cmd) abort
|
||||||
if exists('*execute')
|
if exists('*execute')
|
||||||
return split(execute(a:cmd), "\n")
|
return split(execute(a:cmd), "\n")
|
||||||
|
@ -18,8 +18,9 @@ wsdjeg *spacevim* *SpaceVim*
|
|||||||
CONTENTS *SpaceVim-contents*
|
CONTENTS *SpaceVim-contents*
|
||||||
1. Introduction.............................................|SpaceVim-intro|
|
1. Introduction.............................................|SpaceVim-intro|
|
||||||
2. CONFIGURATION...........................................|SpaceVim-config|
|
2. CONFIGURATION...........................................|SpaceVim-config|
|
||||||
3. Functions............................................|SpaceVim-functions|
|
3. Commands..............................................|SpaceVim-commands|
|
||||||
4. Layers..................................................|SpaceVim-layers|
|
4. Functions............................................|SpaceVim-functions|
|
||||||
|
5. Layers..................................................|SpaceVim-layers|
|
||||||
1. Default............................................|SpaceVim-default|
|
1. Default............................................|SpaceVim-default|
|
||||||
2. autocomplete..................................|SpaceVim-autocomplete|
|
2. autocomplete..................................|SpaceVim-autocomplete|
|
||||||
3. checkers....................................|SpaceVim-layer-checkers|
|
3. checkers....................................|SpaceVim-layer-checkers|
|
||||||
@ -41,7 +42,7 @@ CONTENTS *SpaceVim-contents*
|
|||||||
19. operator...................................|SpaceVim-layer-operator|
|
19. operator...................................|SpaceVim-layer-operator|
|
||||||
20. shell.........................................|SpaceVim-layer-shell|
|
20. shell.........................................|SpaceVim-layer-shell|
|
||||||
21. tmux...........................................|SpaceVim-layer-tmux|
|
21. tmux...........................................|SpaceVim-layer-tmux|
|
||||||
5. FAQ........................................................|SpaceVim-faq|
|
6. FAQ........................................................|SpaceVim-faq|
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
INTRODUCTION *SpaceVim-intro*
|
INTRODUCTION *SpaceVim-intro*
|
||||||
@ -265,6 +266,21 @@ vim to start up slowly if there are too many files in the current directory.
|
|||||||
The host file url. This option is for Chinese users who can not use Google and
|
The host file url. This option is for Chinese users who can not use Google and
|
||||||
Twitter.
|
Twitter.
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
COMMANDS *SpaceVim-commands*
|
||||||
|
|
||||||
|
:SPLayer {layers} *:SPLayer*
|
||||||
|
Load exist layer, {layers} can be a string of a layer name, or a list of
|
||||||
|
layer names.
|
||||||
|
|
||||||
|
: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.
|
||||||
|
|
||||||
|
:SPDebugInfo[!] *:SPDebugInfo*
|
||||||
|
print the debug information of spacevim, [!] forces the output into a new
|
||||||
|
buffer.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
FUNCTIONS *SpaceVim-functions*
|
FUNCTIONS *SpaceVim-functions*
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user