From c1ec986732afe2e7dc6d05d1208f10295762a8bd Mon Sep 17 00:00:00 2001 From: David Halter Date: Tue, 27 Aug 2013 21:18:24 +0430 Subject: [PATCH] move defaults initialization to autoload --- autoload/jedi.vim | 52 +++++++++++++++++++++++++++++++++++++++++++++++ plugin/jedi.vim | 52 ----------------------------------------------- 2 files changed, 52 insertions(+), 52 deletions(-) diff --git a/autoload/jedi.vim b/autoload/jedi.vim index 151519e..3289618 100644 --- a/autoload/jedi.vim +++ b/autoload/jedi.vim @@ -174,6 +174,58 @@ else command! -nargs=1 Python python3 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': "'g'", + \ 'completions_command': "''", + \ 'goto_definitions_command': "'d'", + \ 'call_signatures_command': "'n'", + \ 'usages_command': "'n'", + \ 'rename_command': "'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 """ here we initialize the jedi stuff """ import vim diff --git a/plugin/jedi.vim b/plugin/jedi.vim index bab0215..545d425 100644 --- a/plugin/jedi.vim +++ b/plugin/jedi.vim @@ -18,58 +18,6 @@ endif 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': "'g'", - \ 'completions_command': "''", - \ 'goto_definitions_command': "'d'", - \ 'call_signatures_command': "'n'", - \ 'usages_command': "'n'", - \ 'rename_command': "'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 filetype plugin on endif