Full Stack for Front End Engineers Exercise 6: Editing and Saving in Vim
This course has been updated! We now recommend you take the Full Stack for Front-End Engineers, v3 course.
Transcript from the "Exercise 6: Editing and Saving in Vim" Lesson
>> Jem Young: So, I'm Harem Jem, because we will absolutely, absolutely use it later. So go ahead and type this out, I know it's pain, it's pedantic, but you learn things by doing them, and this is coming from me, years of experience, trying to learn VIM, but I'm always looking at the same commands.
[00:00:17] So just go ahead and type this out in VIM, I want everybody to get used to just typing in something that is not user friendly whatsoever. It's really not. There are some questions. Craig asked, are we gonna go over how to change some of the default settings in VIM like indent spacing, color scheme etc.?
[00:00:34] No, we will not. You can look that up and customize as you'd like but this class all you really need to know is how to write a file, how to save a file, undo, redo, find. Those are just the absolute basic things we need to get stuff done.
[00:00:50] But, again, this is a tool that you could spend years learning and perfecting. And I encourage you, if you say this is fantastic, go ahead and do that. If you only wanna learn just the basics, do that too, either way. Whatever it takes to get stuff done, so that's what I say.
[00:01:07] And someone asked when I right-quit, how to access a file, and oop, thanks, Amir. Yes, if you wanna open that file you've just written in the command line is the i.file and it's gonna open it right back up. All right, if you're trying to open your file again, we're just going to vi someotherfile.
[00:01:28] And I'm gonna say Hello! And then escape, right quit. And if I wanna look at all these files, I can say ls. But this is in my SH folder, it's not really that relevant. Actually, let me just make
>> Jem Young: CD, clear, so make a temp directory, oops,
>> Jem Young: So, somefile, search,
>> Jem Young: Hi. Escape, right quit. LS will show you that you have some file. Again, because VIM doesn't necessarily save in any sort of file format there is not .txt dot anything, it's just some file. Just wanna open that back up. Just vi somefile and we're back in that file.
[00:02:29] Nothing to it. Is everybody caught up? We are all good? We've solved all our issues? Everybody can write and save a file? That's really all you need to know, how to write and save and insert and find. And undo, redo. Okay, looks like we're all good. Skip. Random useful tips in case everybody didn't know, if you tab completion in most terminals.
[00:02:59] So if I type S, I hit tab, it's gonna finish that file for me. This is, it's so useful on any command line. I probably should have. This is a top tip, it's not important but it's extremely helpful. So if I wanna say, slash FC. If I double tab, it'll tell me everything in the folder.
[00:03:20] Not relevant to the class, just It'll help you later, it'll help you be faster. All right, so we are VIM pros, or VIM comfortable at least.