1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 23:10:04 +08:00

Update lang#c layer (#3899)

This commit is contained in:
Wang Shidong 2020-10-15 22:56:52 +08:00 committed by GitHub
parent 4ddf18da36
commit 0004826efe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 2 deletions

View File

@ -19,7 +19,8 @@ function! SpaceVim#commands#load() abort
"" ""
" Set or check SpaceVim option. {opt} should be the option name of " Set or check SpaceVim option. {opt} should be the option name of
" spacevim, This command will use [value] as the value of option name. " spacevim, This command will use [value] as the value of option name.
command! -nargs=+ SPSet call SpaceVim#options#set(<f-args>) command! -nargs=+ -complete=custom,SpaceVim#commands#complete_options
\ SPSet call SpaceVim#options#set(<f-args>)
"" ""
" print the debug information of spacevim, [!] forces the output into a " print the debug information of spacevim, [!] forces the output into a
" new buffer. " new buffer.
@ -296,5 +297,9 @@ function! s:SHA() abort
return '-' . sha return '-' . sha
endfunction endfunction
function! SpaceVim#commands#complete_options(...)
return join(map(getcompletion('g:spacevim_','var'), 'v:val[11:]'), "\n")
endfunction
" vim:set et sw=2 cc=80: " vim:set et sw=2 cc=80:

View File

@ -119,7 +119,7 @@ function! SpaceVim#layers#lang#c#plugins() abort
elseif g:spacevim_autocomplete_method ==# 'asyncomplete' elseif g:spacevim_autocomplete_method ==# 'asyncomplete'
call add(plugins, ['wsdjeg/asyncomplete-clang.vim', {'merged' : 0, 'loadconf' : 1}]) call add(plugins, ['wsdjeg/asyncomplete-clang.vim', {'merged' : 0, 'loadconf' : 1}])
else else
call add(plugins, ['Rip-Rip/clang_complete']) call add(plugins, ['Rip-Rip/clang_complete', {'if' : s:CPT.has('python') || s:CPT.has('python3')}])
endif endif
endif endif

View File

@ -56,6 +56,13 @@ This option requires `+python` or `+python3` enabled and `libclang` has been ins
By default the autocomplete layer has been enabled, so after loading `lang#c` layer, the code completion By default the autocomplete layer has been enabled, so after loading `lang#c` layer, the code completion
for C/C++ language should works well. for C/C++ language should works well.
If the `autocomplete_method` is `deoplete`, then `Shougo/deoplete-clangx` will be loaded in `lang#c` layer.
If the `autocomplete_method` is `asyncomplete`, then `wsdjeg/asyncomplete-clang.vim` will be loaded.
If the `autocomplete_method` is `neocomplete`, Then `Rip-Rip/clang_complete` will be loaded.
You can check the value of `autocomplete_method` via `:SPSet autocomplete_method`.
### alternate file jumping ### alternate file jumping