 I think anybody who has watched the channel for any amount of time knows that I'm a Vim fanboy. I prefer Vim to all other editors and I proclaim the benefits and merits and awesomeness of Vim to everyone who'll listen to me. Like literally I tell people who don't even at all care about text editors how great Vim is. I have a problem. But that's because Vim is truly amazing. It's really, really good. It's extensible. It's fast. It's just everything you want in a text editor. It doesn't have Tetris, but what can you do? But when it comes to writing there are definite drawbacks to actually using Vim. And a lot of this has to do with the functionality you would find in a word processor. Things that are built in dedicated to making writing easier. One of those things is autocorrect. Autocorrect has become a meme in internet land. We see how horrible autocorrect actually is every single day. If you use the Android or an iOS phone, autocorrect is horrible. Something that AI has generated to try to fix your misspellings. It's not that great. And some of the outputs of those things are generally hilarious. For the most part, while it's definitely nice that it's there and you wouldn't want it to go away, everyone knows that it's subpar, but it's still something that you want to have. So if you're in like a text editor like LibreOffice, autocorrect is something that is there. So if you misspell a commonly misspelled word, chances are LibreOffice will go ahead and correct that spelling. So for example, I always misspell the word the. I know I know how to spell the word the, but I'm typing so fast that I always misspell it like I put the letters in the wrong order. So it's always TEH. It happens all the time. Like literally every time I type the word, that's just the way it happens. I don't know why I've tried to train myself out of it. It's not it's like impossible. But because in a word processor, that's something apparently a lot of people do. You can have it set up so that it just autocorrects to the appropriate spelling of the word the. In Vim, it's not something that you can do out of the box. Well, that's not true. You can do it out of the box, but it's not set up for you out of the box. Like it doesn't have like a list of words that automatically corrects for you. You have to set it up and that's what we're going to talk about today. The functionality that I'm talking about is called abbreviations and it is awesome. Now, I know I've been talking about this from a writing perspective because that's the perspective that I look at them in. But if you're a developer or anything like that, this could be very useful for you as well. Because if you have certain things that you type a lot and you want to have a shorthand for that kind of thing and just have like auto expand. This would work for that as well. If you are always mistyping something in a certain programming language and you want to have it so that it autocorrects to what it's supposed to be. This would work as well for that. So this is not just for writers. This is for anyone who uses Vim. So let me show you how this works because it's astonishingly simple and you don't have to install plug-in, forward or anything. And it's really cool. So let's go ahead and move on over to my desktop here. And the way I have my nvim set up. Now this works in nvim, neovim or vim. So it doesn't really matter. So if you are in vim, your chances are you're going to be in your home directory and you'll do this instead of your vimrc file. And there's nothing wrong with that. This is the way vim works. For nvim, all the configuration for neovim takes place inside of .config slash nvim. And I have mine set up in a little bit different way. So mine is going to look a little bit different than yours, but the functionality is going to be the same. So if I vim into init.vim, which is the file that everyone who uses neovim will have. This is the equivalent of your vimrc file. So the same syntax and everything. And this is the way I have mine set up. All of my separate things are put in their own file and they're sourced from here. So basically it just means that it's going to put all that stuff here, but it's going to be in separate files. It means it's more organized, but that's kind of beside the point. The way you do this is you create a section in your vimrc file or your init.vim that looks like this. And this is the way you set up abbreviations on vim. So you start off with the trigger ab. So that just means abbreviation. And then the first argument after that is going to be the word that you either misspell or the thing that you want to type in for it to work. So in the case of the word the, I always mistype it teh, so I've put teh here. And then the next argument is the thing that you want it to be replaced with. So this would then automatically replace the misspelled word with the proper word. So let me do this teh and I hit space and see how it replaced it. So teh space and it replaced it. So I also have one for tlc, hit space and it's going to expand to the next cast. So this is useful for two things. So not only misspellings like teh, but also for text expansion. So if you've used Mac before, there's this application called text expander. And it's really awesome and it allows you to set up shortcuts for certain words. And then when it sees that shortcut, it will expand out into whatever you wanted to expand out to. So in this case, I did tlc, it expanded out into the Linux cast. Now I also have one for my name. So if I type in mw and hit space, it expands into my full name. That's really cool, right? So another awesome thing that you can do with this, if you're a coder or developer or whatever, you could set up things. So if you have things that you use all the time, you could set up a shortcut for that. So in this case, I'm always using the paragraph functionality and HTML. So I do comma p and then space and it gives me the paragraph tags for HTML. I'd still have to move my cursor back here. But the point is, is that you can do that. Now that's really cool, right? So if I wanted to create a new one, so I just do a B and then I'm going to say I misspell the word emerge. So I always, I've been messing around with gentoo. So I misspell the word emerge. I forget the R and let's just say I set up flat. So I type in the correct one here like so. And now, so if I save this and then source my MRC or in it dot them. Now, if I type in E M E G E and hit space, it'll correct it to the appropriate spelling. That's really cool, right? And that's literally all there is to it. You can probably see the benefits that this could bring you no matter what you use them for. So if you're a writer, you can create a whole bunch of abbreviations for words that you either spell all the time or words that you misspell all the time. So that you can have them automatically replaced with the correct spelling or just expanded to the appropriate words. And if you are a developer or whatever, you can set up things that you type in all the time so that they're automatically expanded for you. So like that paragraph tag set there, you could do that, but for literally anything. Or you could set up things like if you misspelled the word class all the time, whatever, you could set up the an abbreviation for that so that it would replace it with the appropriate word. That's literally all there is to it. That's amazing. And it's a functionality that I use all the time. These are not all my abbreviations. These are just the ones that I showed you. The one that I use all the time is actually the Tonki one. My boss's name is Tony, but for whatever reason, I always type Tonki whenever I type his name. And I don't know why. So I have it set up automatically to change that to Tony so that I don't send an email or something with the war on spelling in it because that'd be really embarrassing. But you can see here the benefits of the abbreviation functionality of them. And it's really quite cool and it's really simple. So if you are a Vim user, you would put this anywhere in your VMRC file. So just A, B, then the word that you want to type in to get to the result end. So like I said, T, E, H is that first positional argument and then the word that you want to replace it with. You don't have to anything that comes after that first word is going to be replaced once you hit space. So for example, when I was telling you about the TLC one like that, anything after that is going to be what's replaced. So you don't have to use quotation marks or anything like that. So it could be literally as long as you want it to be. So if you wanted to have like an address one, so address like this and then you type in your address, you know, 5500 West Main Street, Detroit, whatever. You know, you could just type that in and then whenever you typed in ADD, it would replace that whole thing. It doesn't matter how much you have after that. It would just use that first word to expand everything after it. So that is Vim's abbreviation functionality. I think it's amazing. It's literally one of the things that I rely on the most now because as I do my writing, I tend to misspell things. So if you've watched the channel for any amount of time, you know that I misspell things all the time. This here makes it so that I don't have a document full of misspellings. It's amazing. So if you have questions about this, you can leave those in the comment section below. I also want to shout out Jake Atlenex who showed me this in one of his videos. So you should definitely go check him out. I will link to his channel in the video description below as well. So if you want to follow me on Twitter, you can do so at the Linuxcast. If you want to follow me on Macedon or any other social media network, you can find those links in the video description below. You can support me on Patreon at patreon.com. Slash the Linuxcast. I'd like to thank my current patrons, Robert, Sid, Devon, Patrick, Fred, Kramer, TriDevil, Antoine, Unclebone, and KB, Gryff's Lounge, Megalyn, Jack Snipes and Jules, T-Vase, Abril and Xkeric, Samo, TGB, Keith, Andy, Gary, Ross, Mitchell, D-Dog, Carbon Data, Jeremy, Sean, Odin, Marnie, Eduardo, Artstern, Elliott, Mizzalov, Merrick, Camdash, Oli, Peterik, Crucials, Eric, 26, Primes, PM, Harlock, 1, and Phillip. Thanks everybody for watching. I'll see you next time.