Emacs和Vim之间有什么实际的、客观的区别?例如,使用一个可以做而另一个不行(或者使用一个比另一个更容易做)?为了选择一门课程,我应该知道些什么?
当前回答
If you are looking for an objective analysis of both the editors, look at their origins and the philosophy behind their respective designs. Think, which one would suit you better and learn it (and learn it and learn it, because it takes time before you being to discover its true utility as against any IDE). An Introduction to Display Editing with Vi was written by Bill Joy and Mark Horton and he explains why he choose modal design and rationale for various key strokes ( it helps me to remember that CTRL-W +W (will switch to next Window and it will same for CTRL W+ CTRL W, just in case you held the CTRL key for a longer duration.
这里有一个Emacs时间轴的链接,并有对Multics Emacs论文的参考。这是一篇关于Emacs的RMS论文,我看到重点在可编程文本编辑器上(甚至早在1981年或更早的时候)。
我没有读过emacs的论文,但是读过Bill Joy的vi论文几次。 两者都是旧的,但你仍然会得到哲学,你可以选择使用当前的工具(vim 7。X还是emacs 25?)
编辑:我忘了说,阅读这两篇论文需要耐心和想象力,因为它会让你在阅读时回到过去。但这是值得的。
其他回答
我从vi开始,到emacs,然后到vim。我一直想试试Emacs,看看在过去五年中发生了什么变化。(说到IDE,我已经使用eclipse有一段时间了,但我更喜欢我的终端窗口连接我的mac和我(丈夫的)linux盒子)。
剪切粘贴的事最近一直困扰着我。在Vim中剪切和粘贴比在Emacs和IIRC中需要更多的步骤。从浏览器粘贴到终端窗口很烦人,除非你做了一些我不喜欢做的奇特的事情,所以我忍受了奇怪的缩进。我认为,在emacs中编辑多个文件更容易。如果两个文件都在屏幕上,至少可以从一个文件跳转到下一个文件。
我没有使用vi或emacs的花哨特性,因为我只是想开始编码的工作。我所需要的是漂亮的颜色和适当的制表符到空格的转换(对python尤其重要)。
我认为这完全取决于你是想使用:wq还是Ctrl-x Ctrl-s (IIRC)来保存文件,如果你不关心花哨的东西。
@mgb是正确的。一两个月前,我曾在Debian发行版中使用最低限度的linux来修复一些东西。Vi是唯一可用的编辑器。
Emacs实际上更像是一个无所不能的程序,而vi(m)实际上只是一个编辑器。如果您正在编辑文本,它们都很好,但我更喜欢emacs,因为我必须将一个移出主行才能移动,并在命令模式中不断键入错误的内容。如果您没有这个问题,vi(m)可能是您的编辑器。
我认为主要的区别在于设计目标。 VIM是UNIX的工作编辑器。 Emacs是针对GNU和lisp黑客的,所以它有一些混合的设计元素。
我在我的工作站上使用vim,而我也喜欢emacs。
我想引用《UNIX编程的艺术》一书中的一段话:
Many people who regularly use both vi and Emacs tend to use them for different things, and find it valuable to know both. In general, vi is best for small jobs – quick replies to mail, simple tweaks to system configuration, and the like. It is especially useful when you’re using a new system (or a remote one over a network) and don’t have your Emacs customization files handy. Emacs comes into its own for extended editing sessions in which you have to handle complex tasks, modify multiple files, and use results from other programs during the session. For programmers using X on their console (which is typical on modern Unixes), it’s normal to start up Emacs shortly after login time in a large window and leave it running forever, possibly visiting dozens of files and even running programs in multiple Emacs subwindows.
我在这里真正想强调的是:“许多人发现两者都知道是有价值的。
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
推荐文章
- 我如何使用vimdiff来解决git合并冲突?
- 在Vim中删除当前缓冲区的文件名/路径
- Git在终端提交时打开VIM,但无法返回终端
- 请参阅编辑器中的换行符和回车
- 如何在NERDTree中显示隐藏文件(以句点开始)?
- 如何复制一个选择到OS X剪贴板
- 如何删除(不削减)在Vim?
- Vim:在可视模式下快速选择文本块的方法
- 是否有vim命令来重新定位一个选项卡?
- MacVim和普通Vim有什么区别?
- 如何使Sublime Text成为Git的默认编辑器?
- 有什么方法可以在Vim中查看当前映射的键吗?
- 同一行上有多个命令
- 如何将所有文本转换为小写在Vim
- 使用vimdiff查看所有' git diff '