I am using jedi:goto-definition
to jump to function definitions.
If the function has a definiton under import
it first jumps into that and I have to do second jump to the module again. Can it directly jump to the module by over passing the import jump?
Here: cursor is on top of my_function
. When I do jedi:goto-definition
it first jumps to my_function,
under import at the top of the file. Than when I do jedi:goto-definition
it jump to its definition.
from utils import ( |
my_function, <-----| --------------> | def my_function(arg):
_log | | ....
) | |
| |
my_function("hello") --| # cursor is here
wanted behavior:
my_function("hello") --| # cursor is here ----> | def my_function(arg):
setup:
(defun my/python-mode-hook ()
(add-to-list 'company-backends 'company-jedi))
(add-hook 'python-mode-hook 'my/python-mode-hook)
(company-jedi 1)
(setq elpy-rpc-backend "jedi")
(add-hook 'python-mode-hook 'jedi:setup)
(global-set-key "\C-x\C-j" 'jedi:goto-definition)
(global-set-key "\C-x\C-k" 'jedi:goto-definition-pop-marker)