 I've always been a big user of them, but over the last few weeks I've gone through and transitioned all of my writing professionally into them, and it's been a very rewarding experience. I've learned even more about them. I've learned about several new things to do in order to make them very good for writing, and it's just been a very, very good experience. I'm actually kind of surprised how good it's been. One of the tools that I've been using to make this thing better is Pandoc, and I'll be making a video about that pretty soon, but today what I want to talk about is one of the things that I've discovered that makes Svim really cool. Now, one of the things that the terminal is kind of missing that a GUI application would have is tabs. Now, if you use a GUI text editor like Cate or VS Code, something like that, it has tabs built in, and I was very envious of this. I was like, it'd be really cool to be able to have multiple documents open at the same time without having to use splits, which can be kind of a pain in the butt to manage. So I Googled it, and I found that Vim actually has tabs built in it. You can use Vim tabs. So today I'm going to show you how to use tabs in Vim, so let's go ahead and jump in. Okay, so here we are in a terminal, and what we're going to do is open up some files in tabs. So there's multiple ways you can do this, and I'm going to show you several of them. But the first way I'm going to show you is how to do this outside of Vim itself. So you can go ahead and do what I'm about to do here if you want to say open up three files. So in this directory, we have three test files, and if I wanted to open them all up at the same time, each in their own tab, I would do this. I do end Vim. I'm going to be using end Vim. It should work the same in Vim, and then give it the P flag so that it lets Vim know that you're going to want to open these files up in tabs, each buffer open up in its own tab, and then just the file names that you want to open up. So test one, test two, and test three, and then enter. And now we have three test files open up in tabs, and you can see the tabs up here at the top. Now by default, there are no key bindings to switch between the tabs as far as I'm aware. So you don't have to add this to your MRC in order for it to work, but instead what you'd have to do is do colon tab n, which go to the next tab, and now you can see we're in now test two, and then if you do tab n again, that'd go to test three. If you want to go to the previous tab, you go colon tab P, and then you can do that again, tab P. So if we wanted to go through and go to tab three from tab one, we could go do colon tab n three, and that'd take us to the third tab. Same thing with two, if we wanted to go to the second tab, colon tab n two, and that'd take us backwards to two. Now that's how you navigate with this without key bindings. I'm going to show you some key bindings here in just a minute, but let's just say we wanted to have a new tab. So a new tab is spawned by doing tab new, and that opens up a new tab, and then you could go through and do open up whatever you wanted to open up. Let's just say we wanted to open up my bookmarks file. Let's just say we could do that. This is just an exported bookmarks file from Firefox, whatever. It doesn't matter, and then you just do tab new n to navigate to the next tab. So that is how, by default, you can control tabs, open up new tabs. Now let's just say you wanted to close a tab like this. Let's just go to colon tab n three. The point is, let's just say we wanted to close a tab. We go to tab c, closes the tab, and that makes it go away completely. Now remember, if you wanted to save something there, you'd have to have saved it first, otherwise it just goes away. Then doesn't save things automatically unless you're with in wiki. So that is how you close a tab. Now let's just say you don't want to go through and have to deal with the whole tab n, tab c, tab new, whatever. You don't want to have to do any of that. You want to go through and use key bindings. You can do that with these key bindings here. Now this is just very simple. So in normal mode, it remaps control l and then h to tab r, which is going to navigate from where you are in your buffer to the tab to the right. And then it's the same thing for the next one. Control l, l will navigate from where you are to the tab to the left. Tab p, which I've shown you before, will take you to the tab that you were in previously. And that's control l and then j. Now you can set up whatever key bindings you want. I have these set up as chords, but I have the next few as just regular buttons. So I have control n mapped to the next tabs command. So if I have a tab here, I can go control n and it would navigate between the tabs. If I have had several tabs open, it would just keep navigating between the tabs as you see there. So the same thing with control t, I have that set up to open up new tabs and you can have as many tabs as you want. As far as I know, there's no limit and then you can open up files using the traditional way of doing it. So if you wanted to do just open up a document, you could do colon e or you could use something like like a nerd tree, which is what I'm using, or you could use the built in file manager, whatever you want. Now the last one that I have mapped is tab c, which is control x. So we'll go to the next tab here and close it. So that's control x, control x, you can see they're going away and they're being closed and then we're back to the one buffer. So that is how you do tabs in Vim. It's really, really simple. Now you can find my Neo Vim config in my GitLab if you want to use mine or you can set yours up exactly the same way. I will also link to a little tutorial that shows you exactly how to do this if you want all that stuff kind of written down. It's very simple. There's not a lot to it. There are a few other tab commands that you can learn, but I've never used them and they seem to be mostly superfluous and more used for specific use cases that I just haven't experienced. So but these are the main ones that you need, you need to know how to open up a new one. You need to know how to navigate through tabs and you need to learn how to close them. That's how you, all you really need to know in order to use tabs. And it's cool. Now, one of the things that I really wish Vim had was the ability to have splits have their own tabs. So let's just say I'm in this here and I open up a vertical split. And all this is the two files, this is the same file open side by side. It doesn't really matter what files I had open, but I would love to be able to hit control T and have instead of opening up a new buffer, which is what this does instead have the tab go for whatever split you had active, have that have its own tabs. You could have this file, they open all the time. And then both of them have your own have its own tabs. That'd be really cool. But as far as I'm aware, Vim doesn't have that functionality, or at least I haven't been able to find it. Now granted, I haven't searched that hard, but I would really kind of like that. Weird, the transition that I've gone through over the last year, because I used to be the kind of guy who hated having like 100 tabs open in my browser. I couldn't stand it. If I had more than five or six, I was freaking out. I was always very much close the tab when you're done using it. That's the way I was, you know, the way of always kind of been. But since I've switched away from Firefox, where I know, because now I no longer have that like one bar, like user Chrome.css thing where the space for tabs is really kind of constrained. Now that I'm just on a regular chromium based browser, I've been leaving a lot of tabs open like a lot of tabs. And now that I've done that, I've kind of transitioned to leaving tabs open and everything. So like I use crusader, I have like 30 tabs open, it's nuts. And I've gotten to the point now where I'm using them to do all my writing. And I've been keeping all my documents open, like until they're like completely done and I no longer absolutely need them. So sometimes I have like 15 tabs open at a time in Vim. It's insane. So it's weird this transition that I've gone through. But I found that I really like that workflow. It does get confusing every once in a while. But the fact that I kind of I have it all open in front of me so I can, you know, switch back and forth between whatever I'm doing is really cool. So that is it for this video. If you have questions, you can leave those in the comment section below. You can follow me on Twitter at the Linuxcast. You can support me on Patreon at patreon.com slash Linuxcast. Before I go, I would like to take a moment to thank my current patrons. Sidi, Devon, East Coast Web, Petrico, Primus, Marcus, Maglin, Jacksnape, Tool, Steve, A, Saber, Gay, Linux, Garrick, Mitchell, Arch, Center, Carbon, Dated, Sean, Jeremy, Odin, Merrick, Camp, Joshua, Lee, J-Dog, Peter, Ray, Crucible and Dark Bandit 6. Thanks everybody for watching. I'll see you next time.