Merge pull request #397 from blueyed/select-mode-mapping

Select mode mapping for completion trigger
This commit is contained in:
Dave Halter
2015-04-30 19:22:00 +02:00

View File

@@ -10,11 +10,14 @@ if g:jedi#auto_initialization
" map ctrl+space for autocompletion " map ctrl+space for autocompletion
if g:jedi#completions_command == "<C-Space>" if g:jedi#completions_command == "<C-Space>"
" in terminals, <C-Space> sometimes equals <Nul> " In terminals, <C-Space> sometimes equals <Nul>.
inoremap <expr> <Nul> jedi#complete_string(0) imap <buffer> <Nul> <C-Space>
smap <buffer> <Nul> <C-Space>
endif endif
if g:jedi#completions_command != "" if g:jedi#completions_command != ""
execute "inoremap <expr> <buffer> ".g:jedi#completions_command." jedi#complete_string(0)" execute "inoremap <expr> <buffer> ".g:jedi#completions_command." jedi#complete_string(0)"
" A separate mapping for select mode: deletes and completes.
execute "snoremap <expr> <buffer> ".g:jedi#completions_command." '\<C-g>c'.jedi#complete_string(0)"
endif endif
endif endif
endif endif