diff --git a/autoload/SpaceVim.vim b/autoload/SpaceVim.vim index b111aea7f..67ccdb3c0 100644 --- a/autoload/SpaceVim.vim +++ b/autoload/SpaceVim.vim @@ -362,7 +362,9 @@ let g:spacevim_leader_guide_theme = 'leaderguide' " let g:spacevim_enable_key_frequency = 1 " < let g:spacevim_enable_key_frequency = 0 -if (has('python3') +if has('nvim-0.9.0') + let g:spacevim_autocomplete_method = 'nvim-cmp' +elseif (has('python3') \ && (SpaceVim#util#haspy3lib('neovim') \ || SpaceVim#util#haspy3lib('pynvim'))) && \ (has('nvim') || (has('patch-8.0.0027'))) @@ -372,7 +374,9 @@ if (has('python3') " @parentsection options " Set the autocomplete engine of spacevim, the default logic is: " > - " if has('python3') + " if has('nvim-0.9.0') + " let g:spacevim_autocomplete_method = 'nvim-cmp' + " elseif has('python3') " let g:spacevim_autocomplete_method = 'deoplete' " elseif has('lua') " let g:spacevim_autocomplete_method = 'neocomplete' @@ -392,7 +396,9 @@ if (has('python3') "" " Set the autocomplete engine of spacevim, the default logic is: " > - " if has('python3') + " if has('nvim-0.9.0') + " let g:spacevim_autocomplete_method = 'nvim-cmp' + " elseif has('python3') " let g:spacevim_autocomplete_method = 'deoplete' " elseif has('lua') " let g:spacevim_autocomplete_method = 'neocomplete' diff --git a/doc/SpaceVim.txt b/doc/SpaceVim.txt index 648b2da75..b00b5b5e8 100644 --- a/doc/SpaceVim.txt +++ b/doc/SpaceVim.txt @@ -325,7 +325,9 @@ AUTOCOMPLETE_METHOD *SpaceVim-options-autocomplete_method* Set the autocomplete engine of spacevim, the default logic is: > - if has('python3') + if has('nvim-0.9.0') + let g:spacevim_autocomplete_method = 'nvim-cmp' + elseif has('python3') let g:spacevim_autocomplete_method = 'deoplete' elseif has('lua') let g:spacevim_autocomplete_method = 'neocomplete' @@ -1154,7 +1156,9 @@ enable it: *g:spacevim_autocomplete_method* Set the autocomplete engine of spacevim, the default logic is: > - if has('python3') + if has('nvim-0.9.0') + let g:spacevim_autocomplete_method = 'nvim-cmp' + elseif has('python3') let g:spacevim_autocomplete_method = 'deoplete' elseif has('lua') let g:spacevim_autocomplete_method = 'neocomplete' diff --git a/docs/cn/layers/autocomplete.md b/docs/cn/layers/autocomplete.md index 664d013f7..97ef70c2f 100644 --- a/docs/cn/layers/autocomplete.md +++ b/docs/cn/layers/autocomplete.md @@ -62,6 +62,7 @@ SpaceVim 选项 `snippet_engine` 设置为 `ultisnips`,将使用 [UltiSnips](h - `deoplete` - `asyncomplete` - `completor` + - `nvim-cmp` 设置示例: diff --git a/docs/layers/autocomplete.md b/docs/layers/autocomplete.md index cd06db4bc..89972ccb1 100644 --- a/docs/layers/autocomplete.md +++ b/docs/layers/autocomplete.md @@ -27,6 +27,7 @@ This layer provides auto-completion in SpaceVim. The following completion engines are supported: +- nvim-cmp - neovim >= 0.9.0 - [neocomplete](https://github.com/Shougo/neocomplete.vim) - vim with `+lua` - [neocomplcache](https://github.com/Shougo/neocomplcache.vim) - vim without `+lua` - [deoplete](https://github.com/Shougo/deoplete.nvim) - neovim with `+python3` @@ -60,6 +61,7 @@ But you can choose the completion engine to be used with the following variable: - `deoplete` - `asyncomplete` - `completor` + - `nvim-cmp` here is an example: