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

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

    The following will index your current project

    find . -type f -name '*.py' | xargs etags

    But if you want to index your imported libs. You first activate your virtualenv. Then use which python to detect where your libs are and then pipe them to etags.

    workon my-project # if using virtualenvwrappwer
    source bin/activate # if using virtualenv
    
    find ${$(which python)/\/bin\/python/} -type f -name '*.py' | xargs etags
    

提交回复
热议问题