Emacs宣布的快捷键是什么? [英] What is the short-cut key to jump to declaration in Emacs?

查看:113
本文介绍了Emacs宣布的快捷键是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在visual studio中,编辑C / C ++代码时,推动F12按钮更容易跳转到函数或变量的声明。



这个关键在emacs这样做吗?

解决方案


$ b

默认情况下,Emacs不会知道关于C或C ++代码的函数声明。首先,获取 Exduced Ctags 。然后,在源代码上使用命令 etags (Emacs的ctags)。将生成一个名为 TAGS 的文件。



然后,在编辑源代码的同时,要跳转到一个声明,按 M - 。(现代键盘上的元和点,或替代和点)。首先,Emacs会询问您的标签文件的位置。指向您生成的导航,然后导航将自动。



我建议阅读关于标签的Emacswiki文章,以便更好地了解此功能。



最新版本的Emacs(23.2)附带集成了 CEDET ,它具有更高级的C和C ++导航功能,但可能难以设置对,如果您有兴趣,请阅读更多。


In visual studio it 's easier to push F12 button to jump to a declaration of a function or variable when editing C/C++ code.

Is there a short-cut key in emacs to do that?

解决方案

Well, it's a bit more involved than that.

By default, Emacs doesn't "know" about function declarations for C or C++ code. First, obtain Exuberant Ctags. Then, use command etags (ctags for Emacs) on your source code. A file named TAGS will be generated.

Then, while editing your source code, when you want to jump to a declaration, press M-. (meta and dot, or alt and dot on modern keyboards). At first, Emacs will ask you for location of your tags file. Point it to the one you generated and afterwards navigation will be automatic.

I'd suggest reading Emacswiki article about tags for a better understanding of this functionality.

The newest version of Emacs (23.2) comes with CEDET integrated, which has more advanced features for C and C++ navigation, but it can be a bit difficult to set up right, so read more about it if you're interested.

这篇关于Emacs宣布的快捷键是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆