From 0f203c12b9d7890cd2b66bd7f76144136eb7240d Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Thu, 30 Apr 2015 01:53:01 +0200 Subject: [PATCH] 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