How can I use meta-dot (M-.) in python with emacs?

后端 未结 6 1484
余生分开走
余生分开走 2021-02-07 00:58

Is there an equivalent of slime for python?

For example, if I position the cursor on foo() and do M-. (jump to definition) I would like to see the source definition of

6条回答
  •  深忆病人
    2021-02-07 01:24

    Try emacs's anaconda-mode and company-anaconda packages. Update config:

    (eval-after-load "company"
     '(add-to-list 'company-backends 'company-anaconda))
    (add-hook 'python-mode-hook 'anaconda-mode)
    (add-hook 'python-mode-hook 'company-mode)
    

    Switch to virtualenv with pythonic-activate, if you have one.

    Now you've got M-. and you can press M-* to go back!

提交回复
热议问题