diff --git a/autoload/SpaceVim/default.vim b/autoload/SpaceVim/default.vim index d03ba183a..d75c9fc33 100644 --- a/autoload/SpaceVim/default.vim +++ b/autoload/SpaceVim/default.vim @@ -159,13 +159,14 @@ function! SpaceVim#default#SetMappings() abort "mapping imap SpaceVim#mapping#tab() + imap pumvisible() ? "\" : "" + imap SpaceVim#mapping#shift_tab() smap neosnippet#expandable_or_jumpable() ? "\(neosnippet_expand_or_jump)" : "\" inoremap SpaceVim#mapping#enter() inoremap pumvisible() ? "\" : "\" inoremap pumvisible() ? "\" : "\" inoremap pumvisible() ? "\\\" : "\" inoremap pumvisible() ? "\\\" : "\" - imap pumvisible() ? "\" : "" smap pumvisible() ? "\" : "" " Save a file with sudo " http://forrst.com/posts/Use_w_to_sudo_write_a_file_with_Vim-uAN diff --git a/autoload/SpaceVim/layers/autocomplete.vim b/autoload/SpaceVim/layers/autocomplete.vim index 6140bec6a..b5e93d348 100644 --- a/autoload/SpaceVim/layers/autocomplete.vim +++ b/autoload/SpaceVim/layers/autocomplete.vim @@ -21,42 +21,46 @@ function! SpaceVim#layers#autocomplete#plugins() abort - let plugins = [ - \ ['honza/vim-snippets', {'on_i' : 1, 'loadconf_before' : 1}], - \ ['Shougo/neco-syntax', { 'on_i' : 1}], - \ ['ujihisa/neco-look', { 'on_i' : 1}], - \ ['Shougo/context_filetype.vim', { 'on_i' : 1}], - \ ['Shougo/neoinclude.vim', { 'on_i' : 1}], - \ ['Shougo/neosnippet-snippets', { 'merged' : 0}], - \ ['Shougo/neopairs.vim', { 'on_i' : 1}], - \ ] - if g:spacevim_autocomplete_method ==# 'ycm' - 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, - \ 'loadconf' : 1, - \ }]) - elseif g:spacevim_autocomplete_method ==# 'neocomplcache' "{{{ - call add(plugins, ['Shougo/neocomplcache.vim', { - \ 'on_i' : 1, - \ 'loadconf' : 1, - \ }]) - elseif g:spacevim_autocomplete_method ==# 'deoplete' - call add(plugins, ['Shougo/deoplete.nvim', { - \ 'on_i' : 1, - \ 'loadconf' : 1, - \ }]) - endif - return plugins + let plugins = [ + \ ['honza/vim-snippets', { 'on_i' : 1, 'loadconf_before' : 1}], + \ ['Shougo/neco-syntax', { 'on_i' : 1}], + \ ['ujihisa/neco-look', { 'on_i' : 1}], + \ ['Shougo/context_filetype.vim', { 'on_i' : 1}], + \ ['Shougo/neoinclude.vim', { 'on_i' : 1}], + \ ['Shougo/neosnippet-snippets', { 'merged' : 0}], + \ ['Shougo/neopairs.vim', { 'on_i' : 1}], + \ ['Raimondi/delimitMate', { 'merged' : 0}], + \ ] + if g:spacevim_autocomplete_method ==# 'ycm' + 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, + \ 'loadconf' : 1, + \ }]) + elseif g:spacevim_autocomplete_method ==# 'neocomplcache' "{{{ + call add(plugins, ['Shougo/neocomplcache.vim', { + \ 'on_i' : 1, + \ 'loadconf' : 1, + \ }]) + elseif g:spacevim_autocomplete_method ==# 'deoplete' + call add(plugins, ['Shougo/deoplete.nvim', { + \ 'on_i' : 1, + \ 'loadconf' : 1, + \ }]) + endif + return plugins endfunction -function SpaceVim#layers#autocomplete#config() - if g:spacevim_autocomplete_method ==# 'ycm' - iunmap - sunmap - endif +function! SpaceVim#layers#autocomplete#config() abort + if g:spacevim_autocomplete_method ==# 'ycm' + sunmap + iunmap + endif endfunction + + +" vim:set et sw=2 cc=80: diff --git a/autoload/SpaceVim/mapping.vim b/autoload/SpaceVim/mapping.vim index 48fcd6ca7..80072543d 100644 --- a/autoload/SpaceVim/mapping.vim +++ b/autoload/SpaceVim/mapping.vim @@ -16,6 +16,10 @@ function! SpaceVim#mapping#def(type,key,value,desc,...) abort call add(g:unite_source_menu_menus.CustomKeyMaps.command_candidates, [description,cmd]) endfunction +function! SpaceVim#mapping#shift_tab() abort + return pumvisible() ? "\" : "\delimitMateS-Tab" +endfunction + function! SpaceVim#mapping#tab() abort if getline('.')[col('.')-2] ==# '{'&& pumvisible() return "\"