Emacs和Vim之间有什么实际的、客观的区别?例如,使用一个可以做而另一个不行(或者使用一个比另一个更容易做)?为了选择一门课程,我应该知道些什么?


当前回答

对我来说,emacs的优点是,

tramp模式允许您通过ssh编辑远程文件。就像本地文件一样。 Tramp-mode + dired =全功能SFTP客户端 支持您需要的所有语言。 内置的终端模拟器(术语模式),所以我可以继续编码,而无需在应用程序之间切换。 可扩展性任何你不喜欢的东西都可以用lisp来改变。

其他回答

(以下文字是我的观点,不应被视为事实或侮辱)

With Emacs you are expected to have it open 24/7 and live inside the program, almost everything you do can be done from there. You write your own extensions, use it for note-taking, organization, games, programming, shell access, file access, listening to music, web browsing. It takes weeks and weeks till you will be happy with it and then you will learn new stuff all the time. You will be annoyed when you don't have access to it and constantly change your config. You won't be able to use other peoples emacs versions easily and it won't just be installed. It uses Lisp, which is great. You can make it into anything you want it to be. (anything, at all)

对于Vim,它几乎总是预先安装的。这是太快了。你打开一个文件做一个快速编辑,然后退出。如果您在其他人的机器上,则可以使用基本设置。它的可编辑性不是很好,但它仍然比大多数文本编辑器好得多。它能识别出你大部分时间是在阅读/编辑而不是打字,并使这部分工作更快。你的小指没有emacs症状。这并没有那么令人愤怒。这样更容易学。

即使我每天都在使用Emacs(而且喜欢它),除非你打算在你选择的程序上花费大量时间,否则我会选择vim

VI总是可用的,并且将在最残缺的、单用户模式、坏的图形、没有键图、慢的链接机器上运行——因此,仅仅为了系统管理任务,了解如何在它中编辑简单的文件是值得的。

Emacs是一个编辑器中的完整用户界面。其思想是在启动机器时启动Emacs,并且永远不要离开它。可能会有数千个会话。

与使用GUI编辑器/IDE和使用python/awk/等来完成额外任务相比,学习Emacs的功能是否值得,取决于你自己。

Emacs实际上更像是一个无所不能的程序,而vi(m)实际上只是一个编辑器。如果您正在编辑文本,它们都很好,但我更喜欢emacs,因为我必须将一个移出主行才能移动,并在命令模式中不断键入错误的内容。如果您没有这个问题,vi(m)可能是您的编辑器。

对我来说,emacs有更好的开发工具(不仅仅是基于标记的工具)。

Cedet(c/c++) Xrefactory(c/c++/java) 史莱姆(普通口齿) JDEE(java) 欧洲央行(代码浏览器) GDB 支持 NXML(xml)

Seems an answer has been selected already, but the big difference to me has always been the modal vs. non-modal. Vim is modal, which means that it makes optimizations based on a specific set of usage modes. At least that's how I've always looked at it. This makes using Vim a different experience because instead of having a work area that you type code in, you really are telling an environment to act on the text. This is why people say things like with Vim you really are learning a language. The :wq and :s/foo/bar is all part of a shell like environment that edits and reads text.

Emacs on the other hand is much closer to most editors/word processors/etc. you see today. You have a workspace that has a highly programmable interface. That is why you see things like email, irc, shells, etc. As a programmer it is easy to think in terms of saying "take the line number I'm on and do something with the information". The desire to leave the editor becomes less because instead of having to quit, open some other app/language and do things on some text, you have Emacs where you can do these things within the scope of your editor.

这两种观点并不一定是对立的,只是它们揭示了两个不同的焦点。就我个人而言,我使用Emacs,但我见过非常了解Vim的人,他们可以诚实地说,选择哪种并不重要。我首先尝试了Vim,但Emacs最终支持了我。的确,无论您选择什么,您都应该至少在一定程度上精通Vim,因为它总是可用的。