text
stringlengths
0
2.02k
**Jerod Santo:** While Drew's experience may be somewhat common, Gary came to Vim from a completely different angle. And while I hadn't considered it before, I have to say it's a compelling reason.
**Gary Bernhardt:** For me -- I don't know how common this is, but for me it was motivated by fear of RSI, of injury. Programming long-term is dangerous for your hands. Fortunately not the rest of you, but for your hands and your wrists, totally dangerous. And I wanted to keep programming for many more decades... So I ...
**Jerod Santo:** Did you know that going into it, or did someone say "Vim's great for RSI", or how did you know that?
**Gary Bernhardt:** I had a bit of a scare; it's what caused me to take that path. Honestly, I probably just overused a muscle or something, and it was sore... Which is a common way to think you have RSI when you don't. So that went away. But having had that scare, I thought "If that was my RSI coming in permanently, i...
**Jerod Santo:** Julia has been using Vim for so long that she couldn't even remember what initially drew her in. Suz was also well aware of the editor for a while, but she only dove in somewhat recently.
**Suz Hinton:** I've always sort of messed around with rented Linux VPS'es... And when it's your own box, you tend to do all the dodgy stuff. You do all the cowgirl stuff on the server, you modify your NGINX config live, and things like that. And usually that's done in the shell session, so really the most practical op...
So usually I would pick it up if I needed to use it, and it was usually within that context, of just like messing around on Linux without some kind of display drivers or GUI. To be honest, nothing about the experience itself made me wanna pick it up. I knew how to go into insert mode and get out of insert mode, and som...
I've been curious and felt that it was valuable to learn properly, and I knew other developers and colleagues who used it, but I just never really felt motivated enough at the time, which is why I really only picked it up four years ago.
**Jerod Santo:** Suz has said something interesting there, that I heard from others as well. She said it's installed out of the box on so many Linux machines, it's just always there. That is definitely a strength, and it turns out it's one of the things that Suz loves the most about Vim.
**Suz Hinton:** \[08:05\] Because of the ubiquity, you end up in the scene from Jurassic Park where it's like "This is Unix. I know this." So if you have to do something really quickly on a Raspberry Pi or something, you're just like "Oh, I know this. I can do this really quickly in Vim" and it's great. So that's the d...
What I also like about it is that because it is on everything, it can be as simple or as customized as you like. The biggest sort of personal virtue for me about it is that I have a really bad short-term memory; I find it very difficult to hold a buffer in my head of what code I need to write next... Sometimes I have t...
And even just changing your mind about something and rewriting it, getting the code out of my brain and onto the screen in front of me as fast as possible actually really helps me not be so overloaded, and it's actually far less exhausting for me. And because Vim is designed to train your muscle memory to do very effic...
**Drew Neil:** I guess one of the things I love most about it is the grammar, the slightly funky way of doing things, where -- like, in most text editors you select some text, usually by clicking with the mouse, or double-clicking, or whatever... And then having selected the text, you then run some operation on it, whe...
**Gary Bernhardt:** Vim is complicated. There's a lot of stuff in there. But the thing that makes Vim Vim is normal mode. The letter keys do things without modifiers. It's such a simple thing, but everything that is sort of special about Vim for me stems directly from that.
**Jerod Santo:** When you first open up a file with Vim, typing on your keyboard won't insert any characters. That's because you're in normal mode, like Gary was talking about. Normal mode is for doing non-character insertion things - moving your cursor, copying and pasting in-lines, manipulating text that's already th...
Drew struggled with this concept, like most of us do, but he came up with a great analogy for Vim's different modes that may help you make more sense of it.
**Drew Neil:** The point where it starts to make sense really is when you accept the modal nature of Vim. And for me, I feel like the point where it started making sense was kind of where I started to see those trips into insert mode and back out again as being -- well, I draw an analogy with the way a painter works. I...
\[11:57\] A couple of things that made that make sense to me was 1) realizing the way the Undo command works. If you make a trip into insert mode, you type some text, you pop back into normal mode - that's one little undoable chunk of work... Whereas in most text editors where you're generally in something like insert ...
**Jerod Santo:** Yeah, it's fuzzy.
**Drew Neil:** Yeah, it's fuzzy. It's a little bit like having some sort of Autosave feature that says "Okay, everytime you've paused for more than two seconds, we're gonna autosave." It's a similar sort of idea, where if you've paused for a certain amount of time, maybe it will put in a little Undo stop, or whatever y...
Another point where I realized "Okay, I'm kind of thinking about this as like little chunks of undoable changes", and it really started to feel like brushstrokes... It started to feel like the idea of being in insert mode by default just felt wrong. It's like "Well, of course the painter doesn't have their paintbrush t...
So having that sort of being able to think in modes just made everything feel natural... And from there -- I mean, at that point you've still got a lot of Vim to learn, but at least your patterns of thought are aligned with Vim's ways of making you do things.
**Jerod Santo:** Normal mode and insert mode aren't the only modes in town. Vim's visual mode is great for selecting multiple characters, lines or blocks of text, and then performing some operation on that selection. I love visual mode. I use it all the time, and so does Julia.
**Julia Evans:** Yeah, I love visual mode. One of my favorite things about visual mode is - do you know how you can go into visual mode and then do :! and then type a Unix command, and it'll pipe the stuff you selected into that command, and then replace it with the output of the command?
**Jerod Santo:** No, I didn't know that...
**Julia Evans:** \[laughs\]
**Jerod Santo:** I think that sounds spectacular.
**Julia Evans:** It's spectacular. Sometimes I'll have a list that I wanna sort, so I'll just select it all and do :! sort, and then it'll sort it in my editor, and I don't need to go anywhere. I was making some shell scripts and I wanted them to have fancy headings, so I wrote a Python script to generate the headings....
**Jerod Santo:** I've never done that. I definitely knew about the execution of like a shell script from the command prompt, but I didn't know that whatever was selected in visual mode would go into that as an argument. That's pretty sweet.
**Julia Evans:** Yeah. And that's the joy of Vim - all of who use it... you always find out stuff you didn't know. \[laughs\]
**Jerod Santo:** Another joy of Vim is that it's extremely customizable and has inspired a rich plugin community. Some people really get into plugins.
**Drew Neil:** I install a lot of plugins, I'm not gonna lie.
**Jerod Santo:** How many?
**Drew Neil:** I don't know... 40 or 50, I think. Probably more.
**Jerod Santo:** Surely there you can whittle it down and give me some of your must-haves. What are your favorite plugins? What should people be checking out?
**Drew Neil:** Well, probably on everyone's list I think is [surround.vim](https://github.com/tpope/vim-surround) by Tim Pope. That feels so vim-ish that I kind of can't believe that it's not the default, core of Vim. It feels like that fits very nicely with the whole Vim grammar, and it adds a very useful set of opera...
Another one by Tim Pope that I use a lot is [Fugitive](https://github.com/tpope/vim-fugitive), which adds Git functionality... And I love the way that that just gets out of your way. It's there when you need it. If I wanna do a git-blame, I can pull up git-blame. I don't want to have git-blame being sort of echoed on t...
\[15:50\] Here's a really tiny one that I really enjoy using... It's called [Exchange](https://github.com/tommcdo/vim-exchange). You can kind of take two pieces of code and just swap them. I find that really, really useful. It's something I really miss when I don't have it. I really like sort of adding new vocabulary t...
There's a plugin by Kana Natsuno called [vim-textobj-user](https://github.com/kana/vim-textobj-user). That's kind of a meta plugin that's like a framework for adding more text objects. So if you go to the GitHub page for that, there's a page on the wiki where he links to lots of other custom text objects that people ha...
Also, in the space of adding vocabulary that fits into the grammar, I really miss having an operator for toggling comments. Again, that's something that's not really built into Vim. I've tended to use [Commentary](https://github.com/tpope/vim-commentary), which is, again, by Tim Pope, but there are others out there. I'...
**Jerod Santo:** But others like to keep it a little bit more out of the box...
**Suz Hinton:** I'm actually not a huge plugin user... And people do still get kind of pushy with me. I made the mistake of sharing my vimrc once on GitHub, and somebody pull-requested me adding a new plugin, and I was like "That's just so out of context, really weird, and very just jarring..."
**Jerod Santo:** I'm trying to think about a real-world equivalent of that... It's almost like you're at a restaurant and someone just walks up and puts some food on your plate, or something.
**Suz Hinton:** Yeah. It's like "You'd like this. You should try it. I really like it." \[laughs\] Exactly, exactly.
**Jerod Santo:** It's like "You have the croissants here... Let me put this croissant on your plate. Eat that."
**Suz Hinton:** It's a fantastic analogy. I love that.
**Jerod Santo:** \[laughs\] Such a weird thing to do...!
**Suz Hinton:** Yeah. I think people are disappointed that I don't use a lot of plugins, and they're trying to help. So I do use some basic plugins, and my plugins in my personal time vary greatly from the plugins I use for work... Which is actually a really interesting distinction. You know, at home I have some basic ...
And then what else do I have... A very small list. [Vim-airline](https://github.com/vim-airline/vim-airline)... And that's mostly just trying to give nice aesthetics to my code editor, so I'm excited to use it. And it's pretty functional as well. It just gives you a nice-looking status bar.
I use [gitgutter](https://github.com/airblade/vim-gitgutter). Gitgutter essentially does what it says on the tin - it gives you \[18:38\] things in the gutter, next to your line numbers...