mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-07 03:04:30 +08:00
auto-config: set completeopt only if it's the default
The setting is also moved from "ftplugin" to "plugin", which allows for easier customization, e.g. via a FileType plugin. Ref: https://github.com/davidhalter/jedi-vim/issues/374#issuecomment-97621368
This commit is contained in:
@@ -12,6 +12,19 @@ if !exists("g:jedi#auto_vim_configuration") || g:jedi#auto_vim_configuration
|
||||
|
||||
" jedi-vim really needs, otherwise jedi-vim cannot start.
|
||||
filetype plugin on
|
||||
|
||||
" Change completeopt, but only if it has Vim's default value.
|
||||
let s:save_completeopt=&completeopt
|
||||
set completeopt&
|
||||
let s:default_completeopt=&completeopt
|
||||
let &completeopt=s:save_completeopt
|
||||
if s:default_completeopt == &completeopt
|
||||
set completeopt=menuone,longest,preview
|
||||
endif
|
||||
|
||||
if len(mapcheck('<C-c>', 'i')) == 0
|
||||
inoremap <C-c> <ESC>
|
||||
endif
|
||||
endif
|
||||
|
||||
" Pyimport command
|
||||
|
||||
Reference in New Issue
Block a user