使用Emacs管理中大型項目
使用Emacs管理源代碼
1、跳轉(zhuǎn)到函數(shù)定義處
使用emacs內(nèi)置函數(shù)來跳轉(zhuǎn)到變量的源代碼函數(shù)定義位置。
Emacs有幾種方法可以在不安裝任何額外包的情況下瀏覽每種語言的方法和函數(shù)定義。
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.