欢迎光临散文网 会员登陆 & 注册

使用Emacs管理中大型项目

2023-01-26 21:34 作者:C20先生  | 我要投稿

使用Emacs管理源代码

1、跳转到函数定义处

使用emacs内置函数来跳转到变量的源代码函数定义位置。

Emacs有几种方法可以在不安装任何额外包的情况下浏览每种语言的方法和函数定义。

2、Find function definitions and usage

To find the definition of a specific identifier (i.e.: function, method, class, etc) we can use M-. which is bound to xref-find-definitions and it will look for the identifier at point.

To get back where you previously were, use M-, which invokes xref-pop-marker-stack and pops back to where M-. was last invoked.

The above behaviour is possible due to the Marker stack which pushes each time with xref-find-definitions and pops from the stack with xref-pop-marker-stack.

3、Find all class or functions

To look for a regex pattern we use C-M-. which invokes (xref-find-apropos).

This is useful also to look for all the classes defined in the project, or functions, for example in Python: C-M-. class would retrieve all the classes known by the backend.




使用Emacs管理中大型项目的评论 (共 条)

分享到微博请遵守国家法律