mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-06 18:54:44 +08:00
move defaults initialization to autoload
This commit is contained in:
@@ -174,6 +174,58 @@ else
|
|||||||
command! -nargs=1 Python python3 <args>
|
command! -nargs=1 Python python3 <args>
|
||||||
end
|
end
|
||||||
|
|
||||||
|
" ------------------------------------------------------------------------
|
||||||
|
" deprecations
|
||||||
|
" ------------------------------------------------------------------------
|
||||||
|
|
||||||
|
let s:deprecations = {
|
||||||
|
\ 'get_definition_command': 'goto_definitions_command',
|
||||||
|
\ 'goto_command': 'goto_assignments_command',
|
||||||
|
\ 'pydoc': 'documentation_command',
|
||||||
|
\ 'related_names_command': 'usages_command',
|
||||||
|
\ 'autocompletion_command': 'completions_command',
|
||||||
|
\ 'show_function_definition': 'show_call_signatures',
|
||||||
|
\ }
|
||||||
|
|
||||||
|
for [key, val] in items(s:deprecations)
|
||||||
|
if exists('g:jedi#'.key)
|
||||||
|
echom "'g:jedi#".key."' is deprecated. Please use 'g:jedi#".val."' instead. Sorry for the inconvenience."
|
||||||
|
exe 'let g:jedi#'.val.' = g:jedi#'.key
|
||||||
|
end
|
||||||
|
endfor
|
||||||
|
|
||||||
|
|
||||||
|
" ------------------------------------------------------------------------
|
||||||
|
" defaults for jedi-vim
|
||||||
|
" ------------------------------------------------------------------------
|
||||||
|
|
||||||
|
let s:settings = {
|
||||||
|
\ 'use_tabs_not_buffers': 1,
|
||||||
|
\ 'auto_initialization': 1,
|
||||||
|
\ 'auto_vim_configuration': 1,
|
||||||
|
\ 'goto_assignments_command': "'<leader>g'",
|
||||||
|
\ 'completions_command': "'<C-Space>'",
|
||||||
|
\ 'goto_definitions_command': "'<leader>d'",
|
||||||
|
\ 'call_signatures_command': "'<leader>n'",
|
||||||
|
\ 'usages_command': "'<leader>n'",
|
||||||
|
\ 'rename_command': "'<leader>r'",
|
||||||
|
\ 'popup_on_dot': 1,
|
||||||
|
\ 'documentation_command': "'K'",
|
||||||
|
\ 'show_call_signatures': 1,
|
||||||
|
\ 'call_signature_escape': "'≡'",
|
||||||
|
\ 'auto_close_doc': 1,
|
||||||
|
\ 'popup_select_first': 1,
|
||||||
|
\ 'quickfix_window_height': 10,
|
||||||
|
\ 'completions_enabled': 1
|
||||||
|
\ }
|
||||||
|
|
||||||
|
for [key, val] in items(s:settings)
|
||||||
|
if !exists('g:jedi#'.key)
|
||||||
|
exe 'let g:jedi#'.key.' = '.val
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
|
||||||
Python << PYTHONEOF
|
Python << PYTHONEOF
|
||||||
""" here we initialize the jedi stuff """
|
""" here we initialize the jedi stuff """
|
||||||
import vim
|
import vim
|
||||||
|
|||||||
@@ -18,58 +18,6 @@ endif
|
|||||||
let g:loaded_jedi = 1
|
let g:loaded_jedi = 1
|
||||||
|
|
||||||
|
|
||||||
" ------------------------------------------------------------------------
|
|
||||||
" deprecations
|
|
||||||
" ------------------------------------------------------------------------
|
|
||||||
|
|
||||||
let s:deprecations = {
|
|
||||||
\ 'get_definition_command': 'goto_definitions_command',
|
|
||||||
\ 'goto_command': 'goto_assignments_command',
|
|
||||||
\ 'pydoc': 'documentation_command',
|
|
||||||
\ 'related_names_command': 'usages_command',
|
|
||||||
\ 'autocompletion_command': 'completions_command',
|
|
||||||
\ 'show_function_definition': 'show_call_signatures',
|
|
||||||
\ }
|
|
||||||
|
|
||||||
for [key, val] in items(s:deprecations)
|
|
||||||
if exists('g:jedi#'.key)
|
|
||||||
echom "'g:jedi#".key."' is deprecated. Please use 'g:jedi#".val."' instead. Sorry for the inconvenience."
|
|
||||||
exe 'let g:jedi#'.val.' = g:jedi#'.key
|
|
||||||
end
|
|
||||||
endfor
|
|
||||||
|
|
||||||
|
|
||||||
" ------------------------------------------------------------------------
|
|
||||||
" defaults for jedi-vim
|
|
||||||
" ------------------------------------------------------------------------
|
|
||||||
|
|
||||||
let s:settings = {
|
|
||||||
\ 'use_tabs_not_buffers': 1,
|
|
||||||
\ 'auto_initialization': 1,
|
|
||||||
\ 'auto_vim_configuration': 1,
|
|
||||||
\ 'goto_assignments_command': "'<leader>g'",
|
|
||||||
\ 'completions_command': "'<C-Space>'",
|
|
||||||
\ 'goto_definitions_command': "'<leader>d'",
|
|
||||||
\ 'call_signatures_command': "'<leader>n'",
|
|
||||||
\ 'usages_command': "'<leader>n'",
|
|
||||||
\ 'rename_command': "'<leader>r'",
|
|
||||||
\ 'popup_on_dot': 1,
|
|
||||||
\ 'documentation_command': "'K'",
|
|
||||||
\ 'show_call_signatures': 1,
|
|
||||||
\ 'call_signature_escape': "'≡'",
|
|
||||||
\ 'auto_close_doc': 1,
|
|
||||||
\ 'popup_select_first': 1,
|
|
||||||
\ 'quickfix_window_height': 10,
|
|
||||||
\ 'completions_enabled': 1
|
|
||||||
\ }
|
|
||||||
|
|
||||||
for [key, val] in items(s:settings)
|
|
||||||
if !exists('g:jedi#'.key)
|
|
||||||
exe 'let g:jedi#'.key.' = '.val
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
|
|
||||||
|
|
||||||
if g:jedi#auto_vim_configuration
|
if g:jedi#auto_vim_configuration
|
||||||
filetype plugin on
|
filetype plugin on
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user