mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-07 19:24:36 +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:
@@ -113,7 +113,7 @@ you disable the auto-initialization in your ``.vimrc``:
|
|||||||
let g:jedi#auto_initialization = 0
|
let g:jedi#auto_initialization = 0
|
||||||
|
|
||||||
There are also some VIM options (like ``completeopt`` and key defaults) which
|
There are also some VIM options (like ``completeopt`` and key defaults) which
|
||||||
are automatically initialized, but you can change all of them:
|
are automatically initialized, but you can skip this:
|
||||||
|
|
||||||
.. code-block:: vim
|
.. code-block:: vim
|
||||||
|
|
||||||
|
|||||||
@@ -336,9 +336,11 @@ Default: 1 (Perform automatic initialization)
|
|||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
6.2. `g:jedi#auto_vim_configuration` *g:jedi#auto_vim_configuration*
|
6.2. `g:jedi#auto_vim_configuration` *g:jedi#auto_vim_configuration*
|
||||||
|
|
||||||
Jedi-vim sets 'completeopt' to `menuone,longest,preview` by default. It also
|
Jedi-vim sets 'completeopt' to `menuone,longest,preview` by default, if
|
||||||
remaps <Ctrl-C> to <Esc> in insert mode. If you want to keep your own
|
'completeopt' is not changed from Vim's default.
|
||||||
configuration, disable this setting.
|
It also remaps <Ctrl-C> to <Esc> in insert mode.
|
||||||
|
|
||||||
|
If you want to keep your own configuration, disable this setting.
|
||||||
|
|
||||||
Options: 0 or 1
|
Options: 0 or 1
|
||||||
Default: 1 (Set 'completeopt' and mapping as described above)
|
Default: 1 (Set 'completeopt' and mapping as described above)
|
||||||
|
|||||||
@@ -38,10 +38,3 @@ if g:jedi#auto_initialization
|
|||||||
autocmd InsertLeave <buffer> if pumvisible() == 0|pclose|endif
|
autocmd InsertLeave <buffer> if pumvisible() == 0|pclose|endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if g:jedi#auto_vim_configuration
|
|
||||||
setlocal completeopt=menuone,longest,preview
|
|
||||||
if len(mapcheck('<C-c>', 'i')) == 0
|
|
||||||
inoremap <C-c> <ESC>
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|||||||
@@ -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.
|
" jedi-vim really needs, otherwise jedi-vim cannot start.
|
||||||
filetype plugin on
|
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
|
endif
|
||||||
|
|
||||||
" Pyimport command
|
" Pyimport command
|
||||||
|
|||||||
Reference in New Issue
Block a user