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

Merge pull request #162 from SpaceVim/ycm_support

Fix ycm support
This commit is contained in:
Wang Shidong 2017-01-25 20:50:33 +08:00 committed by GitHub
commit e6f02e3475
3 changed files with 79 additions and 10 deletions

View File

@ -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,24 @@ function! SpaceVim#welcome() abort
wincmd p
Startify
endfunction
""
" @section FAQ, faq
" 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`.
" <

View File

@ -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,

View File

@ -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,28 @@ lang#c :
requirement: clang libclang
==============================================================================
FAQ *SpaceVim-faq*
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: