mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-07 03:04:30 +08:00
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
This commit is contained in:
@@ -12,9 +12,12 @@ if g:jedi#auto_initialization
|
||||
if g:jedi#completions_command == "<C-Space>"
|
||||
" In terminals, <C-Space> sometimes equals <Nul>.
|
||||
imap <buffer> <Nul> <C-Space>
|
||||
smap <buffer> <Nul> <C-Space>
|
||||
endif
|
||||
if g:jedi#completions_command != ""
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user