Select first line of completion popup. Improves typing flow and saves one keypress.

This commit is contained in:
Jean-Louis Fuchs
2013-01-21 18:08:19 +01:00
parent 5a5c383aa6
commit f234bf4376
3 changed files with 15 additions and 2 deletions

View File

@@ -106,6 +106,13 @@ you don't want this:
let g:jedi#popup_on_dot = 0 let g:jedi#popup_on_dot = 0
Jedi selects the first line of the completion menu: for a better typing-flow and
usually saves one keypress.
.. code-block:: vim
let g:jedi#popup_select_first = 0
There's some support for refactoring: There's some support for refactoring:
.. code-block:: vim .. code-block:: vim

View File

@@ -40,7 +40,12 @@ end
if g:jedi#popup_on_dot if g:jedi#popup_on_dot
if stridx(&completeopt, 'longest') > -1 if stridx(&completeopt, 'longest') > -1
if g:jedi#popup_select_first
inoremap <buffer> . .<C-R>=jedi#do_popup_on_dot() ? "\<lt>C-X>\<lt>C-O>\<lt>C-N>" : ""<CR>
else
inoremap <buffer> . .<C-R>=jedi#do_popup_on_dot() ? "\<lt>C-X>\<lt>C-O>" : ""<CR> inoremap <buffer> . .<C-R>=jedi#do_popup_on_dot() ? "\<lt>C-X>\<lt>C-O>" : ""<CR>
end
else else
inoremap <buffer> . .<C-R>=jedi#do_popup_on_dot() ? "\<lt>C-X>\<lt>C-O>\<lt>C-P>" : ""<CR> inoremap <buffer> . .<C-R>=jedi#do_popup_on_dot() ? "\<lt>C-X>\<lt>C-O>\<lt>C-P>" : ""<CR>
end end

View File

@@ -34,7 +34,8 @@ let s:settings = {
\ 'pydoc': "'K'", \ 'pydoc': "'K'",
\ 'show_function_definition': 1, \ 'show_function_definition': 1,
\ 'function_definition_escape': "'≡'", \ 'function_definition_escape': "'≡'",
\ 'auto_close_doc': 1 \ 'auto_close_doc': 1,
\ 'popup_select_first': 1
\ } \ }
for [key, val] in items(s:settings) for [key, val] in items(s:settings)