Why is emacs better than vi
There is a set of polarizing topics that mere mortals will never understand, but for techies they cause divorces, break-up friendships, and create personality complexes that top psychologists have trouble resolving. LinuxLovers will stand on one side of the fence and troll anyone that opposes their views on topics such as:. Case in point, this relationship-ending moment in Season 3 of Silicon Valley:.
One of the oldest and most long-standing of these arguments is the Editor War between Vim and Emacs. This rivalry goes back to pretty much before there was even an Internet. The new generation of programmers really need to pull up their socks and actually learn Emacs or Vim. I use vim a lot, after you get over the steep almost vertical! But the reason I learned vi was because I had to. Stuck in a cold data centre with a sev 1 at 2 a.
You could be pretty sure that everything but vi was stripped from the production servers and worse ksh was in vi mode. Once you know how to cook, use your favorite knives, but stop spitting on the other ones. Waste of time. You forgot one thing — each developer has different needs. Many IDEs, like Visual Studio or the ones from Borland or Jetbrains, tried to be an all-in-one development environment, not only an editor.
For a beginner, the ability to discover and use all that, in an intuitive way, was the main advantage. What a ridiculous article. Thanks to its communities both vim and emacs are easily as powerful as modern IDEs plus having the potential benefit of being heavily customizable. I tried a bunch of IDEs at different companies already but there is always something that I find inefficient or even annoying about them which makes me come back to vim.
But why? The other IDEs are all the same and are not better at all. There is a reason vim is still here and every other old editor is gone yeah emacs has not a lot of users left. This article does not explain at all why vim is still around. It does argument for a statement it denies itself. This is highly subjective and unscientific.
VIm is still a thing because it is another better approach to text editing. No new IDE has it. Even the ones with vim keybindings only emulate the approach and will never be as good and mighty in it. The mistake you do is seeing a text editor in vim. It of course is a text editor, but it should not be seen as one.
It should be seen as a text editing language. You just tell vim what you want to do with the text: c hange w ord, d elete w ord, y ank p aragraph. And so on. It is easier to remember and easier to think of. It does not break your flow of thoughts. Plugins do work the same. I use IDE and vim. The Jetbrains products PyCharm, et. I use vim in a terminal for quick and dirty edits, or working through an ssh session. I use PyCharm for more complex tasks or debugging.
I still use Emacs for some things and vim for others. Glad I know them. I usually use Visual Studio Code for PowerShell development and Visual Studio for C for various reasons including supporting existing code bases that were developed with those tools. There are advantages and disadvantages to everything and there are no exceptions.
If you love Lisp as a friend of mine does, you may absolutely love Emacs, for instance. Also in my development group, most programmers are barely proficient to start. It helps us generate more uniform coding. He is Emacs Window Manager. The power is unlimited, trust me. Which one is still useful? The reason experts continue using the tools they trained on is because they are experts.
And, so, she goes back to the violin. Text editing is insanely efficient in vim once you have the right plugins in place. For git integration, vim-fugitive is excellent so much so that when I do have to use IDEs I still switch to vim for staging hunks of code and resolving merge conflicts. By doing so, instead of dropping my pinky to the CTRL key constantly not a comfortable key to hit , I can stay in the home row all day without tiring myself out.
Food for thought…. I use Vim for the last 5 years, with some plugins, and I love Vim. I have linters, git integration, colors preview in CSS. I have experience with IntelliJ products, Atom, VSCode, but I love that Vim is easy on system resources also saves the battery , can be found everywhere, effective.
And Vim is free, open source. I usually see a demo with some feature that looks like the killer one that will make this IDE my new favorite too. I have always come back to vim for several reasons and I would imagine, emacs users will say the same. It may work a bit different but in the end gets the same result. Anyone that has been developing software for more than a few years most likely has several languages under their belt.
Even those with a good plugin architecture often work very different with each language. And adding each plugin usually adds a lot of overhead. To master one tool instead of spending massive amounts of time always searching for the perfect IDE.
And use that extra time to read articles on software development, design patterns, algorithms etc. Of course, IDEs have some support for keyboard shortcuts, but its as good as mouse support in Emacs. Its terrible. Its impossible to not use mouse in IDE and its impossible to not use keyboard shortcuts in emacs.
Second major Emacs advantage is its unparalleled extensibility and explorability. All emacsers use heavily customized Emacs to their needs because the price to do so is small. Both do the same thing, but latter a lot more effective. All of the GUI features are just noise and inefficiency from my perspective. Most, if not all, of the revered features and plugins and features in VS Code and the like can be accomplished as competently, and probably more efficiently, with a little bit of Vim customisation.
Admittedly, the initial learning curve presents some challenges until you can fly, but once you get over that hump you really can fly. And for me, the grammar of Vim continually provides inspiration.
I think it has the best UI of any application I have ever used — seriously. I find it interesting how SpaceVim has made this attempt to get the best of both worlds. I only wish I could integrate that one idea from SpaceVim without also taking in all the rest of their config. This might be forgivable if it stopped there, but to go further and say:.
You seem to have missed the part where Emacs can be integrated with absolutely anything. This quote is self-incriminating in a sense as it reveals the attitude that code is nothing but keystrokes, sold by the pound-per-minute and that refactoring is some indulgent sin. Not just a clutch of text files that are fulfilling their purpose out of sheer coincidence, forever accruing complexity as changes are incrementally piled on in haste. I think of it as a risk to business continuity for the vast majority of companies out there.
All to compensate for the absence of editor code awareness which — to me — is a metaphor for analysis and reflection. Inevitably, there are communication pains and gnawing deficiencies in onboarding that are either never organically encountered lucky!
I make use of Visual Studio Code as a notepad replacement or for small projects where the deliverable is more declarative than procedural terraform, docker compose. As noble as they are, text editor puritans are immediately at a disadvantage, even in the simplest of codebases. Use what you want in the end and show me that it can work in the merge reviews.
More importantly though, we might even benefit from having to hear less about vim…. This resonates with me, although it comes from the other side. It is a shame when, in one way or another, the project structure is affected by the personal choices of development tools.
Developer should choose whatever tool they want, and configure the tool to do the job, rather than configure the job to suit the tool. Not only do I use vim, but I use pretty plain vim. Which kind of proves my point.
Again, proving my point. But my experience is that people waste too much time on them. You and your friends have never tried Docker? To grasp the nature of that you need to read between lines in the mind of their creators, Dennis Ritchie, Brian Kernigan, and others. The traditional tools available there editors included are fast, lean, stable, and have decades of work done to refine and perfect them, and they can easily be composed together to do anything you would want out of an IDE and more.
Learning new tools take time. Well, why not just an IDE then? By starting with Vim and adding plugins as I go along, I can try out alternatives and make my own choice. The result feels more like home, and reflects my manner of thinking. From time to time I change plugins, or throw some away. My OS already has a terminal, file manager, and search tool; yet the IDE crams in their own versions of these. The terminal, filesystem tree, and console are all cramped. When I use a separate applications the OS is aware of them, so I can manage them using my window manager, task manager, and fuzzy-finder thing.
Of all my reasons for avoiding an IDE, this is the most important one. I use many of the keyboard shortcuts from bare Vim, and have a few leader-key mappings for some commands I use a lot. A I used to fire up NetBeans just for step debugging. Nowadays I use the Vim VDebug plugin. B Project-aware code navigation, and auto-suggestion.
Nothing in the article backs this statement. Personally, I think vim keyboard bindings are great. Interesting article. I come from an Emacs background but have recently switched to VS Code.
I love Emacs and have done for two decades — the key bindings and customisability has meant I invested deeply in it. I will continue to use Emacs for text files. My blade Swiss Army Knife is in my toolbox — somewhere. I committed myself to mastering Vim during lockdown. Can anyone master Vim fully? Refactoring in vanilla Vim is way harder, if you gotta get plugins for all the languages of choice, then better go for a full featured IDE.
That being said, I think knowing how to use Vim at a basic level is an essential skill, due to this omnipresence of the editor in Unix systems. Being able to code comfortable for a few minutes with Vim lets me do some quick hacks in servers without having to scp the content… develop in my full IDE and upload back.
Vim is very powerful indeed. And I highly appreciate its features when I require them. I have always been shocked at how little people who edit code for a living know about their editor — regardless which editor they choose.
I doubt that this changes much with an IDE. I think the difference is if a team is required to use an IDE then someone else has made this all work for them and only through the IDE can they get necessary resources. That said, I put quite a bit of effort into getting Eclipse working at a company, and since I could not make it mandatory, no one started to use it.
Including me. It was too much trouble to keep it working just for myself, so I stuck with emacs. Do IDEs really make most coders more productive? I am not so sure. The folks that only know how to copy paste, search, and save are not commenting or even reading this thread, so we are really only preaching at the choir here.
When I began to study programming, using vim for that as well came naturally, but I have been open to alternatives. I clicked this article expecting to learn some of what makes IDEs so useful, or maybe some advice for when to use an IDE over a text editor. Instead I learned nothing. This article reads more like notes the authors took about the available options for code editing. Oh, and occasionally whatever that depraved stuff inside Excel is. Others have their entire build infrastructure locally.
Installing random IDEs was not possible. Or I could open 3 ssh windows, one for vim, and the others for running the code and watching logs.
Vim is for people who like Unix, and who think in Unix ways. And just think of spacemacs, or neovim. So what remains of any of the quoted arguments then? Is maybe the IDE the lazy, dated way to code at the end? Please scrap this, and try again when you actually looked at how advanced users use vim and emacs, and write a properly researched article and not just a hit piece.
I love the shit out of Vim and use it all day, every day. But not for developing complex applications. IntelliJ is like having a co-pilot with you during development. It gives you true comfort. Vim however makes you feel like Neo in the matrix.
Like Jason Bourne in… well… Jason Bourne. It gives you true power. The often hide too much, leaving the developer with scant knowledge of or control over a lot of what is being executed.
And where the IDE is for the purpose of facilitating untrained, unknowledgeable or inexperienced programmers, its use in high end technical computing is simply an oxymoron.
The novice would do better to do it by hand, with make and an editor and learn how things work. Why should I spend valuable time learning many different IDEs—IDEs that keep changing—when I can efficiently just use one or two familiar editors—editors where I know the keyboard shortcuts, etc, that empower rapid working.
What I want is software developers to make it easy and obvious for me to interface their software with my choice of editor. What is hard about that? PS I also want software developers to stop grabbing my entire screen, so that I can use windowing environment as I want, not as they want. No, really, he does. Nor is Vim. I had a much longer reply written up a day or two ago, but it looks like something ate it.
Most IDEs promote mental laziness. They allow programmers to build programs that work with just a superficial understanding of the language facilities they use, with things like autocompletion. In the end, a lot of those programs end up on Stack Overflow piece by piece because of an edge case, a race condition, or simply wrong logic. Once the necessary in-depth knowledge is acquired, the use of IDEs become unnecessary: you can simply be more productive than most IDE-users using any other editor.
In short, IDEs help with the process of writing only, not with the quality of the end product. That still relies on old fashioned know-how. I use Emacs exclusively for writing programs and switch to VScode for debugging only.
Everybody has their own toolset they are comfortable with. I learnt programming in fancy editors and IDEs. Eventually I was forced to work in a plain tty for some weeks and I knew about the existence of Emacs and Vim, but never got serious about them. I quickly read the differences between them and decided to go with Vim. I was amazed by how much stuffs I was able to do in a terminal. Vim made it easy and provided me with an abundance of ways to browse and edit my code.
I know about all those fancy editors. But the vi way of editing code is amazingly efficient and fun to use. They are just great. The author of the Medium article is using Atom with Vim keybindings.
This article does not make any sense at all. But you see, people with vim use git, they use linters, they use modern languages and they use a lot of features from modern IDEs. So somehow everything has changed, but vim survived. And the reason vim survived should be the fact that people do not like switching to new things? That is why people still use ed… oh wait that one is dead, maybe it is too old?
So surly there is still Netbeans? Yeah but the market share is pretty low. And that is not the only example. There are very few tools which a development team actually need to agree on. Most other tools can be left to personal choice. The same goes for your choice of file manager, window manager, SQL client, diff tool, terminal, input devices, log viewer, and what-not.
In my experience the most important thing was finding a colour scheme and font size that we could all read comfortably. Did you saw a dev who really know vim editing code?
This tool is pure efficiency, once you grasp the concept you can never go back. The speed and mental resting you get from using vim is and always will be worth the investment. After reading the article, I really wonder if any of the authors use some regular IDE, because arguments written in the article are wrong or at least biased. There is also default configuration that can be changed and exported if needed.
Really — installation and configuration of IDE in comparison to configuration of development environment built around command line and text editor is extremely fast and easy. Availability and quality of tools like code completion, refactoring, code formatting, debuggers, profilers etc. How are they defining IDE? Unfortunately, it became unusable, not even reinstalling my OS install from scratch helped. It will take a while for me to get a me a replacement laptop, so, I had to use something lighter.
Even VS Code was weirdly slow. I decided to code from an EC2 instance we have for development and running services. After installing nvim and searching for some plugins, I configured coc-nvim, fzf and other ones.
I was surprised with how good it was as an IDE. Autocomplete worked just like in VS Code, syntax check was better because the EC2 instance is very very fast , go to definition and find references worked like a charm. It took me a while to make it work like I wanted it to I like to config small details to my liking , and the only thing that still sucks is Java development with Bazel: IDEA is still the only feasible choice.
But for JS and Python development, Vim is pretty good. Sorry, this post is a little malformed. One is tabs vs buffers, in vim you can have different split layouts for every tab. The new search editor in Vscode is promising though. Go to definition using ctags. RubyMine in this case has the most amazing go to definition tool.
Unfortunately, such disinformation brings a lot of harm to other programmers. Well, I lost 12 years of effectiveness because of such articles. XCode is something like 40 gigs now, Vim is probably a couple megabytes, including a scripting language interpreter for customizability. And none of the vim plugins for the major IDEs actually give you full vim functionality recursive macros are especially rare. But the most important mistake, I think, is assuming that old but still actively developed software is bad and anything new is good.
I actually started coding in Emacs by requirement, having come from Matlab and Eclipse because the toolchain for Fortran90 is basically non-existant in modern IDEs. I predate VSCode by about 3 years, and when I started doing more Python than anything else, I moved into Pycharm for a couple of years.
However, like most Pycharm users, while I liked its interface, I found its toolchain to be laggy, its design unintuitive and ultimately, it tied you to a particular set of products which meant that if you learnt the interface for one, you were stuck in their ecosystem.
Otherwise, I will use VSCode. The first advantage of Vim and Emacs is just that — a universal interface to coding. The second is their combined suite. The creative minds that built them have largely moved on, and the new support lacks the courage and skill to re-invent them. Both are stuck in difficult keyboard layouts. Emacs could adjust to the user a bit, at a minimum by recognizing that there is an Alt key rather than the antique Meta.
Better to just simply have one that is fired by either key combo. Yes you can alter key bindings, but then what a mess you have later. Almost any other GUI ap these days allows zoom with the mouse wheel. Emacs GUI doesn't seem to get this to work. And where's the nice greeking like what Kate has?
My favorite keyboard layout over the years was Wordstar's cursor diamond. At least it was easy to learn and made sense immediately. The one I hated the most was WordPerfect which increased complexity and seems to have been based somewhat on emacs. Let's face it most of the world has GUI these days. And like it or not text editors are somewhat stuck in their age. I think it would be better to have a universal editor that could easily switch between emacs, vi, wordstar, or whatever key layouts, and without loosing the more powerful commands it has to offer.
Real programmers have to use a variety of editing tools. Why not have an editor which meets our needs to get work done rather than to force us into their way of doing things? Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group.
Create a free Team What is Teams? Learn more. What are the pros and cons of Vim and Emacs? Asked 11 years, 2 months ago. Active 3 years, 7 months ago. Viewed k times. Improve this question.
Duplicate of SO question: stackoverflow. I'm surprised nobody has mentioned XKCD Show 4 more comments. Active Oldest Votes. Improve this answer. I cannot agree with the point "More than an editor". Vim has also many plugins, including ones that turn it into a file manager or an IDE like vim-latex.
This made me feel small Read email? Check your RSS feed? I don't think you can deny that Emacs is just plain more powerful, though the usefulness of that power depends on what you're looking for. For example Proof general is very nice of course it's a very narrow application domain. Emacs is good at doing stuff that nobody thought of before: Emacs Lisp is a lot nicer than Vim's macro language.
Emacs tends to have better support for indenting source code but I don't think it's so much a flaw of Vim as a lack of libraries the Vim support tend to be limited to syntax highlighting. MichaelHampton You must be young then. In , it was Eight Megabytes. By now I suppose it should be Eight thousand Megabytes, except that nobody notices Emacs's memory usage since it's less than one browser tab.
Show 10 more comments. I'll post what I think are the main benefits of each: Emacs has considerably more extensions to let you do tasks that are only vaguely text-editor related, like browsing the filesystem or messing with version control, and extensions that are in no way text-editor related, like reading RSS feeds.
I also think Emacs is much easier to learn, despite what some would have you believe: In particular, I think a novice Emacs user will be faster than a novice Vim user On the other hand, Vim is undeniably faster.
Michael Mrozek Michael Mrozek 84k 31 31 gold badges silver badges bronze badges. I know vim has more than one version control plugin. Would somebody please explain what does emacs graph, given above, means?
How to interpret it? It's a "down the rabbit-hole" joke It's because when you learn emacs, eventually you start creating emacs too. I mean vim is not "that" hard to master, it only takes a couple of years ; — Johan. Show 8 more comments.
I'm quite a vim user, but I often find it difficult to use vi , most likely because of the END key vim supports it, but vi doesn't, or at least doesn't by default — phunehehe. I don't use the arrow keys to navigate. This goes double for connecting to slow servers across dodgy connections: the one editor they're guaranteed to have it is in the Unix spec, I think? Of course, step 1 is usually installing vim : — Gaurav.
Vi works excellent for emergency editing of config files over a crappy 3G connection on a slow cell phone. This enables vi-style syntax for entering text in programs using readline for stdin, such as the bash shell itself. There can be sometimes surprisingly a fair amount of broader applicability to the editing instincts that one develops using vim. Sigh -- ed , I'll never forget you. Kendall: Current ubuntu linux does not come with emacs installed. Show 5 more comments.
Joe Casadonte. 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. This is basically my experience too. That said, I use emacs for text editing every day and I love it. 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.
Also, see here to cut and paste to and from different windows stackoverflow. In Emacs you also have multiple registers a-z you can save either text or the current position into Show 1 more comment. 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. The problem is that there is so much of Emacs 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? You have access to all of vim's functions and editor buffers from the scripting languages.
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.
Well, just my 5 pence. 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. 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.
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: I like the analogy.
Amen to that. 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. Show 2 more comments. 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.
Andriy Tykhonov. 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? 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.
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.
It is not outdated! 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 Show 4 more comments.
For me pros of emacs are, tramp-mode allows you to edit remote files over ssh. Hamza Yerlikaya. FWIW: vim pretty much has the first 3 though with different names. Check out the Conque addon for an embedded shell in vim. I actually wonder why no one has made a variation of emacs yet, where elisp is being replaced by e. For me, emacs has better development tools not only tags based tools. Benefits of Emacs Emacs has both non-modal interface by default and modal one e.
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. Benefits of vi-like editors Edit commands are composable Vi has a modal interface which Emacs can emulate Historically, vi loads faster than Emacs.
Essentially all Unix and Unix-like systems come with vi or a variant built-in. System rescue environments, embedded systems notably those with busybox and other constrained environments often include vi, but not emacs. Grant Limberg. I used Vim for editing, and Xcode for debugging, it's less than ideal but doable..
Spacemacs combines the best from both Emacs and Vim, which make your life and job much easier. See screenshot below, source: spacemacs. This is cheating It's emacs with some funky configs ; Quite a lot of configs actually — Alex. 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.
Though it has a lot more stuff than I need, I'm really satisfied with Spacemacs. A jaundiced point of view: vi not vim is a professional necessity. Which paper are you talking about? Can you at least give a name, if not a link? At one point - I am sure, people also said that syntax highlighting is "just a distraction" 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. Programming is exactly not just editing some lines of text. James Anderson. For bash try using set -o vi in your. I never used ksh, but it might be the same. 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! When doing simple editing, for example, modify a config file, I use vim.
Otherwise, I never leave emacs. 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. Kaan E. I spent years using Emacs with evil mode, and used to modal editing, and now went back to non-modal It just feels better. Taste, I suppose. Jay I guess, but don't you miss, stuff like column selection, and jumping around with ":XX"? 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. Both are great editors.
0コメント