Readit News logoReadit News
duckfruit · 6 years ago
Speaking personally, I've been a professional developer for almost decade and even in my relatively short career I've seen a lot of technologies come and go. I was reluctantly roped into it by my first boss, an enthusiastic Vim advocate. And since, almost nothing else (save for maybe git) beat learning vim from a return on investment perspective. From the default mac OS installation to some old Fedora box that has not been patched since the early 2000s, Vim (or its simpler brother Vi) has always been there!

And once I got used to it, I couldn't really imagine using computers any other way. I'd go so far as to say that the 'home row' concept of vim is the ergonomic ideal of keyboard based computing, and I now try to mimic that behavior everywhere -- the vimium extension in chrome, various vim plugins for vs code and sublime etc. If you're on the fence, I'd urge you to give in!

licebmi__at__ · 5 years ago
Definitely, even now as I use emacs, I'm a 100% evil. It's just so natural (once you get it), that I don't know how other bindings (like ctrl-[whatever]) are prevalent in most other software, it's not like they are more memorable or intuitive.

Fun story: I was into Free/Libre software as a teen, when I learnt how to move around in vi(m) and in my first tech gig (as a sysadmin), I was interviewed by some greybeard who wanted me to do some maintenance and configuration tasks. I knew the basics of command line environments, but I had never setup LDAP, mail or DNS. So anyway he asked me to setup some repository on yum, and well, at least I knew how to do that. When he saw me using vi commands to quickly edit the file, he stopped the interview, arguing that anybody who was fluent on vi, was obviously a seasoned admin and I got the postion. I never had the guts to tell him otherwise.

busterarm · 5 years ago
It's proof enough that you'll figure it out.

Years of interviewing people for my own teams has shown me that understanding your tools (especially to the point of being opinionated about them) is probably the #1 indicator of success.

Lio · 5 years ago
(Funnily enough ctrl-[ is one of my most used shortcuts in vim. It’s a convenient alternative to escape if you map caps-lock to ctrl)
cjhanks · 5 years ago
Yeah, I think you got lucky. He sounds like a great boss. And, he was probably right.
teekert · 5 years ago
Such a thing is a proxy character trade and probably told him enough. I'm in bioinformatics, if an applicant tells me they studied biology but have always run a Linux server at home, I can also stop the interview: hired.
atmosx · 5 years ago
Heh, I would fall for that!
stragies · 6 years ago
Same here, and then i discovered EVIL, the vi layer for emacs. The best of all worlds: Vim text manipulation grammar over the emacs engine.
generalk · 5 years ago
I've used Emacs for many years, and recently switched to Spacemacs, a set of configs that kind of takes over Emacs and puts a great platform on top of it.

I frequently describe Spacemacs as a better vim than vim. Don't get me wrong, I've used vim for ages; I'll never stop editing server config with vi, nor will I stop getting mad when vi is actually vi and not vim.

But for a day to day code editor? Spacemacs is astonishingly good.

(Of course, Spacemacs is built on top of EVIL, as well as dozens of other packages. On the shoulders of giants, as we say.)

b5n · 5 years ago
Probably in the minority - I have an extensive custom .emacs.d, but I've kept most of the default emacs bindings. Not only do I find them ergonomic (use the side of your palm for ctrl!), they're also the same bindings you'll find in most terminals. Additionally, emacs does so much more than editing, and having consistent bindings across tasks is really convenient (I'm super lazy :).
ed25519FUUU · 6 years ago
Alas, the emacs install base is fraction of vi/vim.
reactchain · 5 years ago
100% concur with this. I learnt Vim many years ago and I genuinely don't know what I'd do without it. It's always just there when I ssh into a new server. And the JetBrains suite has an awesome vim mode meaning I can use most (but not all) vim shortcuts with an actual IDE. I don't think vim itself works well as an IDE substitute, and wouldn't use it for hardcore web dev for example - but for quickly editing random files there's nothing that comes close.
karolsputo · 5 years ago
If one wants to do web dev on vim I strongly recommend neovim setup with coc.nvim. I know some people strongly disagree with transforming vim into and IDE, but this is a really productive setup for creating code (works like a charm for my current React project)

Personally I’ll sometimes use VSCode to browse big files or explore the codebase, but when it comes to editing them neovim with coc, fzf and a language pack is all you need.

kamaal · 5 years ago
>>I don't think vim itself works well as an IDE substitute, and wouldn't use it for hardcore web dev for example - but for quickly editing random files there's nothing that comes close.

Exactly my thoughts, you need vim and emacs these days if you want to munge through large amounts of text. The thing is in these days of Kibana and Elastic search. You don't do much of this kind of work anymore.

Code is text. But it's not that kind of text where you need your fingers and macros to do much work. Your tool needs to be at least to some extent aware and intelligent of code you are working with, or you end up doing too much work for nothing. If your language doesn't have this kind of tooling and you wish to maintain your application for long, you need to use a better commonly used language.

Much of the vim macro work I could put to use is done by black these days. If you are writing too much repeated code, you need to learn to write reusable code. Navigation is one more of those things which could improve if you use intellisense.

Bulk of modern day dev work requires working with 2 - 3 tech stacks. The use case for vim, which is writing few key stroke in one attempt to transmit them over super slow internet connections, doesn't exist anymore.

Lio · 5 years ago
I’m always interested in this opinion.

What IDE features do you think vim is missing that aren’t available via LSP plugins?

kstenerud · 5 years ago
I've used vi for 25 years now, starting on a m68k based BSD machine. It's an adequate editor, handy in remote shell sessions and good to know how to use, but I'd MUCH rather use an IDE or a windowed editor with menus and mouse and hotkeys like Sublime. I mean real hotkeys, not emacs.

At the end of the day, it takes a certain kind of mind to like vi, and if you're not of that mind, you probably never will be.

necrotic_comp · 5 years ago
My argument isn't that vi/vim/neovim are not superior editors but the editing grammar is a superior way of thinking about text. This grammar can be reasonably replicated in any environment, and confusing the grammar for the editor is what makes people make such claims.

This is coming from someone who lives in vim for his daily work, likes it, but always finds annoying sharp edges that are hard to reason about and script away.

psnosignaluk · 5 years ago
I think it depends heavily on what you're doing. My world is full of YAML/HCL/cnf files, and if I'm writing code, Go, where code is for software that runs from the command line, a daemon, or a no frills API/web service. Atom/VSCode and other IDE's were wasted on me, so I found myself gravitating back to Vim for its ease of use for those use cases. That said, vim-bootstrap did save me effort of getting a pretty solid editor out of Vim without having to think too hard about it.
blinding-streak · 6 years ago
Hated Vi at first. Absolutely loathed it. I was all about emacs.

But I gave vi another shot, and I'm so glad I did. The learning curve can be steep, and it's really unintuitive at first (or it was for me). But once it clicks a little bit, and you settle in.. Wow. I felt way more productive using it than any other editor.

war1025 · 5 years ago
I've been using vim for ~8 years now as my editor at work. I don't even use the "fancy" movements that everyone always brags about. It's still way more convenient to move around in than any other editor I've used.

I don't know where I saw it, but the idea that "Code exists to be read" really resonates with me. I don't care how fast I can crank out code. I care about how efficiently I can hop around from place to place to grok what is going on and how it needs to change.

The killer feature of vim that I feel like very few people know about is it's remote editor feature.

Launch a long lived instance of vim with a `servername` set, for example I do: `vim --servername EDITOR`

Then set up a application shortcut that will open the file using the prefix `vim --servername EDITOR --remote <file>`

When you open a file, it gets opened in your single vim instance.

From there you can navigate between all your open files using `:b <file-tab-complete>`

It's really a joy to use. You don't have the mess of tabs where you run out of space super fast, you just have a bunch of open files that you can switch between super easily by name.

dannycastonguay · 6 years ago
(Helpful tip) map caps lock to escape: https://vim.fandom.com/wiki/Avoid_the_escape_key
hellofunk · 5 years ago
One thing I like about vim is that the defaults are more sane than emacs. Almost no one uses emacs out of the box without extensive customizations. People customize vi too, but out of the box it is already pretty close to being there on its own, which is really nice.
dastx · 5 years ago
This is really interesting.

I'm quite the opposite. I keep trying to make vim my main devtool but I just can't stay away from a fully fledged ide. At the same time, having heard from literally everyone that once you do get used to it, vim is way faster to do everything in.

What advice do you have for someone like me to proper get used it once and for all? Are there any good resources you used to learn all the vim shortcuts?

majewsky · 5 years ago
My advice would be to start with the bare minimum: Using [i] to enter insert mode, [ESC] to get back to command mode, arrow keys to move around in either mode. With this you can use vim like Notepad.

Then observe yourself doing stuff and whenever you think "there must be a better way to do X", find out and learn how to do just that. (You would ideally have a cheatsheet on your desk for quick reference. If it's not on there, search the internet.)

At this point, it also helps to know about the basic grammar of normal-mode commands: motions as subjects, commands as verbs. Full sentences are either only-motion, command-motion, count-command-motion or command-count-motion. So if you have already learned that "dw" deletes a word, you immediately know that "d2w" or "2dw" deletes two words.

There's not much more to it. Just do your actual text editing and if you ever find yourself thinking "there must be a better way to do this", that's another learning opportunity.

It's a lot like language learning, really. You can plow through 10,000 vocabulary words in your SRS if you want, but nothing beats actually using the language.

beojan · 5 years ago
There are a number of vim plugins (like YouCompleteMe [https://ycm-core.github.io/YouCompleteMe/]) that can turn Vim into an IDE. If that isn't enough, you could try Emacs (yes, I know) with an evil-mode based distribution like DOOM Emacs [https://github.com/hlissner/doom-emacs].
hellofunk · 5 years ago
install vimtutor on your system, or just open this in vim:

https://github.com/TheNaoX/vimtutor/blob/master/vimtutor

It's a great start.

Personally, I find most modern IDE features are overrated and not necessary for productivity. For example, context-aware autocompletion is not necessary -- simple autocompletion based on things you've recently typed or that are open already in another buffer covers at least 90% of autocompletions I need. For the rest, I just have to type it out myself once, and now it is remembered too.

The same is true for browsing a file tree of your project, using syntax linters or reformatters, etc -- all of these are pretty straightfoward to setup in vim or emacs.

It can get a little tricker when dealing with breakpoint debugging, though. But in those cases, I just open in another IDE anyway that has extensive profiling tools, which vim does not have. But that's maybe once a week at most.

alwillis · 5 years ago
You don’t learn Vim that way. Once you get the Vim grammar, you just flow. Verb-adverb-noun.

This helped me back in the day: http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressiv...

williamdclt · 5 years ago
Same as you. I've ended up accepting that whatever the features or the plugins, the UX constraints in terminal editors (1-character unit of space, colors, graphical plugins...) will always be a huge limitation. That's reason enough to convince me to use VSCode or Webstorm with a vim plugin
forgotmypw17 · 5 years ago
If you like vimium, you may also like qutebrowser. It's built with keyboard bindings from the ground up, and is keyboard-first. I can browse most sites without taking my hands off the home row.
RMPR · 5 years ago
I use both QuteBrowser and Firefox with Vim Vixen, one of the thing that make me reluctant to switch completely are mostly addons, Multi-Container, cookies auto delete, ublock origin, Privacy Badger, ... I can't browse the Internet without those, and the built-in adblocker of QB is unfortunately not that performant. Also, you can't use the keyboard everywhere (thanks to the modern web) Random example off the top of my head: https://questions.wizardzines.com/event-loops.html
ausjke · 5 years ago
never heard about qutebrowser and it can even play netflix, impressive, it's a little memory hungry though, with just netflix running I saw memory is used almost 1GB, while 30 chrome tabs use 4.5GB
robohoe · 6 years ago
I was in the same boat. First real gig out of college (well besides the stints during college) and I saw how fast my boss flew on his keyboard while editing files in vi/vim. Here I was painfully editing config files in nano while he was flying by with vim.

I took the time to learn it and have been using it since. I now try to pass the torch by showing folks on my team the neat things vi/vim can do. People are amazed how much you can do it with just few short keystrokes.

wirrbel · 5 years ago
I was interested in programming, don't really know why but the thought fascinated me to be able to instruct a computer to do things you want it to do. So I had tinkered with QBasic and Pascal. A friend of mine went the C/C++ route which lead to us arguing like cat-and-dog (surely out of boredom) about the various benefits.

Then we mutually tried out linux and editors. He picked Emacs, so I went with vim. Haven't regretted it ever since.

mimimi31 · 5 years ago
What has always kept me from learning Vim is my non-English keyboard layout. Many of the default key combinations are impossible or require some serious finger acrobatics.

Sure, I could try figuring out a new set of easily reachable and non-conflicting keybindings for my own machines, but much of my motivation for learning it in the first place was being able to work on remote machines more comfortably.

insertnickname · 5 years ago
Try out a US* QWERTY keyboard for a few months. I grew up with non-English keyboards, but then some years ago I got stuck with a US keyboard for half a year, and after that I didn't want to go back. I can easily type the few non-English characters I need with the X.org compose key, so I can easily write in my native language. I assume it would work equally well for any language using a Latin-script alphabet.

*) US, not UK. UK QWERTY is trash.

jgwil2 · 5 years ago
Interesting point, and a good reminder of how anglocentric the computing world is in some ways. Do localized IDEs typically take this into consideration?
agumonkey · 5 years ago
I like vim, it's efficient.

This comes from an emacser. Emacs who shares this trait a bit (albeit rarely installed by default) .. when sublime text was all the rage I saw how emacs had 50% of it builtin and the rest was absorbed in a few monthes. I felt emacs would never fade at that point.

samvher · 5 years ago
Same experience here. Before learning vim I never expected its interface to make such a difference (it seemed daunting and unergonomic). I think the only other software that has made me feel that way is i3.
thedracle · 5 years ago
I think this is the truth for me.

I have learned hundreds of tools and IDEs over the years, and nearly every one is defunct and not used any more.

Every minute I've invested in learning vim has remained relevant and useful.

collyw · 5 years ago
> And since, almost nothing else (save for maybe git) beat learning vim from a return on investment perspective.

Interesting. I generally use IDEs Pycharm or Eclipse, or VSCode depending on the language. Do you think I would gain a lot from learning VIM?

auggierose · 5 years ago
No. It's like when somebody wants to learn how to fly, people tell them first to learn how to run really fast.
airstrike · 5 years ago
I dream of the day when Excel will have a vim mode... My life will finally be complete.
devnonymous · 5 years ago
Perhaps you should give sc-im a go. It's no excel but a good enough spreadsheet with vim like keybindings.

https://github.com/andmarti1424/sc-im

m0zg · 5 years ago
> And since, almost nothing else (save for maybe git) beat learning vim from a return on investment perspective

Same here. Love high ROI tools where the rug doesn't get pulled from underneath me ever year or two. Linux console tools, bash, vim, etc. My vim config dates back 20+ years, with only small modifications. I can log in into just about any *nix machine made in the last 30 years and be able to edit text at least somewhat comfortably. It takes me 30 seconds to set up a fresh Linux machine to my liking: clone a repo and run a script to symlink things to the right places in home dir. Done. I can also comfortably work from anywhere in the world over a crappy SSH connection.

C++ is the same. Glacial pace of change, skills from 20 years ago are still good with minimal modifications. 20 years from now it'll still be in use and it'll still be about the same. Which is exactly how I like it.

Another good thing about these gnarly old tools is that they weed out the dumb and impatient. I strongly suspect Rust is the same way - the learning curve and feature set look formidable. Lesser engineers are unlikely to ever learn it to the extent required to enjoy working in it. There's value in that, so I might learn it as well once they stop screwing with the core libs. I have work to do, I have no patience for such things.

hellofunk · 5 years ago
> C++ is the same. Glacial pace of change, skills from 20 years ago are still good with minimal modifications. 20 years from now it'll still be in use and it'll still be about the same. Which is exactly how I like it.

This gave me a bit of a chuckle since any modern serious C++ work is really a different language since 2011. Most of the C++ prior to that are considered anti-patterns now. It's hard moving at a glacial pace; the language gets major evolutions every 3 years.

saberience · 5 years ago
Controversial comment here, but I would say Vim isn't popular at all. I would say instead, Vim advocates are incredibly vocal (a bit like Vegans and Crossfitters) and won't hesitate to talk about it at all times.

I've been engineering now since 2002 so approaching 20 years and sure, every office has one guy who's the "hardcore" Vim guy. Everyone else in the office uses Visual Studio or VSCode, Atom, Sublime, IntelliJ etc. But the "Vim guy" is the by far the loudest guy in the room when it comes to discussing his editor, tries to tell everyone else why their editor sucks, how superior Vim is, etc etc. Meanwhile all the users of VS and other editors quietly get along with their work and feel no reason to advocate for their editor like it was a religion.

At my current company it's the same. We have maybe 300 engineers. 99% of them use VS or VSCode, there's probably one or two guys using Vim and still telling everyone else they're dumb for using VS... In 50 years when things have changed completely, there will probably still be some guys using Vim telling everyone else they're wrong for using VR Coding with voice recognition (or whatever is happening in the world of coding then).

psychoslave · 5 years ago
In my experience, after University, I never see team members extensively dispute on this topic. I have a strong preference for Vim, but if other are fine with other tools, that's nice. We can possibly show each other how we manage things differently.

It's not like Vim is perfect, and even taken the sharp learning curve apart, there are many things that are not ideal. But so are other tools. I tried some IDE here and there, but never found an improvement in my productivity – which would be certainly easier to improve by not going to sites like Hackernews. :D

I do find some things in some IDE horrifying, like having the amount of RAM consumed by the application displayed in the default interface, and seeing it growing while you don't ask anything to the application. I mean, even dropping the fact that it does require so much resource to do nothing, what a strange idea to clutter the interface with this data if the goal is to let users focus on there issues.

But that's no reason to be zealot of any other editor, including Vim. I'm rather confident that going with a matrix with measurable metrics, Vim wouldn't have rated 100% everywhere nor any other tool would.

To me the greatest feature of vim is that it's available virtually everywhere, so you can take it and the skill you gained on it everywhere. It doesn't make it something should use all the time, but it makes the point on how it might worth the effort to start learning it. That also a positive retro-active loop, that explain "why Vim is so popular", I guess.

Bnshsysjab · 5 years ago
> there are many things that are not ideal

I’ve never used vim, mind sharing what it’s weaknesses are?

gpmcadam · 5 years ago
Did you not read TFA?

~25% of web devs in the SO 2019 survey said they used VIM as their editor. Amongst dev-ops that number is higher, around 40%.

https://insights.stackoverflow.com/survey/2019#technology-_-...

So your anecdotal example of "99% of people using VS or VSCode" doesn't ring true for the industry as a whole.

saberience · 5 years ago
People could select more than one option in that survey (87,317 responses; select all that apply). You'll notice that the results add up to more than 100%. Most people who have to remote in to a server will be forced into using Vim sometimes, which will skew the results. Also, I would say that people who would respond to a SO survey arent a representative sample of all developers.

I do not use Vim as a daily driver at all, but I have to use it sometimes because I have no other choice (remoted in to a box). So if I had to say which editors I used, Vim would be there... sometimes.

mumblemumble · 5 years ago
You're misinterpreting that graph. The key detail to note there is that the bars don't add up to 100%. Meaning that it's showing what percentage of people use that IDE/editor at all. The phrasing, "~25% of web devs... used vim as their editor," implies that 1 in 4 web devs use it as their primary or preferred editor, which is not something that can be inferred from the data.

For my part, when I answered the survey, I checked vscode, intellij, vim, jupyter, emacs, and rstudio. Most of those are there because they're my preferred editor for some task or other, but vim is only there because it's the only editor I can expect to have available on every server I ssh into. So, while I did say that I use vim in the survey, I would encourage you not to count me as a vim user for the purposes of any popularity debates.

jgwil2 · 5 years ago
FYI, the guidelines state:

> Please don't comment on whether someone read an article. "Did you even read the article? It mentions that" can be shortened to "The article mentions that."

war1025 · 5 years ago
I think it's highly industry and probably project dependent.

If company policy is that "we use X", then probably you're not going to have many people stray from that. The bigger the organization, the more likely you are to have strict guidelines in place like that.

I would guess people on Windows are also less likely to reach for Vim than any of the many other alternatives. If you're using Linux, you probably have a different view on the world to begin with, and are more likely to go with vim over whatever is the "new hot editor". I've heard Mac users like to reach for XCode, but I don't actually know many developers outside of work, and none of them use Macs, so I don't know.

oblio · 5 years ago
Besides the other facts mentioned by the other commenters, Vim has a sort of geek-chic aspect to it. It's "cool" to be a Vim user in certain circles. That inflates the numbers plus it also causes a "New Year's resolution" effect where someone would say they use it just because they know :wq and this year they're really, really going to go to the gym, oh, sorry, going to use Vim proficiently for a real project.
squiggleblaz · 5 years ago
Almost every editor allows you to interact with it as though it's Vim. But most editors don't allow you to interact with them as though they're any other editor. I think that's a point in Vim's favor?

(I certainly don't use Vim for most of my coding. It's not good enough. But I do use Vi keybindings in VSCode, Visual Studio and PhpStorm depending on what language I'm using. I'm not particular enamored of VSCode either, btw, for the same reason that Vim isn't good enough - sure, it can do what you want. But you can't guess how to do it. You need to read the documentation. VSCode one ups Vim in just one way - it has a gui for searching and installing plugins. Visual Studio and PhpStorm allow you to browse the menus to find the facility you want. It may take for ever, but when you have some downtime, you can browse and use your learnings next time.)

488643689 · 5 years ago
This. I just want hjkl and dd in every editor, but I don't use any other vim idiom often, and things like multiple cursors or alt+up/down move lines are the editor's fancy features I rely on most. (Sadly the VS Code vim plugin is broken all the time)

But hjkl I need even in my webbrowser. (In Thunderbird I've send many mails to junk by accident.)

wool_gather · 5 years ago
As a data point, Mac OS native text controls have a handful of Emacs-style text commands that use Control -- like ^t, ^e, ^h, ^b, ... -- baked in.
koonsolo · 5 years ago
That is too bad. I'm a Vim user and combine the best of both worlds: vim plugin in VSCode.

A few of my colleagues are vim users, and fortunately for the others we are not as vocal as you describe. I already accepted of being the weirdo that uses vim, because my programming skills make up for it ;).

I do have a shortcut to disable it, when we do some pair programming.

deergomoo · 5 years ago
> vim plugin in VSCode.

How is that these days? I used it a couple of years ago but it had issues at the time, namely some performance problems and getting stuck in a particular mode.

I ended up abandoning vim bindings because the JetBrains plugin was also buggy, and I straight up had no feasible way to get those bindings in Xcode, but I hold out hope for a glorious LSP-based future where I can just use vim and get all the benefits of my other editors.

divan · 5 years ago
Most vegans are actually quite quiet about it, so it’s a sort of survivorship bias, where you simply have no way to find out how many non vocal vim users out there :)
walleeee · 5 years ago
> I would say Vim isn't popular at all.

The fact that most popular editors and IDEs (every one you mention) have VI/VIM plugins suggests otherwise.

It's (usually) not the editor itself that people find appealing. It's the key bindings. It's the fact that you can navigate around a file without reaching for the mouse.

_wldu · 5 years ago
Saying vi and vim are not popular is like saying Unix and Linux are not popular.
thedracle · 5 years ago
Being at a company where most people do not use Vim definitely has caused a great deal of consternation and discussion about why I use Vim, and why I don't use a "real" IDE.

It becomes a hot topic of discussion without my wanting or really worrying about what other people are using.

I think the comparison to Veganism is a good one--- people think it's a flex, when in reality I just like it and it helps me get my work done.

strathmeyer · 5 years ago
Have you considered that every person who uses vim has sat down at a new job and been told by their boss how much they're going to love their IDE?
LilBytes · 5 years ago
I sent this comment to my colleague, I'll see if it triggers him... :-)

Deleted Comment

mbar84 · 5 years ago
> VS and other editors quietly get along with their work and feel no reason to advocate for their editor like it was a religion.

Well of course not, because their editors SUCK!

sbmthakur · 5 years ago
Well, I am the only guy on my team who uses VScode-Vim and I don't preach. I understand that editor is a personal choice when it comes to development.
drbojingle · 5 years ago
So Vim has more champions. Sounds like you experience ineffective ones all the same.
kiplkipl · 5 years ago
Software engineering is far bigger than your niche.
apexalpha · 5 years ago
sounds a lot like the IRC guy...

https://xkcd.com/1782/

anthk · 5 years ago
IRC users don't use vim, but nvi. They don't need any more. They probably use entr(1) and make(1).
eddieoz · 5 years ago
I think they are just being posers. When we compare the efficiency of debugging (p. ex.) it is clear who can find the problem fast.

Today if I'm conducting an interview and the someone tries to convince me he/she is a good programmer and just use vi/vim, I need to rethink my decision because it can compromise the whole project. I'm not saying they are not good, but having the capability of fast debugging and solving problems fast is crucial sometimes and is part of the whole package.

I was that kind of person someday and I understand the feeling.

But for devops, vim or emacs are the all-in-hands tool and everyday editor, just because they are available in everywhere and work very well on terminal mode.

flippinburgers · 5 years ago
Spoken like someone who has never gotten accustomed to the power of vim :)

Do you know who would likely "compromise a project"? The junior dev that is unable to stray outside their IDE when getting things done.

xtracto · 5 years ago
Interesting comment. I've been programming for more than 25 years. Have used stuff like GWBASIC, TurboPascal/C , fancy ide like VisualStudio, Eclipse, Netbeans and the new kids like atom or vscode. I even used DDD at some point.

Line debugging becomes less and less valuable as you become more mature in you dev career. Sometimes you have a race condition bug, some times the target architecture just doesn't provide it (devkitpro/devkitarm or embedded) and sometimes bugs that are evident in production just cannot be replicated in your debugging environment.

In my experience it is more valuable to improve skills of building mental models of the system at hand, get effective with console logging for key info and troubleshoot issues that way.

oalae5niMiel7qu · 5 years ago
IDEs are great for the early stages of a project, but once it hits production, this is the only debugging flow that has ever worked for me:

1. Read the logs.

2. Read the code that produced the logs.

1_player · 5 years ago
I don't get it. Are you saying vim users are bad programmers and bad at debugging?
jgwil2 · 5 years ago
I think you should evaluate candidates based on the skill/knowledge they show in the interview and trust that if that is up to par, then they will be competent to choose the tools that work best for them.
tenebrisalietum · 6 years ago
Disappointed the article went straight from punch cards to video terminals without mentioning teletypes.

> Having that thing show up on computers in those days was pretty tricky, and some considered it a resource hog.

Well in the 60's and 70's, you didn't necessarily even have a display, you might be using a physical teletype. `ed` is built for that.

Even when you had a display, it could be slow. The VT05 from 1970, only went up to 2400 baud. And if you were using a modem back then I think you were definitely most likely connected at 300 baud or below.

NateEag · 5 years ago
Perhaps my favorite video on YouTube is this glorious footage of someone hooking a 1930s teletype up to a computer running Linux:

https://m.youtube.com/watch?v=2XLZ4Z8LpEE

Watching it for the first time is what finally made ed click for me.

And yes, I was disappointed that the author clearly didn't understand why ed has the UI it does. It's about the teletype, not the computational cost of having a WYSIWIG UI.

klysm · 5 years ago
I desperately want to set up a teletype on my modern desktop - there’s just something so awesome about electromechanical interfaces with a lot more mechanical than electro.
andrewksl · 5 years ago
Yeah that video is all kinds of amazing. I also got lost down a several hour rabbit hole watching the guy and his buddies bring up an AGC and perform a simulated lunar landing with it. Thank you for sharing!
koolba · 5 years ago
That video is amazing!
reaperducer · 6 years ago
Or the display might be a single line of 16-segment LEDs for interacting with the machine, and "output" was on paper. Another reason to keep the visuals to a minimum.
akira2501 · 5 years ago
> ed

Ed is the standard text editor!

[0]: https://www.gnu.org/fun/jokes/ed-msg.en.html

ricksharp · 5 years ago
Does anyone have a good video comparing vim speed coding vs vscode using built in editor features?

I’ve been using vscode for years and the YouTube videos that demo vim features are shallow (like how to enter a blank line - really?). I can do the same thing I have seen in vim videos without memorizing a bunch of strange key bindings all while being able to edit code instantly without changing modes.

I would love to see a fair comparison between someone using vim at 100% and someone using vscode at 100%.

Of course some vscode shortcuts might not be fair (like F12 to jump to definition, F2 to rename every usage, etc.)

But even in raw editing:

With vscode, I can do multi-line editing, I can navigate quickly, jump to specific words, etc all very fast.

If there is no video like this, would anyone be interested in a race?

pengaru · 5 years ago
There's too many little things to mention, they do all add up to be quite significant in the course of programming.

Here's a tiny sample of some stuff I use constantly:

Move cursor forward word at a time: w ignoring punctuation: W reverse: b B

Move cursor to next occurrence of character Z: fZ reverse: FZ

Delete forward to next occurrence of character Z: dfZ reverse: dFZ

Change forward to next occurrence of character Z: cfZ reverse: cFZ (like delete but leaves in insert mode afterwards)

Repeat latest edit from current cursor position: .

A lot of the vi commands are composable, as illustrated to some extent above.

To search for say the next line starting with void: /^void

To delete from the current line up to the next line starting with void: d/^void

Note the similarity to dfZ/fZ from above, it's not 100% consistent but most times you can take a chance composing things as you'd expect and things work correctly.

There are far more sophisticated things too of course, but I'm not writing a vim tutorial in an HN comment.

You can do things like rename a function while rearranging its arguments either file-wide, or on a number of lines, or on an interactively selected visual region, or a section selected similar to d/^void... I presume other editors have such capabilities, but I'm most familiar with vim. In vim the actual renaming and rearranging is done using a regular expression containing backreferences:

  s/old_func(\([^,]*\), \([^)]*\))/new_func(\2, \1)/
You may constrain that to a subset of lines a variety of ways, and on top of that can suffix a 'c' on the end of the substitution regexp to make it conditional and you'll get a chance to interactively yay/nay the substitution at every match in the considered lines. The conditional suffix is a godsend as it lets you be fast and sloppy with your regexps and just skip the false positives.

brabel · 5 years ago
Honestly, I can do almost all of these things with any standard editor as well, with standard shortcuts.

The ones I can't do directly, I can do via Search/Replace functionality that is also standard in most modern editors.

Your example about refactoring a function by using text editing capabilities is actually pretty bad unless you mean Vim can actually parse your programming language and perform the refactoring over all your code-base (not just a single file), like any IDE will do.

This list you gave me just convinced me I don't need Vim.

ricksharp · 5 years ago
Thanks for the feedback.

vscode has regex find replace, but I don’t use it very often. It does show every match highlighted in the current file while entering the find value, which is nice.

It does the same for multi files if needed and gives a nice preview of every change.

Word navigation I use a great deal (especially with multi-cursor editing). Ctrl+left/right jumps words, home, end to begin end of line.

Ctrl+f Z Enter would go to next Z value. (Which I don’t use, because I don’t think in partial words much, but rather jump to mouse if I need to navigate far)

That’s probably where I could gain in using that instead of going to the mouse every time.

IshKebab · 5 years ago
> Delete forward to next occurrence of character Z

How often do you really do things like this though? It seems like, sure you can do weird obscure things quicker in Vim, but only if you happen to remember how do to the weird obscure things, and it's only useful in weird obscure situations.

For 99% of tasks the built-in VSCode stuff does the job for me. Ctrl-D especially.

macromaniac · 5 years ago
Here's a video of some more advanced vim features I threw together. I'd be surprised if you can do this using e.g. vanilla vscode

https://www.youtube.com/watch?v=UDGG3hK4Bg8

Its a simplified version of a problem from work a while ago where we had to generate ui from lots of csv files. The last dev on it was taking weeks, but with vim I was able to come in and finish the boilerplate instantly. (We were commited to non-dynamic ui at that point, I think I made the right play especially with how we ended up using it).

Vim is, in my opinion, inferior to an ide or a good text editor, but if you have it as a plugin you get the best of both worlds and vim suddenly can do... basically anything you can think of. Like here's putting a breakpoint on every line in a file

https://imgur.com/SFhlEr7

The best part of vim in an ide is when you're pair programming and you do something fancy, and your friend says "Wait, go back, howd you do that??"

ricksharp · 5 years ago
That’s pretty cool. It seemed a bit slow creating the “macro” but pretty cool to see it run through all the lines.

The way I would do that in vscode would be with a multi-edit, but it would get iffy at that many lines.

I‘ll record a video doing the same for comparison tomorrow.

This makes me wish there was a site for recording challenges like this where developers could race using their favorite tools.

Vim vs VScode would be an amazing way to learn tips from experts on both sides.

zoid_ · 5 years ago
Nice vim demo on youtube, how does the sequenced numbering work? Can vim increment a number without any plugins?
cat199 · 5 years ago
copy 10 lines from the current position into buffer q, go to the start of function jnk, copy 5 lines into buffer w, jump to line 10, paste contents of q, contents of w, and contents of q sequentially one after the other:

"q10yy /jnk "w5yy 10G "qp "wp "qp

now, go to the start of the document and indent the next 20 lines by 10 spaces:

0G .,+20s:^: :

ok great, now find JUNK and replace 'a1' with 'A1' in the 15 lines that follow:

/JUNK .,+15s/a1/A1/g

probably not as efficient for multi-file refactoring, but for raw 'drag race' style text munging, everything is there, loaded in muscle memory, and under the home row of your keyboard so you don't have to lift your hands at all.

ricksharp · 5 years ago
Thank you for that example!

Just thinking out loud how to do that in vscode for comparison:

- I don’t think repeating actions a specific number of times makes sense in most use cases. Counting 10 lines would take longer than doing shift up/down n times (which would be exact with feedback) to select the desired lines.

- Multiple Copy Paste buffers sounds interesting, I might look up a vscode extension for that. (Had a copy paste queue in Visual Studio but it would break sometimes and would lose something important).

- go to start of function jnk, there are many ways to do that in vscode. Ctrl+f jnk enter would be one.

- Goto start of document is Ctrl+Home

- Indent 20 lines by 10 spaces, could do Alt+PageDown, then up/down to get to the right place (without counting or caring that it is exactly 20 lines), then with multi-line insertions could space,tab, etc.

That operation would probably justify mouse usage though, in which you simply hold alt, drag ~20 columns/~10 cells and hit space - which itself would be faster than counting 20 lines.

- find junk: ctrl+f junk enter

- select 15 lines (shift+page down,up/down to adjust) I can preview I have selected the correct area, other possibilities to select current function, etc.

- Ctrl+h to replace, a1 tab A1 Alt+L Enter

- of course in most cases, I am renaming a symbol, so “F2 A 1 Enter“ would do

I think the reality is that counts are not known before hand, so being able to increment/decrement with visual feedback is perhaps faster than a miscount, but I’d have to see it to know.

Anyway, thanks for the detailed examples! I can certainly see how it would be powerful if committed to muscle memory, but even with vscode there are many shortcuts I don’t use because of formed habits.

CGamesPlay · 5 years ago
I find it interesting how we use vim so differently. I'd never type "10yy", I'd use "y9j". I never use "10G", I use ":10<CR>" (<CR> = enter for those not familiar). Similarly, "0G" is "gg" for me. Call me a notepad user, but that whole second snippet for me would be "ggV19j>" followed by "." until things lined up correctly. Similarly, the third would have been "V14j:s/a1/A1/g".

Nit pick: "q selects register q. A buffer is a different thing.

lostmsu · 5 years ago
> now find JUNK and replace 'a1' with 'A1' in the 15 lines that follow

The real scenario is usually to replace, for example, in a function block. How do you do that? Counting function lines seems like a non-starter.

ricksharp · 5 years ago
Ok, also am curious about multi-insertion with cntr-left/right that vscode does:

For example, let’s say I have a json object with variety of field names, one per line and I want to remove the quotes.

With vscode, I can alt select all lines, Home Ctrl+right del cntl+right del.

The trick is the field names are different length, does vim have multi-edit with the ability to navigate relative to each insertion point?

Edit: Here is a good video example (https://youtu.be/iomWEDMBlcE)

Can vim do something like that?

city41 · 5 years ago
Jump to definition and rename every usage are really handled by the language server. Vim supports language servers quite well. I do both those commands in vim all the time. And vim complements them with (book)marks, return to last edit, etc.
goalieca · 5 years ago
Vim can jump to definitions and stuff too. It integrates with ctags. It can also do code completion and everything else. I have it bound to clang-format with ctrl-k.
RMPR · 5 years ago
Just feel the urge to mention cscope which is ctags on steroids
jtr1 · 5 years ago
Between the awkward file navigation and the feeling of building my own editor from the ground up, I just never found it worthwhile to fully commit to Vim. So I work in VSCode in my day job.

What I did take from those efforts, though, was Vim's text navigation key bindings. They are a joy to use and most text editors have some sort of emulator for them. The beauty is in the chording, almost all of which maps to easily remembered mnemonics. Delete everything between quotes? Use di". Change curly brackets to square? Change surround, or cs{[. Once you've gotten used to switching between move and edit modes, you can layer these in bit by bit. At a certain point it becomes second nature and you do feel like you can edit code at the speed of thought. It's a powerful feeling.

tomgis · 5 years ago
> I can do the same thing I have seen in vim videos without memorizing a bunch of strange key bindings

you totally can! I could talk for a while about customization and ctags to address some other points you made but at the end of the day its a text editor, vim and vscode are both text editors. it sounds like you really like using vscode so you should stick with it, I really love vim and it works really well for me, and my boss loves using a near vanilla sublimetext 2 install. programming will never be about typing and editing speed but being comfortable with your development environment and hopefully even enjoying it is very important.

gaogao · 5 years ago
One vim hack I like is multi-line macro application. It's a good fallback in case, as I often forget the syntax for certain things. To facilitate this, I've remapped ctrl-space in visual line mode to apply my `q` macro to every selected line.

As an example, say I need to add a comma to a bunch of lines. I will record the macro on that line appending a comma to the end, visually select all of the other lines to copy the macro on, and then jam my hotkey to apply the macro.

It's often much quicker than reaching for a regex for short segments of code.

RMPR · 5 years ago
FWIW, your particular example is doable with vanilla Vim with the same efficiency (with less strain)

    V<count>j (3)
    :'<,'>norm A, (8 - The angular brackets are automatically added by vim)
Vs

    qq (2)
    A,<ESC> (3)
    q (1)
    V<count>j (3)
    <CTRL><Space> (2)

jng · 5 years ago
Here's my best take at this so far, I wrote it in 2007:

Why, oh WHY, do those #?@! nutheads use vi? http://www.viemu.com/a-why-vi-vim.html

funcDropShadow · 5 years ago
This post has been my enlightenment about modal editing. Thank you for this excellent piece. And I've referred dozens of people to it after me.
spekcular · 5 years ago
I've found keyboard-only vim is much slower than a mouse for editing papers, because the edits are often random-access and vim isn't great at that. You also can't use SyncTeX (which is amazing) without a mouse.
Lio · 5 years ago
Why would you use vim keyboard only since vim supports using a mouse in the terminal?

It even supports using a mouse over ssh.

I don’t know SyncTex so can’t comment on that.

spupy · 5 years ago
There's no point in comparing them, in my opinion. VS Code is a tool for programming; I would call it an IDE but I 'm not very familiar with the app. Vim is still "just an editor". You can still use it for programming (not just coding bash scripts), but that's making your life harder than it needs to be. In my experience the amazing text editing features of vim are only very rarely useful in a software developer's work. I feel the same about multiline editing though. And Vim has amazing text editing features, but severely lacking code editing features.
Lio · 5 years ago
If you care for them vim has access to many of the same features as VSCode via LSP and the same plugins that VSCode uses.

Why would one be suitable for programming but not the other?

It just comes down to UI preference and whether you want to configure things yourself or not.

maxnoe · 5 years ago
My (neo)vim can do more than vs code in default config.

Both support plugins, so the possibilities are basically endless

ur-whale · 5 years ago
Google "vim golf"
norenh · 6 years ago
I started using emacs in the early 90s and got really into it during uni, studying CS a couple of years later. In mid 2000s I ended up in sysadmin work in a mixed Unix-environment (Tru64, AIX, Solaris, Linux) in a group where all other used (some Vi(m)-variant). I tried to get work done with emacs but failed due to various special characters always getting mangled in different ways over different terminals on different platforms and after a couple of months I gave in and started using Vim instead. I finally understood that Vim had two essential properties that other editors lacked in this case.

1) It works well in environments where special characters will get mangled in various ways over different platforms. As long as ESC works, vim will do the work just fine. 2) The modes makes it very reliable to use when you have to make specific operations in exact places in text-files. This alone should make it the goto editor for sysadmins where you often have to make just a few character changes to a configuration file and be sure you do not change anything else.

A third reason when starting the work was also that Vim came by default on all out platforms so we knew it existed there and it was a nightmare trying to get approval for extra packages to be installed, but the first two reasons are what keeps me coming back to Vim whenever I need to do some text-file surgery.

CalChris · 6 years ago
It's nice that ESC works but I also want : ex-mode to work as well. It's why I continue to use MacVim rather than Visual Studio Code. VSC's vim emulation is pretty good ... except for ex-mode and I use that a lot. So I go back to MacVim and stay there.
greggyb · 5 years ago
I've heard good things about a (maybe experimental?) feature to use neovim for VSC's ex-mode. Have you tried that?
halotrope · 6 years ago
For me it is being able to efficiently navigate a file without leaving the home row (Gotta learn touch typing first). Once you understand the commands follow a composable grammar it is really like a superpower for dancing around text.

„Go down 5 lines, move right two word, replace the contents of the brackets“. I don‘t use the actual editor all that often but have vim mode enabled in all my „real“ editors like VSCode or JetBrains Suite. I am often wondering how people do edit source efficiently without vim mode but I am too shy to ask.

foobarian · 6 years ago
Honestly, this stuff is not a bottleneck for me. The things that both emacs and vi do, and vi does a little better:

1) Supports more than basic text manipulations. Rectangle selection and deletion? Check. Regex operations? Execute shell command on selection and replace inline? Record a macro and execute N times? Modes? Stuff like that.

2) I know it really really well to the point I don't need to look anything up to use it.

3) Runs anywhere. Got a shell on the hard disk controller? It will be there.

Vi is better only at 3. Emacs 1-2, and I would say 3 partially compared to other visual editors that you sometimes can't run even if you tried.

I really don't care about the Lisp, or the home row stuff, or whatever. That falls under #2. As long as I memorize and get good at how some operation is done, and the effort is similar, I'm fine.

And then we get to #1, and pretty much all good editors today do well there.

perl4ever · 5 years ago
>Rectangle selection and deletion? Check. Regex operations?

These are vital features from my perspective, but completely orthogonal to whether an editor has a post 1980s interface.

And it's also nice to be able to handle large files.

timClicks · 5 years ago
Re 3) how does one look into gaining access to a shell on a hard disk controller?
gt2 · 6 years ago
Long time vim lover here as well, but I guess I hear often that for a lot of folks, input isn't the bottleneck.
dbtc · 6 years ago
I've been using vim for about 7 years and for me it's not so much about the efficiency as it is the pleasure of commanding (programming!) a powerful, wellmade tool.
johannes1234321 · 6 years ago
I don't see it as a bottleneck, but focus. Not searching for the mouse or something or stretching fingers to Edit with Meta Alt Control and Shift etc. but fingers where they feel comfortable efficiently browsing the files.
halotrope · 6 years ago
Yes I hear that as well. IMHO most of the time is thinking but when I want to move stuff from my brain to my screen I prefer maximum bandwidth and not having to consciously think about it. To each their own I guess.
pugworthy · 5 years ago
I have been using VI(M) since the 80's and it's amazing how fast you can navigate in it when it's just deep muscle/neural memory. In fact if you asked me how to do some navigation in there, I actually could not tell you - but I could just do it.

I'm also someone who immediately installs a VI plugin into any IDE I use, as otherwise I'm lost.

IDEs and their editor key/control systems come and go, but VI(M) remains constant, and has done so (for me) for 35 years.

cutler · 5 years ago
I simply won't use an IDE if it doesn't have a decent Vim plugin.
boogies · 6 years ago
Some people use trackballs or pads with their thumbs, or trackpoints.
red75prime · 5 years ago
> Go down 5 lines

Look at the beginning of a target line, remember the number (takes up a slot in our limited short-term memory), switch to command mode, type the command.

vs

Hold/mash "down" button until cursor is there.

After watching a few vim coding screen-casts I have the impression that the second way is more popular in vim too.

boogies · 5 years ago
TBH I think I almost never look at the line numbers in vi, but the alternative isn't always holding/mashing j.

I occasionally use a count (5j to move 5 lines down, especially good for moving ~4 lines at a time), sometimes use C-u/d, C-f/b, or H/L to scroll half a page up/down, a full page up/down, or move the cursor to the Highest/Lowest line on the screen (these are good for large movement. And you can use zz to recenter the cursor on the screen after H/L). But likely the most common vertical movement I use is curly brackets/braces to move a paragraph up/down.

In CUA editors to me the nicest shortcuts are Control[+Shift]+Backspace and Control[+Shift]+Arrow because they involve the editor understanding a basic construct of human language (words). Vi takes that to the next level.

L3viathan · 5 years ago
> switch to command mode

Why? Just use the 'relativenumber' option and do 5j.

> the second way is more popular in vim too.

Maybe for moving down 5 lines, but (I hope) not for things like "replace the inside of the brackets with what's in my A register". Otherwise you're really better off using a different editor.

the_jeremy · 6 years ago
If that was a genuine question, I have coworkers who just embraced their IDE shortcuts (IntelliJ and Eclipse can do all the things vim can with weirder shortcuts and no vim mode) or they use emacs / emacs-style shortcuts
rob74 · 5 years ago
I think it's a bit sad that the article completely fails to mention that Bram Moolenaar originally implemented vim on the Amiga. Actually this might have contributed to its popularity: back in 1991, Amigas were much more widespread than Unix boxes, and around the time Commodore went bust and the Amiga was no more, i imagine lots of developers migrated to then-new Linux rather than to the despised DOS/Windows, and took their preference for vim with them.
kristopolous · 5 years ago
I was reminded that Amiga was bought by Gateway which sounds crazy but it was 1999, that was wackyland times
6502nerdface · 5 years ago
I think vim became so popular because its only real competitor is Generally Not Used Except by Middle Aged Computer Scientists. ;)