1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 13:00:04 +08:00

Fix enter mapping

This commit is contained in:
wsdjeg 2017-04-02 23:13:10 +08:00
parent 3466ae9dc1
commit 584e5d9a7e
2 changed files with 15 additions and 1 deletions

View File

@ -162,7 +162,7 @@ function! SpaceVim#default#SetMappings() abort
imap <expr><S-TAB> pumvisible() ? "\<C-p>" : ""
imap <silent><expr><S-TAB> SpaceVim#mapping#shift_tab()
smap <expr><TAB> neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
inoremap <silent><expr><CR> SpaceVim#mapping#enter()
imap <silent><expr><CR> SpaceVim#mapping#enter#i_enter()
inoremap <expr> <Down> pumvisible() ? "\<C-n>" : "\<Down>"
inoremap <expr> <Up> pumvisible() ? "\<C-p>" : "\<Up>"
inoremap <expr> <PageDown> pumvisible() ? "\<PageDown>\<C-p>\<C-n>" : "\<PageDown>"

View File

@ -0,0 +1,14 @@
if g:spacevim_snippet_engine ==# 'neosnippet'
function! SpaceVim#mapping#enter#i_enter() abort
if pumvisible()
if neosnippet#expandable_or_jumpable()
return "\<plug>(neosnippet_expand_or_jump)"
endif
else
return "\<Enter>"
endif
endfunction
elseif g:spacevim_snippet_engine ==# 'ultisnips'
endif
" vim:set et sw=2 cc=80: