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

后端 未结 6 1508
余生分开走
余生分开走 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:40

    M-. normally runs the "find-tag" function. You should create a TAGS file of your python source files. Then you "visit-tags-table" before doing a M-. That way, Emacs will jump to all the definitions of the tag. Type C-u M-. to jump the next definition of your tag. See find-tag documentation for help. Consult Emacs help to know how to create a TAGS file from python source files.

    You can for example use Exuberant Ctags for creating the TAGS file.

    Go to the root directory of your python files and do this :

    ctags -e -R .
    

    A TAGS file is normally created at the root directory of the project.

提交回复
热议问题