Transcript from the "VIM Overview & Modes" Lesson
[00:00:00]
>> Jem Young: Let's talk about VIM.
>> Jem Young: VIM stands for Vi Improved, it's one of those meta-definitions kind of like PHP.
>> Jem Young: What does PHP stand for, anybody?
>> Jem Young: It's like one of these nerd jerks. PHP stands for PHP Hypertext Preprocessor, it's a self-referential definition, just like Vi Improved, VIM.
[00:00:28] But what it is, it's text editor? VI is powerful because it's on almost every server. So if you wanna edit a file, you have to do that somehow. Again, these are things that when I was starting off I took for granted. Of course, I can just open it in my VS Code or sublime or a web storm or whatever IT are using.
[00:00:50] Servers will have any of that, you can probably install it but if you have 1,000 servers, it's probably be a hassle. VI is gonna be on every server you have, so it's a good thing to use to edit files which primarily it's always use it engineers, we just edit files, we create new files we edit them then we run them.
[00:01:08]
>> Jem Young: So, to start VI, well, actually enforce our VI you should know about the modes and this seems really intimidating at first but it will make sense when we start using it. It has insert mode and that's for editing text. It has command mode. That's for doing things like copy, paste, find, things like that.
[00:01:25] It has last line mode for searching, saving, exiting, other things like that. It seems really confusing that there is three modes. But, when you think about what a GUI does, it actually has multiple modes as well. You just don't notice it cuz it's all in one single interface.
[00:01:42] The great thing about VI is you can't use a mouse. It forces you to not use a mouse. I mean, I'm sure there's plugins that let you use a mouse. But, if you're really good at VI, you're gonna be much faster than someone with a mouse and keyboard.
[00:01:55] Because a mouse, you don't think about it but you're typing, and then you wanna do something, you move your mouse and you click and you save and you drag and search and right click. VIM, you don't do any of that, it's all in the keyboard. So you just switch.
[00:02:06] And so now it's really, really fast at VI is gonna be really, really fast, the problem is to get good at them, it takes years. I know someone that did it and it took them at least a year and a half to become like to a level that they're like, I'm comfortable with it.
[00:02:22] But now when I see him, he's flying around.
>> Jem Young: Not for me, I still use VS Code. [LAUGH] I am not that nerd level. But, we're gonna learn VIM today because that's the text editor. We're gonna be use the editing files on the server.
>> Jem Young: And to gets those modes, insert mode is gonna be i, command mode you use ESC, and last line mode is just the colon.
[00:02:43]
>> Jem Young: How to quit VIM? This is one of the most popular questions on stack overflow because it's easy to get into them. And everything you know won't work, so Ctrl+C, Ctrl+D, any ESC multiple times won't work. So, if you're ever stuck ESC :q!, bang with the also known as the exclamation point.
[00:03:05] The bang is just in case you wrote something and it'll force you to save it. It'll ask you if you wanna save, you'll get stuck the bang just means like quit, yes. [LAUGH] The pages means, guess I know what I'm doing, this is what I wanna do.
>> Jem Young: These are cheat seats, don't worry about memorizing them.
[00:03:23] Honestly, if I'm in VIM and I try to do something, I'd probably look it up too. But you'll get the basics down pretty quickly. Like yesterday, in saving a file, finding things, things like that. But feel free to reference back to this page. The copy/paste on the Wikia for VIM is pretty useful.
[00:03:38] But these slides are here is a reference. We're not gonna dive too deep into the specific commands because again, it's a really, really powerful text editor