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

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

问题描述

目前,当我用C或C ++编码时,我使用Emacs的工作流涉及三个窗口。右边最大的包含我正在使用的文件。左边分为两个,底部是一个shell,用于键入编译或命令,而顶部通常是我在工作时要查询的某种文档或README文件。现在我知道有一些非常专业的Emacs用户在那里,而且我很好奇,其他的Emacs功能上是有用的,如果它的意图是使用它作为一个完整的IDE。具体来说,大多数IDE通常是以某种形式实现的:




  • 源代码编辑器

  • 编辑器

  • 调试

  • 文档查找

  • 版本控制

  • OO功能,如类查找和对象检查器



对于其中一些,Emacs可以适应这些功能非常明显,但是其余的部分?另外,如果一个特定的语言必须集中在一起,我会说它应该是C ++。



编辑:一位用户指出,当我说其余的时,我应该更具体。大多数情况下,我很高兴有效的版本控制,以及文档查找。例如,在SLIME中,对Lisp函数进行快速超帧查找是相当容易的。有没有快速的方法来查找C ++ STL文档中的东西(如果我忘记了的确切语法hash_map )?

解决方案

你必须具体说明你的意思休息。除了对象检查员(我知道),emacs很容易做到以上所有:




  • 编辑器(明显) li>
  • 编译器 - 只需运行 Mx编译并输入您的编译命令,从那里可以只需 Mx compile 并使用默认值,Emacs将捕获C / C ++编译器错误(最好使用GCC),并帮助您导航到带有警告或错误的行。

  • 调试 - 类似,当您要调试时,键入 Mx gdb ,它将创建一个具有特殊绑定的gdb缓冲区

  • 文档查找 - emacs有优秀CScope绑定用于代码导航对于其他文档:Emacs还有一个联机帮助页阅读器,对于其他一切,都有网页和书籍。

  • 版本控制 - 有很多Emacs绑定为各种VCS后端(CVS,SCCS,RCS,SVN,GIT都会想到)



编辑:我意识到我的文档查找的答案真的冒失的致力于代码导航。以下是一些更多的要点信息:





Google搜索无疑将会进一步展示。



链接显示,查找其他文档中的功能(和任何内容)都可以完成,即使不支持开箱即用。


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:

  • Source code editor
  • Compiler
  • Debugging
  • Documentation Lookup
  • Version Control
  • OO features like class lookup and object inspector

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++.

Edit: 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)?

解决方案

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:

  • 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)

Edit: 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天全站免登陆