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:
parent
3466ae9dc1
commit
584e5d9a7e
@ -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>"
|
||||
|
14
autoload/SpaceVim/mapping/enter.vim
Normal file
14
autoload/SpaceVim/mapping/enter.vim
Normal 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:
|
Loading…
Reference in New Issue
Block a user