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


当前回答

在你的问题中,你没有提到你想让它用Lisp编程!但是当你评论你的回答时,我明白你实际上想要一个LISP编程接口。

对于这个精确的任务,忘记Vi吧。Emacs与LISP的集成非常棒!你应该使用SLIME。然后,您将与REPL进行出色的集成,能够将函数、缓冲区或文件直接计算到emacs缓冲区中运行的解释器中,以及更多…

其他回答

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

对我来说,emacs的优点是,

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

Emacs具有Viper模式,因此在某种意义上,它提供了一个超特性集(除了那些在使用Viper和Vimpulse的Emacs中缺少哪些Vim特性?)

vi(和VIM IIRC)的重量较轻(它可以就地编辑文件),但提供的功能较少(子进程通信、扩展语言)。

偏颇的观点:

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

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

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

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

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

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