728

Without getting into a religious argument about why one is better than the other, what are the practical differences between Emacs and Vim? I'm looking to learn one or the other, but I realize the learning curve for each is high and I can't decide. I have never used an editor of this type (I've always used IDEs), so anything that helps a newbie is a plus.


Before a flame war starts: I'm not asking which is better, I'm asking the differences between the two. I would like an objective comparison.

Sasha Chedygov
  • 116,670
  • 26
  • 98
  • 110
  • 4
    If you use a Mac (OSX), then you will find that many basic emacs cursor movement commands work pretty much everywhere. (For example they work here where I am typing this comment into the web page.) So for Mac users, there is a system-wide benefit to learning at least the following subset of emacs: ^A ^B ^D ^E ^F ^K ^L ^N ^O ^P ^T ^V ^Y – Matt Mar 02 '14 at 11:46
  • 2
    @JamesAnderson: in my experience it's the opposite. Been using vim for 2.5 years, then switched to emacs. The emacs people mostly just don't care... "whatever works for you". Here is what `,salespitch` says in #emacs ` We aren't gonna lie. Emacs sucks. Some of us tolerate it, but we can't tell you if YOU'LL be able to. Try it and make up your own mind.` – Silex Apr 14 '14 at 07:53
  • 3
    Emacs is definitely a great operating system, but lacking only a decent editor. – technical_difficulty Mar 30 '18 at 20:55
  • $man [command] .. man uses vim. – Jimmy MG Lim Oct 25 '18 at 21:56
  • 2
    @JimmyM.G.Lim No, it uses the current pager on the system. If you run `PAGER=cat man` then man will display text directly to the screen. – S.S. Anne May 20 '19 at 22:13
  • thanks for the note JL. didnt know you can run pager. but what i had in mind was man (manual) uses the same command keys as vim. learn vim ... learn many.. – Jimmy MG Lim May 22 '19 at 18:10
  • 1
    @JimmyM.G.Lim the default PAGER is less, usually, whose keys are vim-inspired. That’s not man. It’s less. – D. Ben Knoble Oct 11 '19 at 12:35
  • 2
    guess the "primarily opinion based" police didn't exist when this was first asked ;-) ah, simpler times... one thing I'll say is that once, reading a book on emacs and trying it out, I thought it was the bomb. 3 weeks of vacation later I found I had totally forgotten all its keystrokes. vim on the other hand is not really my thing, but I can reliably semi-function with it when needed using just `i, esc, wq`. – JL Peyret Dec 24 '19 at 16:47

30 Answers30

523

(the text below is my opinion, it should not be taken as fact or an insult)

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)

With Vim, it's almost always pre-installed. It's fast. You open up a file do a quick edit and then quit. You can work with the basic setup if you are on someone else's machine. It's not quite so editable, but it's still far better than most text editors. It recognizes that most of the time you are reading/editing not typing and makes that portion faster. You don't suffer from emacs pinkie. It's not so infuriating. It's easier to learn.

Even though I use Emacs all day every day (and love it) unless you intend to spend a lot of time in the program you choose I would pick vim

Zignd
  • 6,246
  • 11
  • 34
  • 57
James Brooks
  • 3,563
  • 4
  • 24
  • 25
  • 166
    W.r.t not having it available: I suggest putting your .emacs and .emacs.d in a source control repo, and so getting your perfect Emacs setup is simply a matter of a checkout. – Duncan Bayne Aug 16 '10 at 23:49
  • 10
    Both emacs and vim can suffer from what is described above: both can be configured to the point where they are unrecognizable compared to their vanilla forms. Also, I second the use of a vcs. – Alexej Magura Apr 02 '14 at 00:09
  • 12
    What systems do you work on, @Radu? I've never seen a real-life system in the 2010s that had real `vi` instead of `vim` aliased to that. – ELLIOTTCABLE Feb 19 '15 at 11:48
  • 10
    Maybe Vim is easier to learn than Emacs, but it's incredibly confusing the first time you start it up if you have no previous experience with it! I had to use google to be able to close it down, and still had to try several times to get it right. – HelloGoodbye Jun 30 '15 at 21:39
  • 11
    Never underestimate the "pre-installed" perk of VIM: it's almost always available wherever you go, and its usable with little/no customization. I use it all the time when `ssh`ing to other machines. This is why I learned it first—that, and because my friends knew VIM and could help me. (Don't underestimate friends' support either!) – jvriesem Aug 25 '15 at 19:13
  • Fairly objective answers here. I'm with @jvriesem. The fact that I will have it everywhere and I can just do basic editing without being an expert. – chosenbreed37 Apr 20 '16 at 13:37
  • 1
    Having said I find Atom or Notepad++ really useful (mainly because they are lightweight) – chosenbreed37 Apr 20 '16 at 13:50
  • 1
    @chosenbreed37 I've found that Atom is lightweight if you don't use any extensions. Soon as you use them, it's as bad as Chrome. Atom would be vastly improved if I could select which loadout I want to use, rather than having all plug-ins enabled because it doesn't know which project I'm about to use. – cjm Aug 26 '16 at 00:01
  • @ELLIOTTCABLE The default FreeBSD droplet from Digital Ocean has `vi` instead of `vim` (or that's what I assume it is, since `gqip` didn't work until I `sudo pkg install vim`). – cjm Aug 26 '16 at 01:45
  • Adding an objective point: [RSI](https://en.wikipedia.org/wiki/Repetitive_strain_injury), also parodied _Emacs pinkie_, is usually avoided quite easily by [swapping *Caps* and *Ctrl* keys](https://www.emacswiki.org/emacs/MovingTheCtrlKey). Even if you don't use Emacs, this is advisable since *Caps* is used far lesser compared to *Ctrl*; putting the latter in the home row makes sense. In fact, most programmers I know kill *Caps* and make both *Ctrl*. It's unfortunate that modern keyboards have this kind of layout, while many older ones had *Ctrl* in the home row. – legends2k Feb 22 '17 at 04:05
  • 3
    @legends2k I mean, I don't know where you get ‘most’ mapping `caps-lock` to `ctrl` — personally, every programmer I know maps `caps-lock` to `esc`! ;) – ELLIOTTCABLE Apr 28 '17 at 23:59
  • I switched to Spacemacs after maintaining my own config for years, and it suits me well (though I feel a little dirty). I don't have it open 24/7, and use it only for coding/hacking and org-mode, but still I prefer emacs over vim. Using vim-bindings in Spacemacs/emacs means you'll learn the modal editing and be able to work on systems with only vim installed as well. I tend to use vim for quick edits. So, for a new user not set on crafting his own config I would recommend using Spacemacs with vim bindings to learn both. – anr78 Aug 03 '17 at 21:36
  • @ELLIOTCABLE I have Debian Stretch, and I did not have vim pre-installed. – ingroxd Mar 12 '18 at 01:09
  • 2
    I run emacs like I would run Notepad. I most definitely do not live inside it. I often have 10 or 20 instances spread across my virtual desktops. Prescriptivism and emacs are completely at odds in my mind. – Darren Ringer Apr 05 '18 at 18:45
  • @DuncanBayne it is not a matter of a simple checkout. I work on three different OSs (not by choice) and it is not trivial to have your config to work independent of a platform. – A_P Feb 19 '19 at 21:12
  • That's true @A_P. Back when I worked on OSX, Linux, and Windows regularly I had a fair bit of special case code in my config. These days I'm almost entirely on one OS (FreeBSD) and it's a lot easier. – Duncan Bayne Feb 22 '19 at 07:44
  • @DuncanBayne That must be nice))) I kinda got tired of pushing for a single OS. Too many non-tech people want MS OFFICE. – A_P Feb 22 '19 at 14:16
  • I'm aware this was posted back in '09, but Vim offers a bunch of plugins for all kinds of stuff too. Vim 8 has made a lot of progress on async features as well. There's calendars, games, [note apps](https://github.com/vimwiki/vimwiki), and yes, [music players](https://github.com/HendrikPetertje/vimify). There's an embedded terminal that can be manually configured to use a different shell (mainly useful on Windows), there's plugins for file browsers (and an embedded plugin for that too), and there are [browser plugins](https://github.com/yuratomo/w3m.vim). – Zoe Jun 19 '19 at 16:16
  • At least more recent versions of Vim seem to catch up, and with several forks of Vi and Vim, it's highly likely there's forks that further extend Vi*'s abilities. Either way, it's not *just* a simple editor in the way it looks like you're outlining it. It's a lot more than that. – Zoe Jun 19 '19 at 16:18
  • 1
    "With Emacs you are expected to have it open 24/7 and live inside the program" I would disagree heavily with that. It's common to do so, but it's hardly an expectation. – Koala Bear Dec 04 '19 at 00:38
144

Vim is not a shell. And it does not communicate well with subprocesses. This is nearly by design, whereas in Emacs, these elements are included by design. This means that some stuff, like embedding a debugger or an interpreter (yielding a sort of IDE), is difficult in Vim.

Also, Emacs shortcuts are mainly accessed through modifiers, and obviously the Vim interface is famously modal, giving access to an absurd amount of direct keys for manipulation.

Emacs used to be the only editor of the two that was programmable, and while Vim has a lot of weird levels to its programmability, with the addition of Python and Ruby bindings (and more, I forget), Vim is also programmable in most ways you'd care for.

I use Vim, and I'm fairly happy with it.

Zignd
  • 6,246
  • 11
  • 34
  • 57
Svend
  • 7,242
  • 3
  • 27
  • 43
  • 8
    Small update: Vim supports way better communication with sub-processes since version 8.0 and 8.1 even introduced terminal buffers, so it is getting a bit closer to emacs in thar regard. – DarkWiiPlayer Aug 16 '18 at 06:48
116

Vim:

  • better as a simple editor (fewer keys required for simple tasks)
  • more active scripting community - internal language: vimscript
  • one central repository of scripts, plugins, color schemes, ...
  • also extensible in python, ruby
  • can be made portable (emacs has some problems with that)

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)

Personally, I prefer vim - it is small, does what it's supposed to do, and when I wish a full blown IDE I open VS. Emacs's approach of being an editor which wants to be an IDE (or should I say, an OS), but is not quite, is IMHO, outdated. In the old days having a email client, ftp client, tetris, ... whatnot in one package (emacs) made some sense ... nowadays, it doesn't anymore.

Both are however a topic of religious discussions among the programmer and superuser community users, and in that respect, both are excellent for starting flame wars if put in contact (in the same sentence / question).

Hi-Angel
  • 3,835
  • 6
  • 50
  • 78
Rook
  • 54,867
  • 44
  • 156
  • 233
  • 48
    "better as an editor" is pretty vague. I'd be interested in seeing reasons why. – Allen Sep 16 '09 at 00:38
  • 42
    @Allen - What is vague in it ? I rarely meet users of both vim and emacs, who have a problem with that statement. Even hardcore emacs users usually accept it as a fact. Have you used both editors ? I believe it is relatively obvious that vim has an advantage in the aspect of text editing features. – Rook Sep 16 '09 at 00:58
  • 39
    I am incredulous that anyone would accept that as a fact. As a long time user of both emacs and plain VI, I have used vim a few times - but "better as an editor" has to go to emacs in my mind if for no other reason than a far wider selection of major and minor modes to help you as you type. – Kendall Helmstetter Gelner Sep 16 '09 at 01:42
  • 62
    Vim is better as an editor because manipulating text requires less movement of your hands and fingers than emacs, at least that is my experience. – StackedCrooked Sep 16 '09 at 01:53
  • 3
    @Kendall - Minor/major modes are not text editing features per se. Otherwise, we could take completion also as a text editing feature. What I ment under this while writing it, was text manipulation features. – Rook Sep 16 '09 at 02:34
  • 7
    But that aside, effectively vim is better suited for editing: line numbers, visual mode, manipulation http://wint1.kaist.ac.kr/files/attach/images/59/450/vi-vim-cheat-sheet.gif . FCOL, I had trouble getting emacs just to scroll one line at a time. – Rook Sep 16 '09 at 02:58
  • 1
    It seems impossible to sensibly say that either of the two editors is better than the other - the choice is purely a matter of preference. However both are better than any of their competition. – Jon Kiparsky Dec 22 '15 at 20:53
  • 1
    Vim is better for editing text. The question is, are you editing text or editing code? – Radon Rosborough Apr 16 '17 at 05:08
  • @RadonRosborough Last I checked, code is a subset of text. At least in any language I've ever felt inclined to program in. – Dan Bechard May 25 '17 at 18:33
  • 3
    @Dan You're not wrong, but text is a subset of binary -- and would you really want to use a binary editor instead of a text editor for your code? By specializing to text, a text editor can give you more efficient editing. Similarly, while Vim is the fastest editor for text in general, Emacs can sometimes give you an advantage by adapting better to your particular problem domain or programming language. – Radon Rosborough May 25 '17 at 22:38
  • @RadonRosborough How is text a subset of binary??? Binary has two characters: 0 and 1. Text has hundreds or thousands depending on your encoding. – Dan Bechard May 26 '17 at 16:13
  • 3
    @Dan All text is encoded as binary when it is dealt with by computers. Binary is the most general representation of data, to a computer. All text can be encoded as binary, not all binary can be decoded to text (see OSString versus String in Rust, for example). – Radon Rosborough May 26 '17 at 18:39
  • @RadonRosborough This topic is about text editors used by humans, not the internal representation of data by computers. What the data looks like under the covers is irrelevant from a text editor usability standpoint. – Dan Bechard May 26 '17 at 20:01
  • Would be nice to note that Emacs is non-modal only by default. There is `evil-mode` which emulates vim, and is quite popular. I dare to say, weren't it for `evil-mode`, I could've migrated to vim. **edit**: nvm — I noted the post is comm. wiki, so I can edit it. – Hi-Angel Sep 26 '17 at 23:10
  • 1
    Emacs has graphical debugger support (for a variety of languages) by default. Vim needs plugins to enable graphical debugging, and not a single debugger plugin works on Windows. Emacs also comes with a file browser by default, while with Vim you need plugins for this. – aks Feb 12 '18 at 16:44
  • 1
    Vim also has a file browser, at least in more recent versions. See `:help netrw`. – SilverWolf Sep 23 '18 at 21:36
55

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.

Here is a link to Emacs timeline and has the reference to Multics Emacs paper. Hereis RMS paper on Emacs, where I see the stress is on a programmable text editor (even way back in 1981 and before).

I have not read the emacs papers, but have read Bill Joy's vi paper a couple of times. Both are old, but still you will get the philosophy and you might choose to use the current tool (vim 7.x or emacs 25?)

Edit: I forgot to mention that it takes patience and imagination to read both these papers as it takes you back in time while reading it. But it is worth.

albusshin
  • 3,530
  • 2
  • 25
  • 54
Senthil Kumaran
  • 47,625
  • 13
  • 83
  • 117
45
  1. 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.

  2. 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.

All in all, I'll say that Vim pulls you to it for short, fast editing tasks; while Emacs encourages you to dive in for long sessions.

Yawar
  • 9,625
  • 4
  • 42
  • 72
  • 1
    I don't think modes makes life easier, in the contrary. And [Larry Tesler thinks the same](http://www.nomodes.com/Larry_Tesler_Consulting/Home.html). – Eliran Malka Apr 16 '14 at 19:06
  • 2
    How do Emacs's modes help with coding? (I'm new to it...) – jvriesem Aug 25 '15 at 19:11
  • 4
    Long time ago I switched from vi to emacs for four reasons: (a) one click to get to the next compiler error, (b) gdb integration, (c) grep and find-grep. Is it possible to do these things in vim now? – zzz777 May 26 '17 at 17:57
  • "Vim was always faster to start up than Emacs" -- if you keep an emacs server running, tarting emacs-client is *very* fast. I have scripts for that, that I replicate (using git) on all my machines. (I *do * also use vim, actually; it always depends on where I am, and what the task is) – Jay Jan 07 '19 at 16:29
  • "Vim was always faster to start up than Emacs" -- also, with `use-package` and its `:defer` option, my Emacs opens almost immediately. I even gave up using emacsclient. – Jay May 14 '20 at 19:24
39

VI is always available and will run on the most crippled, single user mode, broken graphics, no keymap, slow link machine - so it's worth knowing how to edit simple files in it just for sysadmin tasks.

Emacs is a complete user interface in an editor. The idea is that you fire up Emacs when you start the machine and never leave it. It's possible to have thousands of sessions present.

Whether learning the capabilities of Emacs are worth it compared to using a GUI editor/IDE and using something like python/awk/etc for extra tasks is up to you.

Eliran Malka
  • 14,498
  • 5
  • 72
  • 96
Martin Beckett
  • 90,457
  • 25
  • 178
  • 252
  • 2
    I know VI for just those reasons - but these days I would say it's pretty unlikely you'd encounter a UNIX system without at least a basic EMACS installation, and it can make a poor shell environment more tolerable. – Kendall Helmstetter Gelner Sep 16 '09 at 01:49
  • 1
    True but it might not work in rescue mode with no keymap or term set - I have fixed systems where using the 'hijk' was the only option. – Martin Beckett Sep 16 '09 at 02:50
  • 3
    Or, jam busybox into an initrd and debug a broken storage driver for the boot device, so early in the init process that all you have is the initial ram disk, and yet you *still* have an editor -- vi. – smcameron Sep 16 '09 at 04:02
  • 2
    After a while with vi, your fingers know the movements - but you can't remember what the actual keys are! – Martin Beckett Sep 16 '09 at 17:17
  • Note that this is true of vi, but not necessarily vim. vim doesn't support "open" mode (aka, my terminal is fubar mode) but it does support a lot of things that vi doesn't, which make it more suitable for programming. – Sean McMillan Feb 04 '11 at 14:36
  • 12
    I thought it was `ed` that was "always available and will run on the most crippled, single user mode, broken graphics, no keymap, slow link machine." Wait, what year is this? (Sigh -- `ed`, I'll never forget you.) – belacqua Mar 09 '11 at 17:52
  • @jgbelacqua - true, but if the machine is so broken you can't even use vi in line mode I would probably give up! Or at least pull the disks and work on them somewhere else – Martin Beckett Mar 09 '11 at 19:21
  • 2
    @Kendall: Current ubuntu linux does not come with emacs installed. – intuited Mar 30 '11 at 18:53
  • @Kendall: And there are embedded systems where you might only get busybox, e.g. Android – Interarticle Jun 13 '14 at 06:25
  • On remote servers, if it doesn't have Emacs installed, you can always use the Tramp-mode. – Vasantha Ganesh Jan 23 '19 at 10:55
26

I'm a full-blown Emacs fan-boy, but I knew VI long before I knew Emacs. That said, I make all of my people learn VI because it's always available, everywhere. Can't go wrong with either one of them.

Joe Casadonte
  • 13,273
  • 9
  • 41
  • 47
  • 2
    This is my experience as well... Emacs or uEmacs was never available. My first editor was uEmacs (on Amiga) but since I learnt vim it was just too convenient to have around. – Marius Oct 31 '13 at 13:05
  • This is basically my experience too. Vi is everywhere and generally installed as the default $EDITOR on unix systems, so you have to know it if you are working with unix. That said, I use emacs for text editing every day and I love it. – Fergie Dec 15 '16 at 09:20
14

I started with vi, went to emacs, then to vim. I've been thinking of trying out Emacs to see what's changed in the last five years. (Speaking of IDE's, I had gotten into eclipse for a while, but I prefer my terminal window connecting my mac to my (husband's) linux box).

The cut and paste thing has been bothering me lately. Cut and paste in Vim takes more steps than in Emacs, IIRC. And pasting from say a browser to a terminal window is irritating unless you do something fancy that I don't feel like doing, so I put up with the weird indentation. I think, editing multiple files in emacs was easier. At least jumping from one file to the next if you have them both up on the screen.

I haven't played with the fancy features of either vi or emacs, as I just like to get to the business of coding. All I need is the pretty colors and proper tab to space conversion (especially important with python).

I think it all depends on if you want to use :wq or Ctrl-x Ctrl-s (IIRC) to save a file if you don't care about the fancy stuff.

@mgb was correct. I've been in the bare minimum linux to fix something just a month or two ago in a Debian distro. vi was the only editor available.

Szymon
  • 168
  • 9
  • 1
    This still isn't one and done, but it is much easier than adjusting all the settings that mess up terminal pastes. Use `:set paste`, then paste your text and when you're done `:set nopaste` will go back to normal mode. There is also the `:set pastetoggle=` command that will toggle this using your chosen key combo. – hbar Aug 18 '10 at 09:45
  • In indent mode, you can do `^R^P+` to paste from the clipboard and keep current indentation. `^R^O+` will drop indentation. `^R+` will insert it as though you'd typed it. `:help i_^R^P` for more info. – intuited Mar 30 '11 at 19:26
  • 4
    I can't imagine cut/paste being any easier than `yyp`. Also, see here to cut and paste to and from different windows http://stackoverflow.com/a/8757876/654789 – puk Feb 26 '12 at 11:46
  • @puk - Ctrl-k (yank) / Ctr-y (put) is just as easy in emacs. In Emacs you also have multiple registers (a-z) you can save either text or the current position into... – Kendall Helmstetter Gelner Jun 13 '14 at 16:10
  • 3
    vim has multiple registers as well – TamaMcGlinn Mar 26 '17 at 18:28
  • I've always got vim from my distro, so I suppose it isn't compiled right to support the X clipboard being accessible from whichever register is supposed to work. My workaround uses xsel. I define a macro that binds the key combo of my choice to ':r! xsel --clipboard'. – Jim Vargo May 08 '17 at 22:46
14

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.

The two ideas are not necessarily contrasting, but it is simply that they reveal two different focuses. Personally I use Emacs, but I've seen folks who know Vim really well and can honestly say it doesn't matter which you choose. I tried Vim first but Emacs ended up sticking for me. It is true that no matter what you choose, you should be at least somewhat proficient in Vim as it really is always available.

elarson
  • 807
  • 8
  • 10
13

There is a huge difference on a day-to-day level - Vim (or any vi variant) is inherently modal (you go into command modes where you cannot edit) and Emacs (along with most other editors) are not.

Sure, using menus and such you don't have to actually enter command mode in Vim - at first. But to use even a tiny fraction of the power of Vim you will. That is at the heart of the Vim/Emacs debate.

Personally, I also think Emacs is far more extensible. You can find Elisp packages for many things.

I am curious, though, why you are thinking to learn one of these over a more traditional IDE. What is it you want to learn one of these for?

Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
Kendall Helmstetter Gelner
  • 73,251
  • 26
  • 123
  • 148
  • 8
    I just want to learn it to see if it stands up to its hype, to be honest. I've seen how flexible both of them are, and I've seen experts do some pretty crazy stuff in them, and I want to see if it's worth the learning curve. Plus, my IDE doesn't support Lisp. :) – Sasha Chedygov Sep 15 '09 at 23:45
  • 3
    Hmm. The problem is that there is so much of Emacs... but the thing I still leave an IDE for to use emacs is complex series of repetitive tasks, which I automate using macro recording. For example you can take a current word or expression, copy that into a "buffer" (think cut / paste only you can have more than one), then go into another file, type some text partly using the copied value and then another previously copied value as well, advance the cursor, save the position and return to the first buffer again... then repeat the process for the next line of the original file. – Kendall Helmstetter Gelner Sep 16 '09 at 01:46
  • And you can save that macro for later if you want, or just let it die with the editing session if you have no need for it later. – Kendall Helmstetter Gelner Sep 16 '09 at 01:47
  • KHG: Vim excels at using macros for exactly those sorts of repetitive text-editing tasks (arguably, it's even better than Emacs, as you generally will need far fewer keystrokes to set up the macro) – Yewge Sep 16 '09 at 14:13
  • 1
    I have used Macros heavily in both vi and Emacs. What you are missing is the fact that Emacs has a far wider selection of methods to access while using macros, and the fact that you can use cut buffers everywhere - even in the middle of search terms for example. Please tell me how you would write a macro that would select one word of an expression based on a regex, take the found term, search another document on that term and then do replacements around it? – Kendall Helmstetter Gelner Sep 16 '09 at 17:45
  • 2
    @kendall-helmstetter-gelner - that is possible with vimscript, or the languages vim has bindings for (like ruby/vim/tcl/perl). You have access to all of vim's functions and editor buffers from the scripting languages. – segy Sep 18 '09 at 19:08
  • @Kendall: `qq/{re}^M:let found = matchstr({re})^M:e {another-document}^M:exec "%g/\C\V" . escape(found, '\\') . "/{replacement}/"^Mq`. Presumably you'd want to parameterize `{found}`, `{another-document}`, and `{replacement}`, which you could do by generating the macro text in a function. Then you do something like `let @q = MakeReplacementMacro('WTF', 'emacs-vs-vim.txt', 'FTW')`, at which point you can just hit `@q` to utilize this hypothetical tool. – intuited Mar 30 '11 at 19:07
  • 1
    That's impressive but to do the same in Emacs requires only using the keystrokes I already know to form a complex macro, instead of having to write it out by hand. It's easy for anyone that knows emacs to make a macro that does that task but I would say there are not a lot of VI users that could construct the macro you laid out without a fair amount of research. – Kendall Helmstetter Gelner Mar 30 '11 at 20:53
11

There is a lot of thing that have been said about both editors, but I just have my 5 pence to add. Both editors are wonderful and you cannot go wrong with either of them.

I am a vi/vim user for about 15 years now. I've tried converting to emacs several times but every time was rather discovering that vim actually can do the missing thing out of the box without the need to write a lisp extension or install something.

For me the main difference in the editors that vim makes you use the environment/OS, while emacs tries to encapsulate it or replace it. For instance you can add a date in you text by :r!date in vim, or calendar with :r!cal 1 2014, or even replace the contents of you buffer with the hex version of the contents. Eg. :%!xxd, edit hex and then get back with :%!xxd -r, and many more other uses, like builtin grep, sed, etc.

Another example is use with jq and gron. Eg. paste json blob to the editor and then run for tranformation:

:r!curl -s http://interesting/api/v1/get/stuff
:%!gron | grep 'interesting' | gron -u

OR

:%!jq .path.to.stuff

Each of the piped commands above can be run separately via :%!<command>, where % means all document, but can also be run on selection, selected lines, etc. Here gron output can be used as jq path.

You also get the EX batch editing functionality, eg. Replacing certain words, reformatting the code, converting dos->unix newline characters, run a macro on say 100 files at a time. It is easily done with ex. I am not sure if emacs has something similar.

In other words IMHO vim goes closer to the unix philosophy. It generally simpler and smaller, but if you know your OS and your tools, you wont likely need more than it(VIM) has to offer. I never do.

Besides vi is defacto standard on any unix/linux system, why learn to use 2 tools that do the same thing. Of course some systems offer mg or something similar, but definitely not all of them. Unix + Vi <3.

Well, just my 5 pence.

Alex
  • 778
  • 1
  • 10
  • 14
  • 9
    "Vim goes closer to the unix philosophy." -- You are speaking here of the philosophy regarding the tools available from your shell. The shell itself, however, is a big agglomeration of built-ins, history, globbing, process control, programmability, and so on. _Emacs clearly lies closer to the philosophy of unix shells:_ provide a highly customizable environment within which tools can be used together, and make it easy for the user to extend the set of tools with their own code snippets as they work. I think we can see that **both** _emacs_ and _vim_ are strongly rooted in the unix tradition. – Matt Mar 03 '14 at 12:21
  • 1
    Thanks for your comment. **It was by no means my intention to start an editor war here neither was it to offend _emacs_ users.** I just find it easier and more portable to invoke the actual commands from shell (or from within the editor) as opposed to writing complex extensions to encapsulate the functionality in the _emacs_, which tends to make the environment bloated over time. These extensions however depends on the user preference and can be done but by no means enforced by either of the editors. So agree with you regarding the _emacs_ and _vi(m)_ place in UNIX tradition. – Alex Mar 04 '14 at 09:56
  • 1
    Just to continue the non-war, I hope it was clear that I did not disagree with your analogy "vim is more like a unix tool". It simply occurred to me that this intuition could be extended with "and emacs is more like a unix shell". :-) – Matt Mar 04 '14 at 22:01
  • @Matt: I like the analogy. Amen to that. ;) – Alex Mar 07 '14 at 11:39
  • 2
    You can do everything you mention, and a lot more, in emacs (hexl-mode for example goes right to editing the file in hex with an ascii preview to the side). I know VI pretty well also, but creating macros is a lot easier and more flexible in Emacs, and it can simply do way more than even most modern VIM implementations. That's the reason to know it, because emacs is in most places and can offer a real text editing boost. – Kendall Helmstetter Gelner Jun 13 '14 at 16:08
  • oh, yes. I by no means was stating otherwise. Emacs is indeed more powerful text editor with more features out of the box. I'm just saying that VI/VIM has always been enough for me as it is. – Alex Jul 02 '14 at 11:03
  • Actually in my above comment I should have said - Emacs is a more powerful SYSTEM where lots of features can be programmed to allow powerful text editing experience, however I do think that with the default config - vi/vim is a better text editor and together with ability of using the OS commands from within, requires less config and effort to be useful. – Alex May 24 '19 at 13:07
11

I would like to put here a quote from the book "The Art of UNIX Programming":

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.

What I really want to highlight here is the: «Many people find it valuable to know both

Andriy Tykhonov
  • 518
  • 6
  • 11
  • This is probably outdated . I think those days Emacs's inbuilt ability to have Browser , SSH , Music Player and slow systems which stopped firing up other apps made it to believe it was better off to open one app and stick with it ? – Nishant Jun 29 '14 at 07:47
  • Great news is: it is not outdated! You can use Browser, Music Player etc outside Emacs but what Emacs really brings is the same good interface to all these functions and the one way (Elisp) to extend them. – Andriy Tykhonov Jul 01 '14 at 10:31
  • 1
    According to me TAUP's perspective of Emacs is outdated because , those days Emacs was an advantage to have one as it was a single app running that could do multiple things at a time - like irc , music , remote edit etc . However today you have excellent applications for each of these purpose and memory is not an issue as before too ... Imagine reading Gmail in Emacs - I mean Gmail interface really has awesome keybindings in built , customizing that into an Emacs Email Client is going to take considerable time and might not be as good as the original Gmail Interface etc . – Nishant Jul 01 '14 at 15:59
  • It is not outdated! :) – Andriy Tykhonov Jul 01 '14 at 20:24
  • > However today you have excellent applications for each of these purpose Yes, but you have all these applications with very different interfaces, configs, user experience etc etc etc... But Emacs is the One Tool! For example, I very like Emacs key bindings, I use them in the shell in the browser. And it is very good that at least some things are the same within applications... – Andriy Tykhonov Jul 01 '14 at 20:28
  • I read Gmail letters from Emacs and feel myself very good with that :) And I don't like Gmail interface at all :) You cannot have the same power and richness in the browser which you could have in Emacs! – Andriy Tykhonov Jul 01 '14 at 20:29
  • Just for example, I configured Emacs (Gnus) so it gets emails from the local folder. The content of these emails are diff-files which generates every 5 minutes from the incoming changes coming to the repository. I can open the folder in the Gnus and then open email (diff-file) and I see it highlighted! Can you do something like that in Gmail? :) – Andriy Tykhonov Jul 01 '14 at 20:34
  • Well, forget about mails! :) Have you ever heard about org-mode? :) May be about Magit? :) – Andriy Tykhonov Jul 01 '14 at 20:49
  • Man, Emacs is under active development! :) It cannot be outdated! :) – Andriy Tykhonov Jul 01 '14 at 20:50
10

For me pros of emacs are,

  • tramp-mode allows you to edit remote files over ssh. just like local files.
  • tramp-mode + dired = full featured sftp client
  • support for every language you will ever need.
  • built in terminal emulator(term-mode) so i can keep coding without switching between applications.
  • extensibility anything you don't like you can change using lisp.
Hamza Yerlikaya
  • 47,689
  • 37
  • 135
  • 231
  • 12
    FWIW: vim pretty much has the first 3 (though with different names. "tramp-mode" is "netrw" in vim). #4 is generally considered a bug, not a feature by vim users. #5 is true in vim if you replace "elisp" (the worst lisp dialect ever, my Emacs-loving friends tell me) with python/mzscheme/perl/ruby/tcl/vimscript. – Laurence Gonsalves Aug 17 '10 at 05:26
  • 3
    can you comment as to why #4 a bug? – Hamza Yerlikaya Jan 29 '11 at 05:58
  • 2
    Check out the [Conque](http://www.vim.org/scripts/script.php?script_id=2771) addon for an embedded shell in vim. – intuited Mar 30 '11 at 19:27
  • I actually wonder why no one has made a variation of emacs yet, where elisp is being replaced by e.g. ecl (a real common lisp). – BitTickler May 03 '21 at 02:08
9

For me, emacs has better development tools(not only tags based tools).

bmeric
  • 1,090
  • 1
  • 17
  • 27
9

Benefits of 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.

Benefits of vi-like editors

  • 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.

Source: https://en.wikipedia.org/wiki/Editor_war

Hi-Angel
  • 3,835
  • 6
  • 50
  • 78
artamonovdev
  • 3,758
  • 1
  • 23
  • 32
7

The biggest difference for me in choosing to use emacs over vim was the built in gdb support in emacs. Vim doesn't have this included in it's default distribution and the project there for integrating gdb and vim was nearly impossible to get working with MacVim

Grant Limberg
  • 19,335
  • 10
  • 59
  • 84
6

Now you do not even need to think about the difference between these two because of Spacemacs. It is a community-driven Emacs distribution.

As it said,

The best editor is neither Emacs nor vim, It's Emacs and Vim.

Spacemacs combines the best from both Emacs and Vim, which make your life and job much easier.

See screenshot below,


(source: spacemacs.org)

TylerH
  • 19,065
  • 49
  • 65
  • 86
X.Creates
  • 11,800
  • 7
  • 58
  • 98
  • 3
    This is cheating... It's emacs with some funky configs ;) Quite a lot of configs actually – Alex Apr 27 '16 at 16:51
  • 2
    This is great - when it works. When it doesn't - if you don't know elisp and emacs already or you can't find the core contributors in gitter chat - you're usually stuck and out of luck. (sometimes deleting your melpa directory in .emacs can fix things, though...) – Aaron Hall Oct 11 '16 at 14:58
  • 1
    Though it has a lot more stuff than I need, I'm really satisfied with Spacemacs. I have my dotfiles on github so I can setup new machines easily/fast, and since I use evil (vim keybindings) I have enough skills to get by when I have to work on machines where I can't install my spacemacs config. – anr78 Aug 03 '17 at 21:25
5

Its like apples and oranges. Both have different design and philosphy. Vim is a Text Editor while Emacs is a Lisp Interpreter that does Text Editing.

I use Vim because its fast, sleak, and really good at manipulating texts. It has a composable natural key binding that can make your development tasks really harmonic. Vim is based on the simple *nix philiosphy of doing one thing really well - i.e Text Manipulation.

Extending Vim using bash/zsh and tmux is usually easy and allows you learn a lot of things. IMHO this is a good learning curve. The key thing is to learn how to integrate these things to get a larger working application. With Vim you'll need to learn integration because it doesn't naturally integrate unless you tell it how to. Another worthwhile extension which I use is Tig . Its an ncurses based Git frontend . I just have a binding that opens Tig silently and then I do all the Git stuff there.

Its up to the end user to decide what works best. That Emacs and Vim has stood the test of time is proof of their worthiness. Eventually a good programmer needs nothing more than a pen and a paper to be creative. Good algorithms don't need editors to back them. So try them both and see what makes you more productive. And learn design patterns from both these softwares as there are plenty to learn and discover!

Nishant
  • 17,152
  • 14
  • 56
  • 80
4

Emacs has viper-mode, so in some real sense, it provides a superset of features (excepting those described in What Vim features are missing in Emacs with Viper and Vimpulse?).

vi (and VIM IIRC) is lighter weight (it can edit files in place), but offers fewer features (subprocess communication, extension language).

Community
  • 1
  • 1
Trey Jackson
  • 70,845
  • 11
  • 187
  • 221
3

Emacs is really more of a do everything program, and vi(m) is really just an editor. If you are editing text, they are both fine, but I prefer emacs, simply because I have to shift one off the home row to move around, and keep typing the wrong things in command mode. I you don't have that problem, vi(m) may be the editor for you.

3

A jaundiced point of view:

vi (not vim) is a professional necessity. You always have some form of vi easily available, no matter what the environment. You can be in vi when in emacs, you can be in vi to build bash commands in unix-land.

Even Microsquish has to support vi (although they do a good job of hiding it) because of gov't and corporate compliance with published standards.

In my opinion, if you are in a hands-on job in a busy environment--not a hothouse flower confined to one fancy rig in a development environment, or in academia--knowing a lot about a fancy editor is a job handicap. Don't learn all the fancy tricks in vim or emacs, and don't develop a bunch of macros to make the editing environment bend to your will. It's an enormous time sink that gets in your way when you attend to different machines that you probably can't justify in a factory environment.

Read Bill Joy's paper--it is a very competent, perhaps even beautiful, engineering exercise in editing plain text very, very fast. Parito's rule applies here: 80% of the fruit is in 20% of the baskets. Editing plain text very very fast is the crux of editing competence--all else is optional--and sometimes hurtful.

  • 4
    Which paper are you talking about? Can you at least give a name, if not a link? – darkfeline Mar 03 '14 at 02:55
  • 2
    "Even MS has to support vi." Can you back this up? – dodgethesteamroller May 03 '14 at 00:54
  • At one point - I am sure, people also said that syntax highlighting is "just a distraction"... and those squigglies under syntax errors "hogs down the editor" and whatever else people usually say about anything which makes programming less tedious. If you work on something slightly more complex than "hello world", there is more information you need at your finger tips than you can keep in mind. So any help is welcome (e.g. source file view, go to definition features, bookmarking, ...). Programming is exactly *not* just editing some lines of text. – BitTickler May 03 '21 at 02:30
1

If you move around a lot from site to site or your job involves loging on to production systems then vim is the way to go.

All *nix machines will have vi installed by default.

Most sysdamins prefer ksh as the default shell. ksh uses vi (or emacs) command keystrokes to search history and edit the command line.

If you dont know vi well you are severely handicapped when you log into a unix box with a standard configuraton.

For this reason alone I would recommend vim as your normal every day editor. I have seen emacs fans tear there hair out trying to amend config files on a bare bones unix server.

James Anderson
  • 26,221
  • 7
  • 45
  • 76
  • 1
    For bash try using `set -o vi` in your `.bashrc`, instead of `set -o emacs`, which is used by default. I never used ksh, but it might be the same. – sjas Aug 31 '13 at 13:11
1

I have worked with spacemacs for about 2 years and neovim for about a year now in a production/research environment. Spacemacs is emacs with couple of nice extra features like layers etc. And neovim is a fork of vim again with some extra features.

I am quite unsatisfied with both of them in terms of experience. And I am still on the look out for a long term solution for my text editing needs.

Here is a simple comparison:

  • 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.

Kaan E.
  • 425
  • 3
  • 12
  • 1
    "Modal editing (...) once you get used to it, you want it anywere" -- that's interesting. I spent years using Emacs with evil mode, and used to modal editing, and now went back to non-modal... It just feels better. I think this depends not only on the person, but also on context/time in life/whatever. Taste, I suppose. :) – Jay May 14 '20 at 19:49
  • 1
    @Jay I guess, but don't you miss, stuff like column selection, and jumping around with ":XX" ? – Kaan E. May 15 '20 at 00:14
  • Not really... I use Emacs' rectangle selection sometimes, and instead of :xx I do "M-g g XX" - a few more keystrokes, but I seldom do need to go right to a line. Usually, an Emacs application (debugger, etc) will send me to the right line. – Jay May 15 '20 at 10:49
1

In your question, you haven't mentioned that you want it to program in Lisp! But as you have been commenting your answers, I have understood that you actually want a LISP programming interface.

For that precise task, simply forget about Vi. Emacs integration with LISP is wonderful! You should use SLIME. You will then have wonderful integration with the REPL, being able to eval functions, buffers or files directly into a running interpreter in an emacs buffer and much more...

isomorphismes
  • 7,610
  • 9
  • 53
  • 69
Pedro Rolo
  • 23,843
  • 11
  • 53
  • 92
  • 1
    Yes, I am aware of this, but me looking for a decent Lisp editor wasn't my reason for asking this question--it was just an example. Thanks for the response though! – Sasha Chedygov Apr 24 '11 at 08:33
1

I was user of vim first, then I switched to emacs, then to vim, now I'm experimenting with emacs again.

  • Both are great editors.
  • Both are very extensible today
  • Both have great plugins and community

As developers we type a lot, and, at last for me, moving around in buffers and files are the biggest repetitive tasks, so I want a editor where I CAN MOVE FAST!

The motivation for experimenting with emacs again is that I fell it Ctrl leaded keybinds faster than vim, and easier to reason about.

In vim you have modes, you have insertion mode, visual mode, normal mode, what happens when you press something depends on the mode that you are, is a stateful aproach to editing. You move, enter in insert mode, edit, get out of insert mode and move again. I frequently lose my self if I miss a ESC press or something like this.

In emacs there is no mode, basically you press Ctrl with your pink and type the keystroke, like C-x C-f, C-x C-s, C-x C-c. There are keybinds where you need to release ctrl key, I hate this ones and always replace them by ones with control pressed.

I think that emacs approach is faster to think and type, but vim has another strength, to. Its commands are composable, they usually has a format . For example, to delete a line you can use dd, to delete a word dw. Plugins make use of that felling, with vim-surround plugin you can delete quotes with ds" (delete surround "), delete up to next / dt/. Delete up to previous /: dT/ and so on. So as long as you learn the moving things start to get very interesting.

Summing up, today I fell that emacs keybinds are faster for macro editing and vim commands are more powerfull for microediting

I've been using vim for the last five years so I edit thinking mainly about words, lines, surrounding, blocks, etc. Delete this line, remove quotes, replace quotes, delete word in cursor, I'm trying to findout the emacs moves for that

As a final quote I would say that, I care more about fzf than about emacs or vim, I would love to have a editor that is completely fzf based

geckos
  • 3,955
  • 1
  • 30
  • 35
0

vim is a handy editor, you simple type vim filename to open the file, edit, save and close.

emacs is an "operating system" pretend to be an editor, you can eval code to change its behavior, and extend it as you like. A mode to receive/send email on emacs is like an email software on operating system.

When doing simple editing, for example, modify a config file, I use vim.

Otherwise, I never leave emacs.

Richard
  • 41
  • 1
0

I think the main difference is the design target. VIM is for UNIX as a working editor. Emacs is for GNU and lisp hackers, so it has some mixed design element.

I use vim on my workstation, while I love emacs too.

0

I am an Emacs fan but encourage other developers to learn VI because:

  1. you can use VI to edit the emacs makefiles.
  2. VI includes ed commands and every UNIX user should know ed and sed.

I've noticed several comments about VIM starting faster than emacs. If you really care about that, run emacs in server mode and alias 'emacs' to 'emacsclient'. The client is super fast since all it does is tap the server on the shoulder and tell it which file you want to edit. On MacOSX, emacsclient is only 33K while emacs is 287M.

I'm not sure any of this is necessary on modern hardware. On my MacBook Pro (2013 Retina), emacs loads almost instantaneously when I run it from the shell. I detect no pause at all. When I run Emacs.app (the GUI version) it might take all of 3 seconds.

Most complaints I hear about emacs seem to come from people misinformed about emacs. Having used both vi and emacs since 1982, I definitely remember a time when emacs loaded much slower than vi and used most of the physical memory in my early UNIX boxes, but that is no longer the case and has not been for at least 15-20 years.

One complaint I will concede is "emacs pinkie". This never bothered me at all when I was younger. Now that I'm 58, my pinkie does get a bit sore from repeatedly accessing the Control key for emacs chording. This is especially true on the MacBook Pro keyboard where Control is moved one position to the right to make room for the "fn" key. It's not nearly as annoying when Control is the bottom left key.

  • You can also "dump" emacs, which basically means taking a snapshot of the compiled elisp extensions you desire. Emacs starts much faster this way, but it takes a bit of time to determine which extensions you want to include. – Phil Harbison Jun 14 '18 at 22:08
  • Plus you can play "Towers Of Hanoi" in emacs. How cool is that? :) – Phil Harbison Jun 14 '18 at 22:09
  • Re: "emacs pinkie". On some older keyboards, e.g., Sun Type 3/4, which the HHKB Professional is based on, the Control is placed where Caps Lock normally is. I don't have the emacs experience that you have, however, I very quickly got used to having Control on the home row. So much so that I made that change on all my keyboards (MacBook Pro too). The HHKB has some further improvements, e.g., Backspace just above Enter, and Esc next to 1. – martinweiss Jun 21 '18 at 06:07
  • @PhilHarbison could elaborate on "dump"? – A_P Feb 19 '19 at 21:15
0

Keystroke execution::: vi editing retains each permutation of typed keys. This creates a path in the decision tree which unambiguously identifies any command , whereas Emacs commands are a combination of typed keys executed immediately, which leaves the user with the choice of whether or not to use a command.

Memory usage and customizability::: vi is a smaller and faster program, with a more limited capacity for customization, whereas, Emacs takes longer to start up and requires more memory. However, it is highly customizable and includes a large number of features, as it is essentially an execution environment for a Lisp program designed for text-editing.

Sudhir Bastakoti
  • 94,682
  • 14
  • 145
  • 149
-12

Firstly Vi (original realization) not used today. That you say is some Vim derivation.

To extend Vim functionality you must recompile Vim, Emacs not.

Emacs has Vim in self (viper-mode).

Emacs usually need manually installation, Vim typically preinstalled on all Unix like OS (but if you have ssh access to host tramp-mode win Vim :).

If you try Vim you hate Emacs, so start from Emacs first.

Also read http://www.dina.dk/~abraham/religion/vi-tutorial.html (link go down so use this)

Anwer search in hxxp://en.wikipedia.org/wiki/Editor_war

gavenkoa
  • 37,355
  • 13
  • 206
  • 248
  • 9
    You do not need to recompile vim to extend it. You don't even need to quit vim. – too much php Sep 16 '09 at 06:48
  • 1
    Have vimscript/Python/Ruby/etc access to all Vim internal structures? If editor codebase help make extention or complexity of extention on one level of complexity of EDITOR? – gavenkoa Sep 16 '09 at 07:18
  • 1
    Much of Vim scripts like intelectual MACROS. To extend Vim you need plugins (( – gavenkoa Sep 16 '09 at 07:22
  • viper-mode only emulates vi, not Vim. It's a big difference for someone who get used to work with Vim – MBO Aug 20 '10 at 22:26
  • 1
    Vi is not used?!?! What? Is nvi considered to be original? Or a 'traditional vi'? A lot of systems like FreeBSD, ArchLinix bundle the traditional vi or nvi and I am thankful for that. Some systems like Debian go with vim which is in compatible mode by default (feels almost like traditional vi) – Alex Oct 25 '13 at 08:20
  • 1
    @gavenkoa, I absolutely agree with Alex, you've obviously never tried a system requiring manual installation like Gentoo, some BSDs or Arch Linux. Also, «If you try Vim you hate Emacs, so start from Emacs first.» would make me try VIM first, and you as well, if you think a little. That reminds me of people saying not to try functional programming first. I'm sad I didn't try it sooner... – JMCF125 Dec 29 '13 at 22:21
  • 1
    Reviewing this old post and I think you just do not accurately make your points in standard English, but if I infer on your behalf, you made some nice points about limits on vi's model as opposed to emacs' model, which was the basis of Stallman's extensibility thesis (and others) covered here: ftp://publications.ai.mit.edu/ai-publications/pdf/AIM-519A.pdf which is the premise upon which he developed his display-editor emacs. I would caution you to use better Standard English and others to not be so mean when this is so obvious because that is a bit rude. Kindly ... – oemb1905 Dec 24 '17 at 01:59
  • It seems most downvotes are for language rather than content, so I'm offsetting one of them with my upvote. Refreshing is the language, a bit; reminiscent of Yoda prefix traversal of the syntax tree. – user2297550 Aug 20 '18 at 07:12