From cfb76259f1814b48c2fd434c8ff4211531f632d6 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Thu, 30 Apr 2015 01:50:22 +0200 Subject: [PATCH 1/2] Mapping: remap of : use and map to Mapping it to should be enough, and makes it unnecessary to map everything twice. --- after/ftplugin/python/jedi.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/after/ftplugin/python/jedi.vim b/after/ftplugin/python/jedi.vim index 79a1ef9..8174d9c 100644 --- a/after/ftplugin/python/jedi.vim +++ b/after/ftplugin/python/jedi.vim @@ -10,8 +10,8 @@ if g:jedi#auto_initialization " map ctrl+space for autocompletion if g:jedi#completions_command == "" - " in terminals, sometimes equals - inoremap jedi#complete_string(0) + " In terminals, sometimes equals . + imap endif if g:jedi#completions_command != "" execute "inoremap ".g:jedi#completions_command." jedi#complete_string(0)" From 0f203c12b9d7890cd2b66bd7f76144136eb7240d Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Thu, 30 Apr 2015 01:53:01 +0200 Subject: [PATCH 2/2] Add select-mode mapping for completion trigger This deletes the selection (by going to visual mode, and "c"), and then triggers the completion. This is useful with e.g. UltiSnips, when you want to start completion with an expanded snippet argument selected. Ref: https://github.com/davidhalter/jedi-vim/pull/339#issuecomment-97612632 --- after/ftplugin/python/jedi.vim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/after/ftplugin/python/jedi.vim b/after/ftplugin/python/jedi.vim index 8174d9c..591f100 100644 --- a/after/ftplugin/python/jedi.vim +++ b/after/ftplugin/python/jedi.vim @@ -12,9 +12,12 @@ if g:jedi#auto_initialization if g:jedi#completions_command == "" " In terminals, sometimes equals . imap + smap endif if g:jedi#completions_command != "" execute "inoremap ".g:jedi#completions_command." jedi#complete_string(0)" + " A separate mapping for select mode: deletes and completes. + execute "snoremap ".g:jedi#completions_command." '\c'.jedi#complete_string(0)" endif endif endif