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

🎁 Allow disabling of parentheses autocompletion

This commit is contained in:
Jakub Nowak 2018-07-06 10:51:32 +02:00
parent 7358a26fd1
commit c5315fbb76
4 changed files with 20 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.