 Today, we're going to be playing with Vim, my personal favorite text editor, especially when it comes to scripting, and we're going to look over the feature of it, being able to split the screen and open up multiple files. Now, obviously, in the past, we've gone over split-in screens with things like Tmux, I think it was called, Screen and the terminal emulator, which I'm using right now, called Terminator X. But Vim has its own capability of split-in screens, which is useful if you don't have the other things available. It's also useful because if you're going to be working with multiple files while programming, to have them all open up in the same editor can be very useful. So let's start off. I have two text files in here just to start us off, 1.txt and 2.txt, and if I cut them both out, 1.txt says this is file 1, and 2.txt says this is file 2, just so we can distinguish between the two when we're splitting the screen. So I'm going to open up in Vim our first text file. And there it is. Now, I'm going to show you different ways of doing this. Now, anytime you're not in edit mode, you can type in certain commands for Vim by starting with the colon. So I'm going to type in colon. You can see at the bottom of my Vim screen down this way. I now have a little prompt going, and I'm going to type in sp. And that splits the screen. And in the second screen, it opens up the same file that I already had open, because I did not tell it to open a different file. Now I can also say colon. That's a vertical split. I can say, I'm sorry, that's a horizontal split. I can say V split to split it vertically. And now I have it split, and it splits based on where my cursor is. So as you can see right here, my cursor is flashing up here. And the way we can move around is you can hit Ctrl W and then arrow key. So I just move to the right and Ctrl W and down arrow. And I'm down here now, Ctrl W, I can move back up. You can also hit Ctrl W and then tap W a second time, and it just goes to the next window. So you can go through windows that way as well. So we horizontally and vertically split the screen. We can do the same thing and open up a new file when we do it. So I'm going to type in colon. And this time I'm going to say V split, and we'll say 2.txt. And it opens up file 2 right here, and it split the screen that way. We can do the same thing, colon sp2.txt, and it split it the other way. And you can see it all opened up file 2. We should also be able to say, and I actually haven't tried this because I just started splitting screens with them recently, I'm going to say sp to split the screen. And I am going to type in 3.txt, which does not exist. And yes, it creates a new file for us right here. The toolbar for each one's at the bottom, so you can see this is 3.txt, and it's blank. So you can create new files that way. We can also hit Ctrl W s, and it splits the screen once again. So that's a shortcut, so you don't have to type in sp. I do not know of a shortcut to split it vertically. So if you hit Ctrl W s, it splits it horizontally, and it opens up. There's doing that obviously, it doesn't tell it what file to open up, so it just opens up the file you're already editing, which can be changed later on. So that is a shortcut. Once again, I don't know a shortcut for vertically. If you do, go ahead and comment below. Now we've got a lot of windows open up here, split screens open up here. If we Ctrl W q, it closes the current window we are in. So example, we are right here, text file 3, Ctrl W q, okay, Ctrl W q. I don't know why it didn't work the first time. Ctrl W q, sometimes it gets a little, I hit W instead of q, so it wants the next window. Ctrl W q, hmm, oh it seems like maybe if you try to, it's working now. I don't know, maybe I was hitting the wrong keys. That is a weird key combination, Ctrl W, and then over to q. I tend to hit the W a lot instead of the q, which moves us to the next window as I went over earlier. So that's pretty much it for this tutorial. I just thought it'd be a nice thing to show you. I'll quickly review. I can hit Ctrl W s and split the screen horizontally. I don't know a shortcut key for opening it vertically. We can type in the command, so colon when we're not in edit mode, and we can say sp for split or v split to split it vertically. Once again, you can do the same thing, so sp and give it a file name such as 3.txt, which will create that file if it does not exist. If it does exist, it will open it up and Ctrl W w moves to the next window, Ctrl W and an arrow in whatever direction will move you in that direction, and Ctrl W q closes the window you are currently in. So that's Vim and splitting screens and the navigation for that. I thank you for watching. If you are a Vim fan, I hope this helped you out. If you're not sorry, I know everyone's got a different taste in text editors, and that's a personal opinion. That's fine. I do ask that you visit my site, filmsbychrist.com. That's Chris at the K. There'll be a link in the description. If you enjoy my tutorials, I ask you to go over there and help support the site. There is a donate button. Also to keep up to date on stuff, you may also want to check me out on Facebook. There should be a link to that in the description as well. I post not only my videos there, but I try to post news updates on Linux and open source in general. So it's just a way to keep up to date on stuff. So when I post new pictures or photos and stuff, usually open source or computer related at my site, I'll post them on Facebook as well. I'm also on Twitter. You can find that on my site down to the bottom left as it is right now. There should be a little feed for that. Also I've been working on my website a lot lately, redoing it, got rid of WordPress because it just ran like crap to put it nicely. I rewrote it pretty much from hand. I use a template, but all the scripts are mostly bash, a little bit of PHP here and there. I am also currently kind of putting some mobile aspects into it. So if you go to it and you click on photos and you're on a mobile phone, it will bring you to the mobile version of that so you can get through the photos a little bit easier. I might add other mobile features to the site in the near future. So I am working on stuff, trying to post videos. And I just thank you for watching and for your support. And I hope to see you around. Also check out our IRC channel. If you go to my site and click on help, it will bring you to our IRC channel. The more of us in there, the merrier because we can all help each other. Thanks for watching again and have a great day.