mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 10:30:05 +08:00
Simple support for coc (#2333)
* Add coc support * Add coc" * Add coc support
This commit is contained in:
parent
fc4bf82201
commit
50fe3213d1
@ -203,6 +203,8 @@ if (has('python3') && SpaceVim#util#haspy3lib('neovim')) &&
|
||||
" let g:spacevim_autocomplete_method = 'neocomplcache'
|
||||
" endif
|
||||
" <
|
||||
"
|
||||
" and you can alse set this option to coc, then coc.nvim will be useed.
|
||||
let g:spacevim_autocomplete_method = 'deoplete'
|
||||
elseif has('lua')
|
||||
let g:spacevim_autocomplete_method = 'neocomplete'
|
||||
|
@ -62,6 +62,8 @@ function! SpaceVim#layers#autocomplete#plugins() abort
|
||||
\ 'on_event' : 'InsertEnter',
|
||||
\ 'loadconf' : 1,
|
||||
\ }])
|
||||
elseif g:spacevim_autocomplete_method ==# 'coc'
|
||||
call add(plugins, ['neoclide/coc.nvim', {'merged': 0}])
|
||||
elseif g:spacevim_autocomplete_method ==# 'deoplete'
|
||||
call add(plugins, ['Shougo/deoplete.nvim', {
|
||||
\ 'on_event' : 'InsertEnter',
|
||||
|
@ -6,7 +6,6 @@
|
||||
" License: GPLv3
|
||||
"=============================================================================
|
||||
|
||||
|
||||
function! SpaceVim#layers#lang#vim#plugins() abort
|
||||
let plugins = [
|
||||
\ ['syngan/vim-vimlint', { 'on_ft' : 'vim'}],
|
||||
@ -21,6 +20,8 @@ function! SpaceVim#layers#lang#vim#plugins() abort
|
||||
\ 'loadconf' : 1,
|
||||
\ 'merged' : 0,
|
||||
\ }])
|
||||
elseif g:spacevim_autocomplete_method == 'coc'
|
||||
call add(plugins, ['neoclide/coc-neco', {'merged' : 0}])
|
||||
endif
|
||||
call add(plugins,['tweekmonster/helpful.vim', {'on_cmd': 'HelpfulVersion'}])
|
||||
return plugins
|
||||
|
@ -6,8 +6,8 @@ let g:vimfiler_as_default_explorer = get(g:, 'vimfiler_as_default_explorer', 1)
|
||||
let g:vimfiler_restore_alternate_file = get(g:, 'vimfiler_restore_alternate_file', 1)
|
||||
let g:vimfiler_tree_indentation = get(g:, 'vimfiler_tree_indentation', 1)
|
||||
let g:vimfiler_tree_leaf_icon = get(g:, 'vimfiler_tree_leaf_icon', '')
|
||||
let g:vimfiler_tree_opened_icon = get(g:, 'vimfiler_tree_opened_icon', '▼')
|
||||
let g:vimfiler_tree_closed_icon = get(g:, 'vimfiler_tree_closed_icon', '▷')
|
||||
let g:vimfiler_tree_opened_icon = get(g:, 'vimfiler_tree_opened_icon', '-')
|
||||
let g:vimfiler_tree_closed_icon = get(g:, 'vimfiler_tree_closed_icon', '+')
|
||||
let g:vimfiler_file_icon = get(g:, 'vimfiler_file_icon', '')
|
||||
let g:vimfiler_readonly_file_icon = get(g:, 'vimfiler_readonly_file_icon', '*')
|
||||
let g:vimfiler_marked_file_icon = get(g:, 'vimfiler_marked_file_icon', '√')
|
||||
|
@ -49,12 +49,12 @@ SpaceVim 选项 `snippet_engien` 设置为 ultisnips
|
||||
为了提升用户体验,可以通过使用如下的模块选项来定制自动补全:
|
||||
|
||||
1. `auto-completion-return-key-behavior` 选项控制当按下 `Return`/`Enter` 键时的行为,
|
||||
默认为 `smart`,可用的值包括如下3种:
|
||||
默认为 `complete`,可用的值包括如下3种:
|
||||
- `complete` 补全模式,插入当前选中的列表选项
|
||||
- `smart` 智能模式,插入当前选中的列表选项,若当前选择的时 snippet,则自动展开代码块。
|
||||
- `nil` 当设为 nil 时,则采用 Vim 默认的按键行为,插入新行
|
||||
2. `auto-completion-tab-key-behavior` 选项控制当按下 `Tab` 键时的行为,默认为
|
||||
`smart`,可用的值包括如下4种:
|
||||
`complete`,可用的值包括如下4种:
|
||||
- `smart` 智能模式,自动循环补全列表、展开代码块以及跳至下一个代码块的锚点
|
||||
- `complete` 补全模式,插入当前选中的列表选项
|
||||
- `cycle` 循环模式,自动再补全列表之间循环
|
||||
|
@ -48,15 +48,19 @@ To use this configuration layer, add following snippet to your custom configurat
|
||||
|
||||
You can customize the user experience of auto-completion with the following layer variables:
|
||||
|
||||
1. `auto-completion-return-key-behavior` set the action to perform when the `Return`/`Enter` key is pressed, the possible values are:
|
||||
1. `auto-completion-return-key-behavior` set the action to perform
|
||||
when the `Return`/`Enter` key is pressed, the possible values are:
|
||||
- `complete` completes with the current selection
|
||||
- `smart` completes with current selection and expand snippet or argvs
|
||||
- `nil`
|
||||
2. `auto-completion-tab-key-behavior` set the action to perform when the `TAB` key is pressed, the possible values are:
|
||||
By default it is `complete`.
|
||||
2. `auto-completion-tab-key-behavior` set the action to
|
||||
perform when the `TAB` key is pressed, the possible values are:
|
||||
- `smart` cycle candidates, expand snippets, jump parameters
|
||||
- `complete` completes with the current selection
|
||||
- `cycle` completes the common prefix and cycle between candidates
|
||||
- `nil` insert a carriage return
|
||||
By default it is `complete`.
|
||||
3. `auto-completion-delay` is a number to delay the completion after input in milliseconds, by default it is 50 ms.
|
||||
4. `auto-completion-complete-with-key-sequence` is a string of two characters denoting a key sequence that will perform a `complete` action if the sequence as been entered quickly enough. If its value is `nil` then the feature is disabled.
|
||||
5. `auto-completion-complete-with-key-sequence-delay` is the number of seconds to wait for the auto-completion key sequence to be entered. The default value is 0.1 seconds.
|
||||
|
Loading…
Reference in New Issue
Block a user