From f3287aa3042e02c4da116be44f027f0903670e07 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Wed, 18 Jan 2017 20:25:25 +0800 Subject: [PATCH 1/4] Add link for layers --- autoload/SpaceVim.vim | 2 +- doc/SpaceVim.txt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/autoload/SpaceVim.vim b/autoload/SpaceVim.vim index 0542571c0..a70131ac9 100644 --- a/autoload/SpaceVim.vim +++ b/autoload/SpaceVim.vim @@ -240,7 +240,7 @@ endfunction "" -" Load the {layer} you want, for more info see `:h SpaceVim-layers`. +" Load the {layer} you want, for all the layers SpaceVim supported, see @section(layers). function! SpaceVim#Layer(layer) abort if index(g:spacevim_plugin_groups, a:layer) == -1 call add(g:spacevim_plugin_groups, a:layer) diff --git a/doc/SpaceVim.txt b/doc/SpaceVim.txt index 79771d7cf..b001995ac 100644 --- a/doc/SpaceVim.txt +++ b/doc/SpaceVim.txt @@ -182,7 +182,8 @@ twitter. FUNCTIONS *SpaceVim-functions* SpaceVim#Layer({layer}) *SpaceVim#Layer()* - Load the {layer} you want, for more info see `:h SpaceVim-layers`. + Load the {layer} you want, for all the layers SpaceVim supported, see + |SpaceVim-layers|. SpaceVim#logger#setLevel({level}) *SpaceVim#logger#setLevel()* Set debug level of SpaceVim, by default it is 1. all message will be logged. From 3345d722af7f474132f4ac76b4cc7e7cc8935596 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Wed, 18 Jan 2017 20:52:19 +0800 Subject: [PATCH 2/4] Add doc for lang#php layer --- autoload/SpaceVim.vim | 22 ---------------------- autoload/SpaceVim/layers.vim | 12 ++++++++++++ autoload/SpaceVim/layers/lang/php.vim | 13 +++++++++++++ doc/SpaceVim.txt | 12 +----------- 4 files changed, 26 insertions(+), 33 deletions(-) create mode 100644 autoload/SpaceVim/layers.vim diff --git a/autoload/SpaceVim.vim b/autoload/SpaceVim.vim index a70131ac9..73257f382 100644 --- a/autoload/SpaceVim.vim +++ b/autoload/SpaceVim.vim @@ -224,28 +224,6 @@ function! SpaceVim#loadCustomConfig() abort endif endfunction -"" -" @section Layers, layers -" SpaceVim support such layers: -" -" core : core plugins for SpaceVim. -" -" autocompletion : Plugins for autocompletion, -" -" maker : syntax checker -" -" unite : unite centric work-flow -" -" lang#java : java autocompletion and syntax checker - - -"" -" Load the {layer} you want, for all the layers SpaceVim supported, see @section(layers). -function! SpaceVim#Layer(layer) abort - if index(g:spacevim_plugin_groups, a:layer) == -1 - call add(g:spacevim_plugin_groups, a:layer) - endif -endfunction function! SpaceVim#end() abort if !empty(g:spacevim_windows_leader) diff --git a/autoload/SpaceVim/layers.vim b/autoload/SpaceVim/layers.vim new file mode 100644 index 000000000..a0f7a15ae --- /dev/null +++ b/autoload/SpaceVim/layers.vim @@ -0,0 +1,12 @@ +"" +" @section Layers, layers +" SpaceVim support such layers: + + +"" +" Load the {layer} you want, for all the layers SpaceVim supported, see @section(layers). +function! SpaceVim#layers#load(layer) abort + if index(g:spacevim_plugin_groups, a:layer) == -1 + call add(g:spacevim_plugin_groups, a:layer) + endif +endfunction diff --git a/autoload/SpaceVim/layers/lang/php.vim b/autoload/SpaceVim/layers/lang/php.vim index d20a44529..cfed1359a 100644 --- a/autoload/SpaceVim/layers/lang/php.vim +++ b/autoload/SpaceVim/layers/lang/php.vim @@ -1,3 +1,16 @@ +" lang#php : +" this layer is for php development, and it provide auto codo completion, +" and syntax check, and jump to the definition location. +" +" requirement: +" PHP 5.3+ +" PCNTL Extension +" Msgpack 0.5.7+(for NeoVim) Extension or JSON(for Vim 7.4+) Extension +" Composer Project +" + + + function! SpaceVim#layers#lang#php#plugins() abort let plugins = [] if has('nvim') diff --git a/doc/SpaceVim.txt b/doc/SpaceVim.txt index b001995ac..2824f0eee 100644 --- a/doc/SpaceVim.txt +++ b/doc/SpaceVim.txt @@ -181,7 +181,7 @@ twitter. ============================================================================== FUNCTIONS *SpaceVim-functions* -SpaceVim#Layer({layer}) *SpaceVim#Layer()* +SpaceVim#layers#load({layer}) *SpaceVim#layers#load()* Load the {layer} you want, for all the layers SpaceVim supported, see |SpaceVim-layers|. @@ -203,15 +203,5 @@ LAYERS *SpaceVim-layers* SpaceVim support such layers: - core : core plugins for SpaceVim. - - autocompletion : Plugins for autocompletion, - - maker : syntax checker - - unite : unite centric work-flow - - lang#java : java autocompletion and syntax checker - vim:tw=78:ts=8:ft=help:norl: From c4058ac7271cb6561e1585cf8b26403b3b0f8db7 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Wed, 18 Jan 2017 23:35:37 +0800 Subject: [PATCH 3/4] Add clang plugin --- autoload/SpaceVim/layers/lang/c.vim | 21 +++++++++++++++++++++ config/plugins/deoplete-clang.vim | 4 ++++ 2 files changed, 25 insertions(+) create mode 100644 autoload/SpaceVim/layers/lang/c.vim create mode 100644 config/plugins/deoplete-clang.vim diff --git a/autoload/SpaceVim/layers/lang/c.vim b/autoload/SpaceVim/layers/lang/c.vim new file mode 100644 index 000000000..20d07d818 --- /dev/null +++ b/autoload/SpaceVim/layers/lang/c.vim @@ -0,0 +1,21 @@ +" lang#c : +" +" this layer provide c family language code completion. +" +" requirement: +" clang +" libclang + +function! SpaceVim#layers#lang#c#plugins() abort + let plugins = [] + if has('nvim') + call add(plugins, ['zchee/deoplete-clang']) + else + call add(plugins, ['Rip-Rip/clang_complete']) + endif + return plugins +endfunction + +function! SpaceVim#layers#lang#c#config() abort + +endfunction diff --git a/config/plugins/deoplete-clang.vim b/config/plugins/deoplete-clang.vim new file mode 100644 index 000000000..da222ebc2 --- /dev/null +++ b/config/plugins/deoplete-clang.vim @@ -0,0 +1,4 @@ +let g:deoplete#sources#clang#libclang_path = + \ get(g:, 'deoplete#sources#clang#libclang_path', '/usr/lib/libclang.so') +let g:deoplete#sources#clang#clang_header = + \ get(g:, 'deoplete#sources#clang#clang_header', '/usr/lib/clang/') From 76937c968c788b7ffd9ef8dab6f0d80becea161b Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Wed, 18 Jan 2017 23:56:06 +0800 Subject: [PATCH 4/4] Change to clang2 --- autoload/SpaceVim/layers/lang/c.vim | 2 +- config/plugins/deoplete.vim | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/autoload/SpaceVim/layers/lang/c.vim b/autoload/SpaceVim/layers/lang/c.vim index 20d07d818..6fb28facd 100644 --- a/autoload/SpaceVim/layers/lang/c.vim +++ b/autoload/SpaceVim/layers/lang/c.vim @@ -9,7 +9,7 @@ function! SpaceVim#layers#lang#c#plugins() abort let plugins = [] if has('nvim') - call add(plugins, ['zchee/deoplete-clang']) + call add(plugins, ['tweekmonster/deoplete-clang2']) else call add(plugins, ['Rip-Rip/clang_complete']) endif diff --git a/config/plugins/deoplete.vim b/config/plugins/deoplete.vim index 9baf62b26..ee511fbcd 100644 --- a/config/plugins/deoplete.vim +++ b/config/plugins/deoplete.vim @@ -17,7 +17,9 @@ let g:deoplete#omni_patterns = get(g:, 'deoplete#omni_patterns', {}) let g:deoplete#omni_patterns.php = '->\|::' let g:deoplete#ignore_sources = {} let g:deoplete#ignore_sources.go = ['omni'] +let g:deoplete#ignore_sources.c = ['omni'] call deoplete#custom#set('go', 'mark', '') +call deoplete#custom#set('clang2', 'mark', '') if g:spacevim_enable_javacomplete2_py let g:deoplete#ignore_sources.java = ['omni'] call deoplete#custom#set('javacomplete2', 'mark', '')