make it possible to disable commands

This commit is contained in:
David Halter
2013-08-24 21:08:03 +04:30
parent 11681e2aa7
commit 9d2259a63d
3 changed files with 23 additions and 8 deletions

View File

@@ -120,7 +120,7 @@ and usually saves one keypress.
let g:jedi#popup_select_first = 0 let g:jedi#popup_select_first = 0
Here are a few more defaults for actions, read the docs (``:help jedi-vim``) to Here are a few more defaults for actions, read the docs (``:help jedi-vim``) to
get more information. You can change them get more information. If you set them to ``""``, they are not assigned.
.. code-block:: vim .. code-block:: vim
@@ -133,7 +133,6 @@ get more information. You can change them
let g:jedi#show_call_signatures = "1" let g:jedi#show_call_signatures = "1"
Testing Testing
======= =======

View File

@@ -192,6 +192,9 @@ a mapping yourself by calling a function: >
nnoremap <silent> <buffer> <localleader>r :call jedi#rename()<cr> nnoremap <silent> <buffer> <localleader>r :call jedi#rename()<cr>
" etc. " etc.
Note: You can set commands to '', which means that they are empty and not
assigned. It's an easy way to "disable" functionality of jedi-vim.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
5.1. `g:jedi#completions_command` *g:jedi#completions_command* 5.1. `g:jedi#completions_command` *g:jedi#completions_command*
Function: n/a; see above Function: n/a; see above

View File

@@ -11,6 +11,7 @@ if g:jedi#auto_initialization
setlocal omnifunc=jedi#completions setlocal omnifunc=jedi#completions
" map ctrl+space for autocompletion " map ctrl+space for autocompletion
if g:jedi#completions_command == "<C-Space>" if g:jedi#completions_command == "<C-Space>"
" in terminals, <C-Space> sometimes equals <Nul> " in terminals, <C-Space> sometimes equals <Nul>
inoremap <expr> <Nul> pumvisible() \|\| &omnifunc == '' ? inoremap <expr> <Nul> pumvisible() \|\| &omnifunc == '' ?
@@ -19,16 +20,28 @@ if g:jedi#auto_initialization
\ "\"\\<lt>c-n>\\<lt>c-p>\\<lt>c-n>\" :" . \ "\"\\<lt>c-n>\\<lt>c-p>\\<lt>c-n>\" :" .
\ "\" \\<lt>bs>\\<lt>C-n>\"\<CR>" \ "\" \\<lt>bs>\\<lt>C-n>\"\<CR>"
endif endif
execute "inoremap <buffer>".g:jedi#completions_command." <C-X><C-O>" if g:jedi#completions_command != ""
execute "inoremap <buffer>".g:jedi#completions_command." <C-X><C-O>"
endif
" goto / get_definition / usages " goto / get_definition / usages
execute "noremap <buffer>".g:jedi#goto_assignments_command." :call jedi#goto_assignments()<CR>" if g:jedi#goto_assignments_command != ''
execute "noremap <buffer>".g:jedi#goto_definitions_command." :call jedi#goto_definitions()<CR>" execute "noremap <buffer>".g:jedi#goto_assignments_command." :call jedi#goto_assignments()<CR>"
execute "noremap <buffer>".g:jedi#usages_command." :call jedi#usages()<CR>" endif
if g:jedi#goto_definitions_command != ''
execute "noremap <buffer>".g:jedi#goto_definitions_command." :call jedi#goto_definitions()<CR>"
endif
if g:jedi#usages_command != ''
execute "noremap <buffer>".g:jedi#usages_command." :call jedi#usages()<CR>"
endif
" rename " rename
execute "noremap <buffer>".g:jedi#rename_command." :call jedi#rename()<CR>" if g:jedi#rename_command != ''
execute "noremap <buffer>".g:jedi#rename_command." :call jedi#rename()<CR>"
endif
" documentation/pydoc " documentation/pydoc
execute "nnoremap <silent> <buffer>".g:jedi#documentation_command." :call jedi#show_documentation()<CR>" if g:jedi#documentation_command != ''
execute "nnoremap <silent> <buffer>".g:jedi#documentation_command." :call jedi#show_documentation()<CR>"
endif
if g:jedi#show_call_signatures == 1 && has('conceal') if g:jedi#show_call_signatures == 1 && has('conceal')
call jedi#configure_call_signatures() call jedi#configure_call_signatures()