From 0edafe873c4987c0e9faf2da1a5bfd7a10c36ce2 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Wed, 25 Jan 2017 20:04:17 +0800 Subject: [PATCH 1/3] Fix ycm support --- autoload/SpaceVim.vim | 8 +++++-- autoload/SpaceVim/layers/autocomplete.vim | 18 ++++++++++++--- doc/SpaceVim.txt | 28 +++++++++++++++++++---- 3 files changed, 44 insertions(+), 10 deletions(-) diff --git a/autoload/SpaceVim.vim b/autoload/SpaceVim.vim index 65763c65c..8f9bec153 100644 --- a/autoload/SpaceVim.vim +++ b/autoload/SpaceVim.vim @@ -2,7 +2,7 @@ " @section Introduction, intro " @stylized Maktaba " @library -" @order intro version dicts functions exceptions layers colorscheme layer_lang_java layer_lang_php layer_lang_c +" @order intro version dicts functions exceptions layers autocomplete colorscheme layer_lang_java layer_lang_php layer_lang_c faq " SpaceVim is a Modular configuration, a bundle of custom settings " and plugins, for Vim. It got inspired by spacemacs. @@ -74,7 +74,7 @@ let g:spacevim_enable_neomake = 1 " < let g:spacevim_guifont = '' "" -" Enable ycm or not, but default it is 0. +" Disable/Enable YouCompleteMe, by default it is disabled. To enable it: " > " let g:spacevim_enable_ycm = 1 " < @@ -300,3 +300,7 @@ function! SpaceVim#welcome() abort wincmd p Startify endfunction + +"" +" @section FAQ, faq +" 1. How to enable YouCompleteMe? diff --git a/autoload/SpaceVim/layers/autocomplete.vim b/autoload/SpaceVim/layers/autocomplete.vim index 70335b636..33ada32e3 100644 --- a/autoload/SpaceVim/layers/autocomplete.vim +++ b/autoload/SpaceVim/layers/autocomplete.vim @@ -1,3 +1,15 @@ +"" +" @section Autocomplete, autocomplete +" SpaceVim use neocomplete as default completion engine for vim with lua +" support, if has no lua support neocomplcache will be the completion engine. +" SpaceVim use deoplete as default completion engine for nevoim. to make +" neovim support python, please read neovim's |provider-python|. +" +" SpaceVim include YouCompleteMe, but it is disabled by default, to enable +" ycm, see |g:spacevim_enable_ycm|. + + + function! SpaceVim#layers#autocomplete#plugins() abort let plugins = [ \ ['honza/vim-snippets', {'on_i' : 1, 'loadconf_before' : 1}], @@ -10,9 +22,9 @@ function! SpaceVim#layers#autocomplete#plugins() abort \ ['Shougo/neopairs.vim', { 'on_i' : 1}], \ ] if g:spacevim_autocomplete_method ==# 'ycm' - call add(plugins, ['SirVer/ultisnips', {'loadconf_before' : 1}]) - call add(plugins, ['ervandew/supertab', {'loadconf_before' : 1}]) - call add(plugins, ['Valloric/YouCompleteMe', {'loadconf_before' : 1}]) + call add(plugins, ['SirVer/ultisnips', {'loadconf_before' : 1, 'merged' : 0}]) + call add(plugins, ['ervandew/supertab', {'loadconf_before' : 1, 'merged' : 0}]) + call add(plugins, ['Valloric/YouCompleteMe', {'loadconf_before' : 1, 'merged' : 0}]) elseif g:spacevim_autocomplete_method ==# 'neocomplete' "{{{ call add(plugins, ['Shougo/neocomplete', { \ 'on_i' : 1, diff --git a/doc/SpaceVim.txt b/doc/SpaceVim.txt index 07c098c85..6438091e2 100644 --- a/doc/SpaceVim.txt +++ b/doc/SpaceVim.txt @@ -7,10 +7,12 @@ CONTENTS *SpaceVim-contents* 2. Configuration...........................................|SpaceVim-config| 3. Functions............................................|SpaceVim-functions| 4. Layers..................................................|SpaceVim-layers| - 5. Colorscheme........................................|SpaceVim-colorscheme| - 6. Layer_lang_java................................|SpaceVim-layer_lang_java| - 7. Layer_lang_php..................................|SpaceVim-layer_lang_php| - 8. Layer_lang_c......................................|SpaceVim-layer_lang_c| + 5. Autocomplete......................................|SpaceVim-autocomplete| + 6. Colorscheme........................................|SpaceVim-colorscheme| + 7. Layer_lang_java................................|SpaceVim-layer_lang_java| + 8. Layer_lang_php..................................|SpaceVim-layer_lang_php| + 9. Layer_lang_c......................................|SpaceVim-layer_lang_c| + 10. FAQ.......................................................|SpaceVim-faq| ============================================================================== INTRODUCTION *SpaceVim-intro* @@ -78,7 +80,7 @@ set the guifont of Spacevim, default is empty. < *g:spacevim_enable_ycm* -Enable ycm or not, but default it is 0. +Disable/Enable YouCompleteMe, by default it is disabled. To enable it: > let g:spacevim_enable_ycm = 1 < @@ -223,6 +225,17 @@ LAYERS *SpaceVim-layers* SpaceVim support such layers: +============================================================================== +AUTOCOMPLETE *SpaceVim-autocomplete* + +SpaceVim use neocomplete as default completion engine for vim with lua +support, if has no lua support neocomplcache will be the completion engine. +SpaceVim use deoplete as default completion engine for nevoim. to make neovim +support python, please read neovim's |provider-python|. + +SpaceVim include YouCompleteMe, but it is disabled by default, to enable ycm, +see |g:spacevim_enable_ycm|. + ============================================================================== COLORSCHEME *SpaceVim-colorscheme* @@ -419,5 +432,10 @@ lang#c : requirement: clang libclang +============================================================================== +FAQ *SpaceVim-faq* + + 1. How to enable YouCompleteMe? + vim:tw=78:ts=8:ft=help:norl: From adc661810dce19feab297c7c3e5f5d7fb4e81cd8 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Wed, 25 Jan 2017 20:44:05 +0800 Subject: [PATCH 2/3] Add install faq for ycm --- autoload/SpaceVim.vim | 19 ++++++++++++++++++- doc/SpaceVim.txt | 20 +++++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/autoload/SpaceVim.vim b/autoload/SpaceVim.vim index 8f9bec153..831eff8bc 100644 --- a/autoload/SpaceVim.vim +++ b/autoload/SpaceVim.vim @@ -303,4 +303,21 @@ endfunction "" " @section FAQ, faq -" 1. How to enable YouCompleteMe? +" 1. How to enable YouCompleteMe? (I do not recommend to use YouCompleteMe, it +" is too big as a vim plugin, BTW I do not like using submodule in vim plugin, +" it is hard to manager by vim plugin manager.) +" +" > +" step 1: add `let g:spacevim_enable_ycm = 1` to custom_config, by default it +" should be `~/.SpaceVim.d/init.vim`. +" +" step 2: Get into the directory of YouCompleteMe's author, by default it +" should be `~/.cache/vimfiles/repos/github.com/Valloric/`, If you find the +" directory `YouCompleteMe` in it, just get into it, otherwise clone +" YouCompleteMe repo by +" `git clone https://github.com/Valloric/YouCompleteMe.git`, after cloning, +" get into it, run `git submodule update --init --recursive`. +" +" step 3: compile YouCompleteMe with the feature you want. if you just want +" support c family, you need run `./install.py --clang-completer`. +" < diff --git a/doc/SpaceVim.txt b/doc/SpaceVim.txt index 6438091e2..dd8f5b74e 100644 --- a/doc/SpaceVim.txt +++ b/doc/SpaceVim.txt @@ -435,7 +435,25 @@ lang#c : ============================================================================== FAQ *SpaceVim-faq* - 1. How to enable YouCompleteMe? + 1. How to enable YouCompleteMe? (I do not recommend to use YouCompleteMe, it +is too big as a vim plugin, BTW I do not like using submodule in vim plugin, +it is hard to manager by vim plugin manager.) + + +> + step 1: add `let g:spacevim_enable_ycm = 1` to custom_config, by default it + should be `~/.SpaceVim.d/init.vim`. + + step 2: Get into the directory of YouCompleteMe's author, by default it + should be `~/.cache/vimfiles/repos/github.com/Valloric/`, If you find the + directory `YouCompleteMe` in it, just get into it, otherwise clone + YouCompleteMe repo by + `git clone https://github.com/Valloric/YouCompleteMe.git`, after cloning, + get into it, run `git submodule update --init --recursive`. + + step 3: compile YouCompleteMe with the feature you want. if you just want + support c family, you need run `./install.py --clang-completer`. +< vim:tw=78:ts=8:ft=help:norl: From e227dadab3b964de23c1b4bd137ec25bc446011e Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Wed, 25 Jan 2017 22:12:23 +0800 Subject: [PATCH 3/3] fix perl completion --- autoload/SpaceVim/layers/lang/perl.vim | 1 + config/plugins/deoplete.vim | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/autoload/SpaceVim/layers/lang/perl.vim b/autoload/SpaceVim/layers/lang/perl.vim index 78542b535..5e93e584c 100644 --- a/autoload/SpaceVim/layers/lang/perl.vim +++ b/autoload/SpaceVim/layers/lang/perl.vim @@ -1,6 +1,7 @@ function! SpaceVim#layers#lang#perl#plugins() abort let plugins = [] call add(plugins, ['WolfgangMehner/perl-support', {'on_ft' : 'perl'}]) + call add(plugins, ['c9s/perlomni.vim', {'on_ft' : 'perl'}]) return plugins endfunction diff --git a/config/plugins/deoplete.vim b/config/plugins/deoplete.vim index a5aa0a71f..8fa3be0e3 100644 --- a/config/plugins/deoplete.vim +++ b/config/plugins/deoplete.vim @@ -11,6 +11,11 @@ let g:deoplete#omni#input_patterns.java = [ \'[^. \t0-9]\->\w*', \'[^. \t0-9]\::\w*', \] +let g:deoplete#omni#input_patterns.perl = [ + \'[^. \t0-9]\.\w*', + \'[^. \t0-9]\->\w*', + \'[^. \t0-9]\::\w*', + \] let g:deoplete#omni#input_patterns.jsp = ['[^. \t0-9]\.\w*'] let g:deoplete#omni#input_patterns.javascript = ['[^. \t0-9]\.\w*'] let g:deoplete#omni#input_patterns.php = '\h\w*\|[^. \t]->\%(\h\w*\)\?\|\h\w*::\%(\h\w*\)\?' @@ -20,6 +25,7 @@ let g:deoplete#omni_patterns.lua = '.' let g:deoplete#ignore_sources = {} let g:deoplete#ignore_sources.go = ['omni'] let g:deoplete#ignore_sources.c = ['omni'] +let g:deoplete#ignore_sources.perl = ['omni'] call deoplete#custom#set('go', 'mark', '') call deoplete#custom#set('clang2', 'mark', '') if g:spacevim_enable_javacomplete2_py