diff --git a/autoload/SpaceVim/layers/lang/c.vim b/autoload/SpaceVim/layers/lang/c.vim index 652c891bb..d0103ac9c 100644 --- a/autoload/SpaceVim/layers/lang/c.vim +++ b/autoload/SpaceVim/layers/lang/c.vim @@ -40,10 +40,16 @@ +let s:use_libclang = 0 + function! SpaceVim#layers#lang#c#plugins() abort let plugins = [] if has('nvim') - call add(plugins, ['tweekmonster/deoplete-clang2']) + if s:use_libclang + call add(plugins, ['zchee/deoplete-clang']) + else + call add(plugins, ['tweekmonster/deoplete-clang2']) + endif else call add(plugins, ['Rip-Rip/clang_complete']) endif @@ -56,6 +62,13 @@ function! SpaceVim#layers#lang#c#config() abort call SpaceVim#mapping#space#regesit_lang_mappings('c', funcref('s:language_specified_mappings')) endfunction +function! SpaceVim#layers#lang#c#set_variable(var) abort + " use clang or libclang + let s:use_libclang = get(a:var, + \ 'use_libclang', + \ 'clang') +endfunction + function! s:language_specified_mappings() abort call SpaceVim#mapping#space#langSPC('nmap', ['l','r'], diff --git a/docs/layers/lang/c.md b/docs/layers/lang/c.md new file mode 100644 index 000000000..91a8ef9dd --- /dev/null +++ b/docs/layers/lang/c.md @@ -0,0 +1,26 @@ +--- +title: "SpaceVim lang#c layer" +description: "This layer is for c/c++/object-c development" +--- + +# [Layers](https://spacevim.org/layers) > lang#c + + + + +- [Description](#description) +- [Layer Installation](#layer-installation) +- [Key bindings](#key-bindings) + + + +## Description + +This layer is for c/c++/object-c development. + +## Layer Installation + +To use this configuration layer, add `SPLayer 'lang#java'` to your custom configuration file. + +## Key bindings +