1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-04-14 15:19:12 +08:00

Merge pull request #1920

Add: Allow disabling of parentheses autocompletion

close #1919
This commit is contained in:
Wang Shidong 2018-07-06 17:35:23 +08:00 committed by GitHub
commit 3a60c73228
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 7 deletions

View File

@ -646,6 +646,9 @@ let g:spacevim_enable_vimfiler_gitstatus = 0
""
" Enable/Disable filetypeicon column in vimfiler buffer, default is 0.
let g:spacevim_enable_vimfiler_filetypeicon = 0
""
" Enable/Disable autocompletion of parentheses, default is 1 (enabled).
let g:spacevim_autocomplete_parens = 1
let g:spacevim_smartcloseignorewin = ['__Tagbar__' , 'vimfiler:default']
let g:spacevim_smartcloseignoreft = [
\ 'tagbar',

View File

@ -36,8 +36,10 @@ function! SpaceVim#layers#autocomplete#plugins() abort
\ ['Shougo/neoinclude.vim', { 'on_event' : 'InsertEnter'}],
\ ['Shougo/neosnippet-snippets', { 'merged' : 0}],
\ ['Shougo/neopairs.vim', { 'on_event' : 'InsertEnter'}],
\ ['Raimondi/delimitMate', { 'merged' : 0}],
\ ]
if g:spacevim_autocomplete_parens
call add(plugins, ['Raimondi/delimitMate', { 'merged' : 0}])
endif
" snippet
if g:spacevim_snippet_engine ==# 'neosnippet'
call add(plugins, ['Shougo/neosnippet.vim', { 'on_event' : 'InsertEnter',
@ -107,12 +109,14 @@ endfunction
function! SpaceVim#layers#autocomplete#config() abort
imap <expr>(
\ pumvisible() ?
\ complete_parameter#pre_complete("()") :
\ (len(maparg('<Plug>delimitMate(', 'i')) == 0) ?
\ "\<Plug>delimitMate(" :
\ '('
if g:spacevim_autocomplete_parens
imap <expr>(
\ pumvisible() ?
\ complete_parameter#pre_complete("()") :
\ (len(maparg('<Plug>delimitMate(', 'i')) == 0) ?
\ "\<Plug>delimitMate(" :
\ '('
endif
"mapping
if s:tab_key_behavior ==# 'smart'

View File

@ -475,6 +475,9 @@ Enable/Disable gitstatus column in vimfiler buffer, default is 0.
*g:spacevim_enable_vimfiler_filetypeicon*
Enable/Disable filetypeicon column in vimfiler buffer, default is 0.
*g:spacevim_autocomplete_parens*
Enable/Disable autocompletion of parentheses, default is 1 (enabled).
*g:spacevim_hosts_url*
The host file url. This option is for Chinese users who can not use Google and
Twitter.

View File

@ -676,6 +676,9 @@ Enable/Disable gitstatus column in vimfiler buffer, default is 0.
*g:spacevim_enable_vimfiler_filetypeicon*
Enable/Disable filetypeicon column in vimfiler buffer, default is 0.
*g:spacevim_autocomplete_parens*
Enable/Disable autocompletion of parentheses, default is 1 (enabled).
*g:spacevim_hosts_url*
The host file url. This option is for Chinese users who can not use Google and
Twitter.

View File

@ -12,6 +12,7 @@ The next release is v0.9.0.
- Add test for toml, number, file, icon and highlight API ([#1849](https://github.com/SpaceVim/SpaceVim/pull/1849))
- Add lsp support for julia ([#1850](https://github.com/SpaceVim/SpaceVim/pull/1850))
- Add lsp support for typescript ([#1870](https://github.com/SpaceVim/SpaceVim/pull/1870))
- Add option for disabling parentheses autocompletion ([#1920](https://github.com/SpaceVim/SpaceVim/pull/1920))
### Improvement