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


当前回答

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

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

其他回答

我已经在生产/研究环境中使用spacemacs大约2年,neovim大约1年。Spacemacs是带有一些额外功能的emacs,比如图层等。neovim又是vim的一个分支,具有一些额外的特性。

就经验而言,我对他们俩都不太满意。我仍然在寻找一个长期的解决方案来满足我的文本编辑需求。

这里有一个简单的对比:

Neovim, vim, emacs, spacemacs, etc all of those editors consume less ressources compared to most of the editors out there. Neovim/vim is slightly faster than emacs, noticably faster than spacemacs. In terms of editing experience. I can easily say that emacs packages feel superior. I think that's because they blend in better with the core of emacs. Vimscript is nice and there are certainly great projects in the vim ecosystem as well. The good thing is they are better documented than most emacs projects I have seen so far. Both can be glitchy depending on the package you are using. Spacemacs tend to freeze, and neovim tend to display scary error messages, so pick your poison there. Modal editing in vim, is not an intuitive concept, but once you get used to it, you want it anywere. Both of the editor provide that.

Emacs的好处

Emacs has both non-modal interface (by default) and modal one (e.g. it can emulate vim and vi through Evil, Viper, or Vimpulse). One of the most ported computer programs. It runs in text mode and under graphical user interfaces on a wide variety of operating systems, including most Unix-like systems (Linux, the various BSDs, Solaris, AIX, IRIX, macOSetc.), MS-DOS, Microsoft Windows, AmigaOS, and OpenVMS. Unix systems, both free and proprietary, frequently provide Emacs bundled with the operating system. Emacs server architecture allows multiple clients to attach to the same Emacs instance and share the buffer list, kill ring, undo history and other state. Pervasive online help system with keybindings, functions and commands documented on the fly. Extensible and customizable Lisp programming language variant (Emacs Lisp), with features that include: A powerful and extensible file manager (dired), integrated debugger, and a large set of development and other tools. Having every command be an Emacs Lisp function enables commands to DWIM (Do What I Mean) by programmatically responding to past actions and document state. For example, a switch-or-split-window command could switch to another window if one exists, or create one if needed. This cuts down on the number of keystrokes and commands a user must remember. "An OS inside an OS". Emacs Lisp enables Emacs to be programmed far beyond editing features. Even a base install contains several dozen applications, including two web browsers, news readers, several mail agents, four IRC clients, a version of ELIZA, and a variety of games. All of these applications are available anywhere Emacs runs, with the same user interface and functionality. Starting with version 24, Emacs includes a package manager, making it easy to install additional applications including alternate web browsers, EMMS (Emacs Multimedia System), and more. Also available are numerous packages for programming, including some targeted at specific language/library combinations or coding styles.

vi类编辑器的好处

Edit commands are composable Vi has a modal interface (which Emacs can emulate) Historically, vi loads faster than Emacs. While deeply associated with UNIX tradition, it runs on all systems that can implement the standard C library, including UNIX, Linux, AmigaOS, DOS, Windows, Mac, BeOS, OpenVMS, IRIX, AIX, HP-UX, BSD and POSIX-compliant systems. Extensible and customizable through Vim script or APIs for interpreted languages such as Python, Ruby, Perl, and Lua Ubiquitous. Essentially all Unix and Unix-like systems come with vi (or a variant) built-in. Vi (and ex, but not vim) is specified in the POSIX standard. System rescue environments, embedded systems (notably those with busybox) and other constrained environments often include vi, but not emacs.

来源:https://en.wikipedia.org/wiki/Editor_war

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,因为它总是可用的。

首先,Vi(原始实现)今天不使用。你说的是一些Vim推导。

要扩展Vim功能,必须重新编译Vim, Emacs则不必。

Emacs在self中有Vim (viper模式)。

Emacs通常需要手动安装,Vim通常预安装在所有Unix之类的操作系统上(但如果你有ssh访问主机的tramp模式win Vim:)。

如果你尝试Vim,那么你讨厌Emacs,所以先从Emacs开始。

也请阅读http://www.dina.dk/~abraham/religion/vi-tutorial.html(链接下拉,所以使用这个)

hxxp中的答案搜索://en.wikipedia.org/wiki/Editor_war

偏颇的观点:

Vi(不是vim)是一种专业需要。你总是有某种形式的 Vi容易获得,无论什么环境。你可以在vi中 在emacs中,您可以在vi中在unix-land中构建bash命令。

甚至Microsquish也必须支持vi(尽管他们做得很好 隐藏它),因为政府和公司遵守公布 标准。

在我看来,如果你在一个繁忙的环境中从事一份亲力亲为的工作——不 温室里的一朵花,被限制在一个开发项目的一个花哨的钻机上 环境,或者在学术界——了解一个高级编辑是一项工作 障碍。不要学习vim或emacs中的所有花哨技巧,不要 开发一堆宏,使编辑环境屈从于你的意愿。 这是一个巨大的时间消耗,当你注意的时候 不同的机器,你可能不能证明在工厂 环境。

读读比尔·乔伊的论文,他写得很好,甚至可以说 非常漂亮,编辑纯文本的工程练习 快。帕里托法则适用于此:80%的水果都在20%里 篮子的。编辑纯文本非常非常快是关键 编辑能力——其他都是可选的——有时是有害的。