mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-08 19:44:52 +08:00
Key mapping <Leader>R: Rename vars/functions/classes without deleting the word under the cursor
This pull request also adds the support for 'set selection=exclusive' to the function 'rename_visual()' (bug fix). '<Leader>R' in Normal mode: --------------------------- Jedi-vim keeps the word under the cursor, moves the cursor to the end of the word, and puts Vim in insert mode, where the user is expected to enter the new variable name. '<Leader>R' in Visual mode: --------------------------- Use the selected text as the default answer to the prompt.
This commit is contained in:
@@ -27,6 +27,10 @@ if g:jedi#auto_initialization
|
||||
execute 'nnoremap <buffer> '.g:jedi#rename_command.' :call jedi#rename()<CR>'
|
||||
execute 'vnoremap <buffer> '.g:jedi#rename_command.' :call jedi#rename_visual()<CR>'
|
||||
endif
|
||||
if len(g:jedi#rename_command_keep_name)
|
||||
execute 'nnoremap <buffer> '.g:jedi#rename_command_keep_name.' :call jedi#rename_keep_name()<CR>'
|
||||
execute 'vnoremap <buffer> '.g:jedi#rename_command_keep_name.' :call jedi#rename_visual_keep_name()<CR>'
|
||||
endif
|
||||
" documentation/pydoc
|
||||
if len(g:jedi#documentation_command)
|
||||
execute 'nnoremap <silent> <buffer>'.g:jedi#documentation_command.' :call jedi#show_documentation()<CR>'
|
||||
|
||||
Reference in New Issue
Block a user