使用 Emacs 作为 IDE [英] Using Emacs as an IDE

查看:29
本文介绍了使用 Emacs 作为 IDE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,当我使用 C 或 C++ 进行编码时,我使用 Emacs 的工作流程涉及三个窗口.右侧最大的包含我正在处理的文件.左边一分为二,底部是我用来输入编译或生成命令的外壳,顶部通常是我在工作时想查阅的某种文档或自述文件.现在我知道那里有一些非常专业的 Emacs 用户,我很好奇如果打算将它用作完整的 IDE,其他 Emacs 在功能上有什么用处.具体来说,大多数 IDE 通常以某种形式实现这些功能:

Currently my workflow with Emacs when I am coding in C or C++ involves three windows. The largest on the right contains the file I am working with. The left is split into two, the bottom being a shell which I use to type in compile or make commands, and the top is often some sort of documentation or README file that I want to consult while I am working. Now I know there are some pretty expert Emacs users out there, and I am curious what other Emacs functionally is useful if the intention is to use it as a complete IDE. Specifically, most IDEs usually fulfill these functions is some form or another:

  • 源代码编辑器
  • 编译器
  • 调试
  • 文档查找
  • 版本控制
  • OO 功能,如类查找和对象检查器

对于其中的一些,很明显 Emacs 如何适应这些功能,但其余的呢?此外,如果必须专注于特定语言,我会说它应该是 C++.

For a few of these, it's pretty obvious how Emacs can fit these functions, but what about the rest? Also, if a specific language must be focused on, I'd say it should be C++.

一位用户指出,当我说其余的呢"时,我应该更具体一些.主要是我对有效的版本控制以及文档查找感到好奇.例如,在 SLIME 中,对 Lisp 函数进行快速 hyperspec 查找相当容易.有没有一种快速的方法可以在 C++ STL 文档中查找某些内容(如果我忘记了 hash_map,例如)?

One user pointed out that I should have been more specific when I said 'what about the rest'. Mostly I was curious about efficient version control, as well as documentation lookup. For example, in SLIME it is fairly easy to do a quick hyperspec lookup on a Lisp function. Is there a quick way to look up something in C++ STL documentation (if I forgot the exact syntax of hash_map, for example)?

推荐答案

您必须具体说明其余部分"的含义.除了对象检查器(我知道),emacs 很容易完成上述所有工作:

You'll have to be specific as to what you mean by "the rest". Except for the object inspector (that I"m aware of), emacs does all the above quite easily:

  • 编辑器(显而易见)
  • compiler - 只需运行 M-x compile 并输入您的编译命令.从那时起,您只需 M-x compile 并使用默认值.Emacs 将捕获 C/C++ 编译器错误(最适用于 GCC)并帮助您导航到有警告或错误的行.
  • 调试 - 同样,当你想调试时,输入 M-x gdb 它将创建一个带有特殊绑定的 gdb 缓冲区
  • 文档查找 - emacs 具有用于代码导航的出色 CScope 绑定.对于其他文档:Emacs 还有一个联机帮助页阅读器,而对于其他所有文档,还有网络和书籍.
  • 版本控制 - 有很多 Emacs 绑定适用于各种 VCS 后端(CVS、SCCS、RCS、SVN、GIT)
  • editor (obvious)
  • compiler - just run M-x compile and enter your compile command. From there on, you can just M-x compile and use the default. Emacs will capture C/C++ compiler errors (works best with GCC) and help you navigate to lines with warnings or errors.
  • Debugging - similarly, when you want to debug, type M-x gdb and it will create a gdb buffer with special bindings
  • Documentation Lookup - emacs has excellent CScope bindings for code navigation. For other documentation: Emacs also has a manpage reader, and for everything else, there's the web and books.
  • version control - there are lots of Emacs bindings for various VCS backends (CVS, SCCS, RCS, SVN, GIT all come to mind)

我意识到我对文档查找的回答确实与代码导航有关.这里有一些更重要的信息:

I realize my answer about documentation lookup really pertained to code navigation. Here's some more to-the-point info:

谷歌搜索无疑会揭示更多的例子.

Google searching will no doubt reveal further examples.

如第二个链接所示,即使不立即支持,也可以在其他文档中查找函数(以及其他任何内容).

As the second link shows, looking up functions (and whatever) in other documentation can be done, even if not supported out of the box.

这篇关于使用 Emacs 作为 IDE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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