Disclaimer: I am playing devil’s advocate. I do believe Vim makes me more efficient with some trade-off, YMMV.
We, as developers, spend a lot of our time on our text editor of choice. Choosing to use Vim, in my opinion, ultimately won't make a huge difference with any other editor. The majority of modern editors are more than capable to handle the task at hand and are much easier to get started with.
You want to use Vim? Sure. After you are vaguely familiar with it, you will dive deep into Vim's ecosystem and soon learn about the variety of flavors Vim comes in and the many ways to manage plugins and configuration. Suddenly need to code in Java? well darn, you'll need to expand your code completion, syntax highlighting, and add additional functions like compilation.
And after going through all of that, would you argue that you emerged out of it a stronger better developer? Or would you say it was all but a distraction and the time spent there could've been spent on coding and learning about other facets of programming?
I use Vim daily and I love it, but it's kind of difficult for me to recommend it because it truly is a time-sink. What the folks rave about is more about Vim-navigation and not Vim itself, and that is easily solved with Vim-mode, which is available in most editors.
So, what's your stance on the general push for vim?
Top comments (84)
Personally, I love Vim for the same reason that some people love raising a banzai tree, or building a toothpick castle. If I've got the time, I like to fiddle.
Sometimes, yes, I just want to knock some code out, or navigate around a big project to get a bird's eye view of everything. At that point, I reach for VS Code.
But, if I've got the time, or what I'm working on isn't super important, I like taking the time to tweak my
.vimrc
to get things just right. And then, in a couple of days or weeks, I do the next bunch of tweaking. It's fun and it's interesting.It's relaxing to me to do something small and pointless, but to do it very carefully and to do it right. I don't know. Maybe it's a "when you focus on something small, all of the big stuff fades out for a while" thing.
I think that's the reason I'd recommend Vim to somebody. Not because it's "better than your current editor", not because you'll inherently "be more productive", but because you're interested in learning something new, adding another tool to your toolbelt, and fiddling. And I think that's enough reason to pick it up!
THIS. This so hard. I have NEVER been able to put it into words but oh man, this.
I feel the exact same way. The guy nailed it.
I think it's the same as dvorak and qwerty keyboards. One can type faster on dvorak, but there is a lot of time invested in learning and practicing. If one have time to invest in Vim, I don't see any reason why not.
I personally think that there is to much programming subjects to learn, that investing much time in text editor is pointless.
Emacs does also work well for this purpose.
Totally agree. It's like knitting or oragami, but you end up with a cooler workflow each time, instead of a bunch of knick knacks laying around the house.
When the discussion comes to the point where it is "would you recommend Vim or not" I think of an analogy that I like to use: it's like recommending a bike over a car.
It might be an overly simplified analogy, and it goes together with the fact that I love my bike as much as I love vim, but it goes like this:
Vim is my bike, a car is an IDE, and your text/code is your distance. Short distance might be a script, a long distance might be a project.
With the bike you can get around. You choose short distances when you are starting, and you fall. A LOT. The better you get, the longer you ride. If you loved it, you'll love it more. If you didn't, then riding isn't your thing. You start tweaking your bike: did you choose a road bike over a mountain bike for your daily commute? that's fine, but ride. After you ride your custom bike, you don't want to use the same bike you used at the beginning. Your bike is yours and only yours. Then, you start using it for more than commuting. You ride it for fun, you do day trips, or even week trips. You use it in distances other rather go by car, but it doesn't matter, you enjoy it. And sure, you brag about it.
The car is something different. It's heavy duty. It comes with all the goodies you might need for long distances. You need to learn how to drive, sure. There are a couple of controls, you can go fast or slow, but as long as you don't get crazy you won't crash. You are surrounded by safety, sit back and strap on. Have a long distance to drive? it might come with a GPS, you just drive. (Sure, you can use a GPS with the bike, just as well as you can install an autocomplete plugin in Vim).
Some bikers can't wrap their head around people driving to starbucks and back. Some drivers are tired of the bikers bragging saying how biking is better than driving for "all the wrong reasons". Others, just choose the right transport for their commute. Sometimes you might want to ride, some other times you need to go across the country carrying a bunch of luggage, for which the car just works.
For me, it isn't about arriving, it is about enjoying the ride. Would I recommend vim? sure, why not? try it. Just know that, unlike when learning how to drive, you do fall from the bike.
Really well expressed!
I myself prefer nowadays PHPStorm for PHP development, but everything else is done in vim. The key point for me is how easy it is to script changes by recording macros and automating tedious refactorings. After all I already dug through 100k of ancient Perl code and could not have survived this without and editor that simply works.
What I most miss in these discussions is always the fact, that development environments are different. I would love to build all my software on one machine, locally and my bespoke editor config. But my reality is, that I have to analyze and debug my code on a couple thousand servers, where it simply is impractical to always have your config with you.
So my best tip for everyone: memorize the three most important settings (
:syntax on
,:set bg=dark
and:colorscheme desert
are these three for me) so you are neither blinded nor disgusted when moving systems quickly. And while the perfect setup might have vim-airline and zenburn, you can at least live on a remote system without going nuts.Agreed. I believe that the title of the article is a bit misleading, as Vim can indeed make you more productive! if you choose if for the right task, and know your way around it. The more experienced you are, the broader range of tasks you can do productively.
The last part of your comment is also on point: if there are customization-elements that make your experience easier in a session on a remote/different machine then learning them will make your life easier. It can be even added to my analogy: if you get a bike while you visit someone else, what's the first thing you do? You set the settle to your height, probably change the gear, so that it feels comfortable. You can also drive without doing any of this, sure, but it will be a pain.
I couldn't disagree more. Vim's modal nature is insanely convenient and fast, whereas non-modal editors force you to waste time mousing around in menus or GUI elements. Most programmers spend far more time editing and navigating code vs writing it.
"In most cases, when I start my editor, I want to type stuff right away."
vim +star
I've used several plugin managers and never had any issue installing the plugins I wanted.
"No Vim is like any other Vim" is like complaining that nobody else organizes their kitchen exactly like you organize yours. 99% of the time, you'll be using the vim you installed and configured.
As for the original question here: a task being difficult and time-consuming isn't a good reason to avoid it, if the payoff is good. Learning vim is one of the best decisions I've ever made.
I agree with you. How they work on a guest machine while connecting to them via ssh ? They're can touch their gui icons ? I don't know...
Triggered!
I don't have a stance on
the general push for vim
since I don't believe it exists. Not sure I get what that means.variety of flavors Vim comes in
- Vim or NeoVim? GVim? again not sure what you mean.you'll need to expand your code completion, syntax highlighting, and add additional functions like compilation
- no actually you don't need to do that at all. You can if you want or you need that type of support. Personally in the teams I have been a part of and lead, reliance on IDEs can be taken too far to become a crutch and can inhibit understanding on what is going on in your codebase.I have been doing development for over 20 years. I have used a lot of editors and IDEs over the years on a lot of platforms and I have settled on Vim as I like the feeling of it and I have the ability to optimise my workflow with it. Editing at the speed of thought is pretty close to the truth for me. It feels like playing an instrument, if you will, and similarly the more you do it, the better you get and the better it feels.
Vim is the fastest keyboard driven language for editing. It's not an IDE but you can add in IDE style features if you would like. There is a reason for there being Vim plugins for most IDEs including Emacs the best operating system without a decent editor. If you don't want to mess with configuring Vim much you don't have to. NeoVim out of the box has some pretty sensible defaults.
Have a watch of some of the destroyallsoftware.com screencasts to get a feel of what that looks like.
what about adding vim's keybinding in <your-favourite-editor>
Sure, if that works for you and maybe that can be a good softer introduction for some folks to Vim and modal editing in general.
yep.
I think I forgot to escape <
I like the idea of working solely on a keyboard, but I don't know if I'm convinced that Vim is the best solution. I've been working on a "regular" editors like Atom and VS Code ever since I started programming, and I haven't seen a need to move to something as hardcore as vim.
Also, the fact that it seems "hardcore" feels burdensome and heavy to me. Tools are supposed to help you be more productive, and while there's a learning curve to everything, I think it what you said is true:
I started out learning Vim because I had to regularly modify files on production systems that didn't have a IDE option installed. Now I use it because I'm comfortable with it and really like it's speed.
VimAwesome is a fantastic resource especially with the plugin/plugin manager issue. I've switched back and forth from a couple of different managers and haven't had any troubles.
I've tried most of the big name editors, each for a reasonable amount of time, and they're good. I always come back to Vim, though.
It's nice knowing that Vim will be on pretty much every system I log into. If it's not, it's usually no trouble to get it installed. It's fast and I think the movement keys are great. You can customize it as much as you want to and get some really great features.
I'm on the fence about this as well.
I think every developer should at some point install Vim, try out a bunch of plugins, and run through some tutorials — even if it's just so you won't feel scared when you end up within the editor by accident.
But more productive? Complex editing tricks often require a refresher in the form of a few internet searches and a bunch of experiments. You tell yourself that it's investment in future productivity... But obscure key combinations are long gone from my muscle memory when I need them again.
I love Vim as an editor, and use it out of habit when editing configs, markdown, latex, and bash scripts.
For larger code projects I personally prefer the Jetbrains IDEs, as they offer great out of the box smartness tuned to specific languages.
To your first point: usually I edit already created files. In these files after I open them, very very rarely I am at the place where I want to start writing something. So I need to navigate to the place of my interest and vim-mode so far always bested other editors.
I am vim user and I have tries to switch to other editors and the main thing that makes me switch back is the lack of the leader key in vim mode for any other editor out there. I have my key strokes that "save me time" intiated by the leader key. I just cannot find an editor that will allow me to do that without being another time sink to setup.:-)
In my experience the one thing that Vim got right was keybindings and mapping. Modal editing does take away many pains of editing and does make you faster.
However, where I found Vim severely lacking was basically other things like:
My current setup consists of Sublime Text 3 with NeoVintageous for Vim like editing.
I believe it gives me the best of both worlds. Vim like keybinding and modal editing with all of Sublime's sublime features.
tag search, see ctags
fuzzy search, see fzf
multiple files, yeah it can do that with :buffer
vim's use of the unix philosophy to use other command line tools for extending features without bloat is another thing they got write.
I used all of those methods.
But modern editors such as Sublime and VS Code still provide a much better experience in those categories.
well one is more than welcome to use what they like. but please give examples of how x is better than y.
in this case, fzf and ctags also work with other tools out of the box so my email (mutt) client, file manager (mc), chat (bitlbee+irssi), and others has fuzzy search and tags. With that whole environment portable to thousands of machines online via git clone or docker image instead locked to one desktop.
Far and away better than VSCode especially on code bases with a lot of files - the command t plugin for Vim (I personally use fzf on smaller code bases) happily works across millions of files.