Emacs和Vim之间有什么实际的、客观的区别?例如,使用一个可以做而另一个不行(或者使用一个比另一个更容易做)?为了选择一门课程,我应该知道些什么?
当前回答
Vim是一个方便的编辑器,你只需输入Vim的文件名来打开文件,编辑,保存和关闭。
Emacs是一个伪装成编辑器的“操作系统”,你可以评估代码来改变它的行为,并按你的喜好扩展它。在emacs上接收/发送电子邮件的模式类似于操作系统上的电子邮件软件。
当进行简单的编辑时,例如,修改配置文件,我使用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.
我在这里真正想强调的是:“许多人发现两者都知道是有价值的。
Vim was always faster to start up than Emacs. I'm saying that on any machine, out-of-the-box installs of Vim will start up faster than out-of-the-box installs of Emacs. And I tend to think that after a moderate amount of customisation of either one, Vim will still start up faster than Emacs. After that, the other practical difference was Emacs' modes. They make your life tremendously easier when editing XML, C/C++/Java/whatever, LaTeX, and most popular languages you can think of. They make you want to keep the editor open for long sessions and work.
总而言之,我会说Vim让您使用它来完成简短、快速的编辑任务;而Emacs则鼓励您投入长时间的会话。
Vim:
作为一个简单的编辑器更好(简单任务所需的键更少) 更活跃的脚本社区-内部语言:vimscript 一个集中的脚本、插件、配色方案…… 在python、ruby中也可扩展 可移植(emacs在这方面存在一些问题)
Emacs:
non modal by default (most of today's editors have taken this approach). Though there is evil-mode which emulates vim behavior. more powerful language for extending it (elisp is a full blown language, and in emacs you can practically redefine everything; while in vim you cannot redefine build in functions of the editor. On the downside, vimscript is relatively similar to today's dynamic languages while elisp doesn't resemble pretty much anything) more extendible excellent support for GNU tools (the bunch of them)
就我个人而言,我更喜欢vim——它很小,做了它应该做的事情,当我想要一个完整的IDE时,我打开它VS. Emacs的方法是一个编辑器,它想成为一个IDE(或者我应该说,一个操作系统),但并不完全,在我看来,过时了。以前有电子邮件客户端、ftp客户端、俄罗斯方块……一个包(emacs)中的东西是有意义的……如今,它不再是了。
然而,这两者都是程序员和超级用户社区用户之间的宗教讨论话题,在这方面,如果接触(在同一句话/问题中),两者都很适合开始激烈的战争。
(以下文字是我的观点,不应被视为事实或侮辱)
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命令是立即执行的键入键的组合,使用户可以选择是否使用命令。
内存使用和可定制性::: vi是一个更小更快的程序,自定义能力更有限,而Emacs启动时间更长,需要更多内存。然而,它是高度可定制的,并且包含大量的特性,因为它本质上是为文本编辑而设计的Lisp程序的执行环境。