 VIM is one of the most used applications on Linux and the vast majority of people know at least enough to open up VIM Do their edits and get out of them But there's so much more to VIM than just you know that bare minimum There's so much more you can do and you you've probably seen YouTube videos where VIM experts have gone through and just done amazing things with them and doing edits and a huge documents and Substituting things and using macros and all this high-end Wizardry and like wow I want to be able to do that and I'm one of those guys I want to be able to do that too, but I look at where I am now with them compared to why was like where I was like a year ago and It's night and day so I think VIM is very much one of those programs where over time you learn more and more and You you just kind of look back and realize well I really know quite a bit about VIM even if I'm still not one of those people who can do all that magic in terms of editing and stuff So what I'm going to do today is Give you 50 tips and tricks Give or take a few I've counted them a couple times But it turns out I can't count that high, but I'm pretty sure there are around 50 Tips or tricks that will help you be a better VIM user This is going to be quite a video and I'm going to go through them fairly quickly So let's go ahead and jump in but before I do hit that like and subscribe button if you haven't already I really do appreciate it everybody who's already subscribed to the channel. I appreciate everybody. We've just gone over 4200 Subscribers and you're all awesome. So be awesome and hit the red subscribe button if you want to see more content like this So now let's go ahead and jump in. I'm really really bad at those call outs. That's why I don't do them very often but now Matt the video is going to be like three hours long if you don't stop, you know doing this Alright anyways So the first one on I want to show you is something that happens outside of them There are many ways to open up a document. There's the traditional way of VIM document name or whatever But let's say you wanted to open up a document to a certain line number Let's say for whatever reason you're constantly making changes to the same file and you know which line number you have to change It's easy to open up them to that line number. So if I do this do and VIM config These are my DWM configs by the way and you'll notice that I can't actually type today I can do this and then do plus say line 34. So this is this should open up My config.def.h file to line 34 now. It's possible that this doesn't work for me because if you have a setting in your VIM config file that Asks them to remember the position of the document after it's closed so that when you come back It opens up at the same spot what this will actually do was it will take that spot It was saved and add 34 lines to it. So that sometimes happens to me This will only work for me if I'm at the top of the document when I've closed it the last time I'm pretty sure I did that so it should work and in this case it didn't work I was apparently at the bottom of the the line So that's the reason why it didn't work for me But for you as long as you don't have that particular setting that I happen to have This will actually should open up the file to line 34 It seems to be a little bit finicky with some settings that you have in the VMRC file. I Should also note that I'm using end VIM these tips or tricks should work just fine whether you're using vanilla VIM or neovim So the next one I want to talk about is cursor positioning So let's just say I want to I'm looking at the screen and I want to change the position of the cursor I can actually go through and change the line number if I want to by going to this thing or I can do Something else like 10 J. I can jump 10 lines if I wanted to but let's just say I wanted to move the Position of the cursor on the screen. I don't necessarily want to go to the top of the document But I want to go to the top of the screen I can do that by hitting capital H and that will take me to the top of the screen If I wanted to say same at the top of the screen And I wanted to go to the middle of the screen I can hit capital M and that'll take me to the middle of the screen So the next one I want to talk about is the letter D and the letter D does a ton of different stuff Let me actually turn on screen key here So like I was saying the letter D just does a ton of stuff and as you can expect D pretty much stands for delete so if you're at the beginning of a line here and you want to delete the whole line DD will delete the whole line and That works for The same way you can do for a ton of other stuff So you don't have to be at the beginning of the line You can be in the middle of the line if you want let's just say we're down here And we want to do DD here that deletes the whole line It probably happened quicker than you can see but it deleted the whole line now let's just say You want to just to delete this word DW deletes the word But it will only work if you're at the beginning of the word So if I'm at the in the middle it'll delete from the cursor to the right It won't delete the whole word. So DW for delete word will only go through and delete the whole word if you're at the beginning of the word Otherwise it deletes from the cursor all the way to the end. Okay DL Will stand for delete letter this will delete the curve So whatever letter the cursor is on if you hit DL, it'll just delete that letter Okay, so that's the letter D There are a few other things you can do with D as well if you want to do say you want Let's just say I want to delete three lines So I could do three DD and it will delete three lines. I could do five DD five DD oops I can I have to actually you know do this right five DD and delete five lines now I can also do the same thing with words. So I'm gonna do five DW and I'll delete five words So that's really cool and really powerful if you want to go through and your editing stuff and you want to you know Do things really fast Similarly C is also very important. So let's just say I want to change this word here const underneath the cursor I could hit and get into the insert mode and you know delete it like that Like a you know a complete noob or I can just do change word and it will delete the word and go And put me into insert mode and then I can change the new word to whatever, you know, if I wanted to do that So that's change word the other things for That work would delete will also work with change. So if I wanted to change this letter I could do CL that will delete that letter and get me into Insert mode so I can just change that one letter. I can go through and do Five change word and delete five words and put me to insert mode So I can do that as well another really cool thing I have Some stuff here in parentheses. So I have ST here in parentheses If I wanted to change the stuff inside the parentheses the words inside the parentheses I'm gonna do change inside parentheses and I'll delete everything inside the parentheses This also works with so if I undo this and I can do I go back to the beginning Here I can do change inside Curly brackets braces or whatever hell you call them. It'll delete everything everything inside the curly break brackets And that's really really useful. That means you don't have to go through and you know delete Everything manually, so we just go through and undo that now I will cover undo here in a while, but just needless to say you was undo Okay, so that is the letter C and like I said change inside of stuff will pretty much work with anything We'll work with single quotes quotes parentheses brackets square braces all that stuff change inside and then press that key And you will be able to change inside those things now I do believe if I'm in the center here and I do change inside scroll brackets actually that does work I thought maybe I just did from the cursor, but it actually does work just fine. Okay We're just getting started so strap in The next thing I want to talk about is quitting and saving your documents So everybody knows colon wq and colon q That's the way them tutor teaches you how to do it and there's nothing wrong with using them them tutor way It's perfectly legitimate to this day. I still use that very often However, there is another way to do it. So let's say I want to get out of this document I don't really want to save it just in case some of those changes I made earlier You know mess things up so I can do Capital Z capital Q and that will quit the document without saving now if I go back into this And I want to save it now. I do capital Z Z and that will save and exit So that is a really cool way of just getting out of a document whether you want to save it or not And it's easier at least one stroke easier than doing the colon wq thing. Okay, the next one that I want to talk about is going to a specific line number so in this document here I have a hundred and ninety five lines and Say I wanted to go to the line 100. I can do that by doing colon 100 and hit enter that'll take me to the 100 line. So that's really easy You can also jump a set number of lines by hitting Something specific. So let's say I wanted to jump 10 lines. I can do 10 J and they'll take me down 10 lines Let's say I wanted to go up five lines. So we do 5k and they'll take me up five lines Just on the same note. This will also work in visual mode. So if you're in visual mode So let's just say you're in this visual mode here and you want to jump down 10 lines You could do 10 J and they'll highlight 10 lines. So you can use it in visual mode as well So the next one really only applies for your VMRC now This is part of my end VIM configuration file It will look a little bit different than what your VMRC will look like but it's basically the same stuff It's the same syntax, but it let's say I wanted to know what the word I map means in terms of them I pretty much know what that means. I'm mapping something for insert mode But let's say I didn't know that if I hit capital K, they'll bring up the help page or the man page for them and it'll give me a little bit of Information about what that means and you can do this for any key binding inside them It'll take you to the documentation for that specific command inside VIM. So that's really cool Everyone knows that I is insert mode if you even if you just know the basics of them I is always insert mode, but insert mode with the lowercase i works in a certain way So if you hit i and you have the cursor here on the O in in in this particular document I hit i it's going to put the Insert mode before the O before where the cursor just was it's always going to do that It's always going to work that way now. Let's say I wanted to put it after though So if you just use if all the time like I seem to always constantly do I'd have to go into insert mode and then move the cursor You know manually like a like a a neanderthal What you can do instead is use lowercase a and that will take your Cursor and put it after the cursor where the cursor was just a moment ago So that means you can just continue on from there Capital versions of those letters do two different things so capital I will put you into insert mode at the beginning of the line You're on and capital a will put you into insert mode at the end of the line you're on So now let's go ahead through and talk about pasting and copying now Copying and pasting in VIM is a little bit weird because it doesn't copy the stuff that you copy To your system clipboard unless you have it set up to do so I do have it set up to do so but not everybody does and I believe by default It's doesn't work that way. So when I'm talking about copying pasting or in this case yanking and pasting I'm really talking about words and stuff inside of them only it's not going to take that stuff and put it into a General system-wide clipboard for you to use. I just wanted to put that out there So let's say I wanted to to yank this line and by yank I mean copy. So if I just hit yy I've now copied that line and if I hit P. I've now pasted that line Exactly what was in the the copy buffer. So we can see this probably more Explicitly if I do something that has something with some space around us if I yank this line here and Go into insert mode and then paste this we can see now That's how it's pasted. So I did yy and it yanked the line and I did P and it pasted the line So if we do DD that would delete those extra lines Okay, so That is why why now similar to D and C Yank will also do things with words and letters. So if I just wanted to yank this word I could do YW and that will just yank that word if I just wanted to do just that letter I could do YL and Then do P and it just did that letter. So that's how yanking works and that's how pasting works The next one is a little bit more convoluted in expert mode we'll probably go back to some of the more beginner stuff later on but This stuff isn't really all that organized. I probably should have organized it a little bit better But this next one is like I said a little bit more expert mode. Let's say I wanted to replace the word Static with something different throughout the entire document. I can do that easily. So I do colon Percent sign S and basically what this tells Vim is we're going to be doing a substitution Okay, and then we give it the word that we want to substitute So in this case, we want to do static and you can see I have it set up so it actually Highlights static as I went along. So then I do another slash and I give it the word That I want to replace it with so let's Whatever Okay, and then I do another slash and I do G now G Tell if if I just did it without the G that would just replace the line that I'm on Okay, if I do G it will do it for the whole document So if we do if we go back up here, why I jumped to the to the bottom By default it just does that you can see every word that was static now says whatever and we can just hit U to Undo that because obviously DWM is not going to build like that But that's how you do a global search and replace in Vim It's really quite easy and it's not something you'll probably remember you'll probably have to look it up if you're like me every single time but Once you've done it a few times it should kind of get you in there. So the next one is A tip for editing your Vim RC file. So let's just say I'm going to go to my end Vim file So I'm going to CD into .config and Vim and then General and then I Vim into general dot Vim Okay, and then we go back to the top here and let's just say I've gone through made a whole bunch of edits to my Vim RC file I've changed colors. I've had some key bindings or whatever Now if you're going to do this manually in order to get those changes to a take effect You have to save your current buffer or your current file and re-enter it, you know, like manually However, if you have it set up a certain way you can go through and do colon source In my case, I'd be doing init dot Vim Which is my main neovim config file But for most people you'll what you want to do is do colon slash dot Vim RC Now I would have to give the full length the full path to my init dot Vim But that was just an example. You run that if I do .config and Vim init dot Vim and hit that and what that's going to do is reload live Your Vim RC file so that the changes you've made take effect without actually you having to go through and close it Now the cool thing about this is that you can go through and set up a key binding so if I go through and into my key bindings Uh folder here and then vim into key bindings. I have a key binding For exactly this so what this does is allows me to hit leader s So in my case the leader keys the space keys so I can do space s And that'll go through and do the exact same thing I had to type out with so if you go through or editing your Vim RC a lot Put this in your key bindings and that will allow you to go through and source your Vim RC file without having to close it all the time Just remember you're going to have to change this path. So if you're using regular Vim, it's probably just going to be Vim RC instead of What I have here now I have a plugin called nerd tree which allows me to open up a file manager that looks like this And it's really cool But you don't need that let's just say you don't want to have to add a whole bunch of extra plugins You can actually use vim's built-in file manager by going colon capital e small x And that'll actually go through enter into a file picker for you So you can actually we can go up a level here and go to say General again and then general dot vim and that'll open up And that's how you can navigate through your file structure without closing vim Doing cd and all that kind of stuff you can just do it from a built-in file manager right inside vim The next thing I should teach you Is how to open up a file from within vim? So let's say you've been editing this and you want to open up a different file you can do colon e small case e And then the path to the file you want to open and this can be a relative path So if you're in the same directory you can just type in Whatever file you're in but if you're not in that you'll have to give an absolute pass So in this case we'll do dot config Uh and vim init dot vim and that will go through and that will open up init dot vim from where we were Okay, so the next one I want to talk about Is when that is going to be life changing for you probably if you don't know it and that is Let's just say you you have a structure like mine And you're using neo vim or even vim because vim will allow you to create a vmrc like this as well And your stuff is all over the place It's in separate files and directories and all that kind of stuff And you don't want to have to go to a file manager, but you have the path right in front of you For example right here. I have this path If I wanted to go to this path normally I'd either have to open up the net tree Or nerd tree I'd have to open up the ex file manager that I was doing or I'd have to close vm And get there manually through the command command line Or I can just hit this key binding gf And that will take you to The file that you were highlighting. So that is Gf and it's really really cool. I use it all the time. It's so good now Let's say you've Want to switch two characters around this one's a really easy one. Let's say I'm making a comment here And I've mixed these two characters up. So in c Plus plus the comments are always slash star and then star slash But I mix these things up all the time. So I might have done star slash And then you know did the comment and then did you know slash star? And it's wrong because the mixed up So if I'm back here in normal mode if I wanted to get these right without actually having to edit them I can just do xp and it will actually switch them around now It doesn't work perfectly in this case because it actually adds a space uh Actually it didn't work at all And I'm not sure So if we do xp again, there we go that it worked then okay, and then we can go here And do the same thing here xp and it will change it to the proper place So that's when you've made one minor mistake and you don't want to go through and delete things and all that stuff Just use lowercase x lowercase p and it will switch those two characters around Okay, so let's say you've been in a buffer for a while now when I say buffer I'm basically just meaning you're in a file. It's more complicated Basically you can have multiple buffers open at the same time Which means you have multiple files open at the same time that can be in a split. You can be in a tab Whatever So I use buffer and file basically interchangeably. They're not exactly the same thing but just Bear with me for that, you know with that But let's say you've been messing around in a file for a long time And you kind of need to retrace your steps somewhere along the line you've made a mistake in the last few steps and you need to Find that Now you could just scroll up or scroll back down or wherever you've been you could do that manually Or you could hit ctrl o If you hit ctrl o That will jump you back and forth between where you've been Over a certain point now that will take you backwards in your history If you do ctrl i that'll take you forward in your history And that's really cool. So if you've made a mistake a few minutes beforehand And you kind of remember where you were but not really you can just hit those keep one of the those key bindings And it will take you backwards to where you've been in the document using your history okay At this point in the video, which has been going on for a long time. We're uh, not even halfway through I probably should not have made this 50 probably should have done 25 but We're committed now pope folks. Let's just keep going. We're going to keep chugging along At this point, we're going to get into some really cool stuff So if you thought the stuff at the beginning of this was kind of basic But you kind of toughed it out and you're still with a video. I thank you You've are about to be rewarded because there's some good stuff coming. So Let's say you want to put the output of command Into your document without having to go to the command line and copy and paste and whatever Let's just say you want to do that. So let's go ahead and What so let's go ahead and open up a new document here Let's just say I wanted to go through and Paste in the output of my zshrc file. I could do that really easily by doing this. So from normal mode What you want to do is do r oops excuse me. You have to do colon r And then do exclamation point And then the command that you want to do in this case. I want to use the cat command And then I want to do the path to the file. So in this case my zsh file is in dot config Zsh dot zshrc All right, and then if I hit enter What you're going to see is it's going to output The It's going to going to give me the output of the cat command of zshrc Basically what cat does is it just reads that file and gives me the output of that file And in this case it pasted it directly into my brand new file that I just created and you can do this with anything you can do colon R exclamation point ls and this will give me the output of ls from the directory that i'm in outside of vim in this case i'm in One of my nvim configuration files. I think so if I go through i'm in my dwm Uh file so this gives me the output of ls from that certain directory So that is really cool if you want to go through and edit or add the output of any command it works with ls it works with cat grep awk all that kind of stuff and it will take the output of those commands and put it into your file So there are a few cool things you can do with double exclamation points. So from normal mode If you hit double exclamation points like this, you'll see down here at the bottom. It actually changes it to colon period exclamation point. Don't worry about that. You can always get to this by doing double Bang bang as we say it's double exclamation point and there are a few things you can do with this So the first thing if you do bang bang and then type in the word date What that will do is it'll paste in the current date and time. That's really cool. Uh, you can also go through And run the current line in the shell. So let's just say We have a command here. So in this case, we're going to do ls till the slash.config Slash zsh Let's say I wanted to run that command now For whatever reason you have this in a script or whatever. Maybe you have a cd or you have a Whatever command you're in that you have inside of a script and you want to run this without actually having to go through and run the whole script to see if it works or Maybe you just want to see what the output of it is you can actually run the whole thing the current line by doing bang bang and then sh And then enter and basically what that will do is it will will give you the Output of that particular command and just replaces that command with the output So in order to get everything that was in that file, I'd have to do this and then I can do bang bang bang sh and then enter and then it will give me everything that was in that directory It will run that exact command and it it will work with anything So let's say you have a list of something. So you have uh Let's just say you have A list of numbers and you want to sort them In this case, they're pretty much already sorted, but let's go ahead and make let's let's let's make a mess So they're not sorted. Okay. Let's say I want to sort these things I can do that by selecting them in visual mode. So just hit v and then go down So that they're all selected and then I can go through and do exclamation point sort And that will sort them A to z or you know ascending order. I believe is maybe that's descending order. I can never remember I always get all that stuff backwards It always happens. Anyways, uh, so that's that's one way to sort you can do the whole document that way If you have them, you know numbered or whatever or if you just have a certain amount of paragraphs that you want ordered by a to z You can do that Let's say you're in a file and you want to rename it And no longer pleases you that this file is named text dot txt I can go through and change that by going doing colon save and then the new name of the file So in this case, I want to name it matt dot txt And I can actually go through and show you that this worked By doing an ls here and I now have a matt dot txt here. Now, you know, it actually just copies it to this It doesn't move it just text dot txt is actually still there. That's not exactly how I expected that to work, but it Basically the same thing It's weird that it does work that way. Uh, but at least you've renamed it. Let's say we're in Matt dot txt And we want to open up Text dot txt in a split we can do that in two different ways now Split does exactly what it says it's going to do. It's going to split the screen into two different buffers So in this case, we can do sp text dot txt xt and now I'll actually give us a Split I didn't oh type the name right, but it'll give us a split of whatever file we opened up and we can just quit that by doing Uh, capital zq or we could kind of wrote it as well if we wanted to buy capital zz and We'll do this again with the actual name Text dot txt and we can now see that it opened it up in a this is a horizontal split now Let's say that's not pleasing for me. I want to do it in a vertical split so they're side by side instead I can do colon vs Vertical split and then text dot txt as well and that puts them side by side now the problem here comes in is there's Very weird Default ways of switching between these. I don't know what it is. It's something about control w and then the vim keys I believe that's what it is. I have a setup so I can just do control do control roll h and control j Control h and control l will actually switch between them Sometimes Anyways, that did work if you see the cursor up there it moved back and forth Okay, uh, but that you have to have that specifically set up in order for that to work So let's those are splits. Okay We're in the 30s. We've made it through the 30s So let's say we wanted to let's go ahead and close one of these splits here And let's say we wanted to move matte dot txt to a different Uh directory we can do that by doing okay, so I can do colon w And then the path to the document. So in this case, I want to do colon slash matte dot txt Then we can go to do that And now if we get out of this and go to our home directory and do an ls matte dot txt should be here somewhere Which it is right here. So so that is renaming or moving of directory to a different directory Moving a file to a different directory. I should say Okay The next one is A little bit about the global command. So let's go ahead and vim into our matte dot txt file there And we have all this stuff here Let's say I wanted to List all the contents with the word that So if I wanted to do that, I do colon jives for global and then type the word that And then do slash and I'll actually go through and find all the lines that contain that and then highlight them That's not really all that powerful. But what's great about this is if you wanted to do Any lines that create that and uh input so we at least know there's one line that has the words that and input in it We can do that and then backslash And then pipe and then do input And then do Forward slash and that will actually go through and highlight all the lines That have that one and there's only one right actually There is only that one line But you can see if you wanted to find all the the iterations of the line that have certain things in them So all of the lines are a variable of a certain name. For example, you could use a The global command in order to search for those if you wanted to so this is global search in this instance You can also go through and do this convoluted thing that i'm going to about to show you now I can't tell you how or why this works. Just i'm going to put this out there. I have no clue I don't know very many people who can actually tell you How or why this works so we're going to use the global command again We're going to do a slash and then we're going to do a carrot And then we're going to do a backslash and then s and then a glob, which is a asterisk And then the dollar sign And then we're going to do slash d now what this does Is it removes all blank lines? So if we do this it'll take out every single blank line from the document and just delete them So if i had to guess it's what it's going to do is searching for all those blank lines And then that d at the end is deleting them. So, okay, so Let's say we've done a search here for config So we know config Exists several times we've gone through and we've done some searching and we want to get rid of these highlights These highlights don't go away ever unless you tell them to go away So in order to tell them to go away you do colon No h and enter and they'll go away. You can also map this in your vmrc file or your key bindings rc file if you want to do that as well. So as you as you saw Searching is done through the slash. You can do slash config again And that will do the slash and enter and then you can navigate through these Forward with the n key Lowercase n and you can go backwards with the capital n Let's just say though you wanted to search for two words. So in this case we wanted to search for export and path So in this case we can do slash export And then the forward slash or maybe this is the backslash. Yeah, this is the backslash and then the plus symbol and then path If you can spell And this only actually appears twice so we can do next and next and next That's how you search for things to have a space in between them All right, let's say you don't want to actually go have to go through and type in The search term you want to do. So first, let's clear this other search noh Okay, and let's just say we want to search for the word path Okay, we can do that by hitting the star key So the asterisk key And that will just search for path throughout the entire document And you can go backwards with that same search by using the pound sign and that'll take you backwards In the document. So if we clear no, we're using noh and then we search for the word user We can actually do the pound sign and that will take us backwards It's only has one instance in this case Anyways, so if you had a whole bunch of those it would actually take you the other direction for that search term We're in the 40s. We're in the 40s. Well, we got 10 more to go Okay, so let's just say we've gone through And made some edits here. So Let's say we wanted at the end of every one of these we wanted to do dot txt Let's just say we want to do that. So if we go down here and hit the period key, it'll do the same thing now It's Not great because we use the little lowercase i so if we go here and hit lowercase a and dot dot txt And then we go down here and do the period again. It'll do it better. So we can go through and do this Cool, huh? So it all that does is the period just Redo's the last command on the line that you were on So that's just period. That's all it does. So let's just say you're a programmer. You're doing some scripting and you have some parentheses here and Let's put some stuff in the parentheses And then uh, let's see. We also have a couple curly brackets here We have some more stuff and we have some braces here And stuff like that. Now, let's say we're back in normal mode and we're at the beginning of the line And we want to jump to the corresponding bright closed parentheses we can do that By using the press percent sign. So if we hit percent sign, it'll jump the cursor to the corresponding closed parentheses or bracket. So if we're on this, uh, If I can actually get Let's say I'm on this curly bracket here And I wanted to jump to the other one just hit percent sign It will jump us to that other curly bracket. The next one is really easy I've been using it all throughout the video is undo So if I wanted to undo some of the stuff to hit you and I'll undo a whole bunch of stuff If I wanted to redo that stuff control r redos all that stuff moving right along So, okay, so Let's say we're going to make this a bash script after all this stuff. This is the ugliest looking bash script I've ever seen there's not a single command in here. They would actually run for bash. Well Actually, that's not true. There is an if statement here. They would actually work I forgot that I had the zshrc in here. So that would actually work in bash So let's just say I wanted to put a shebang in here. So if I wanted to go through and do that I could do colon. Let's see hash mark bang slash bin slash bash But I don't want to type that all out I can actually go through and have them auto complete that for me. So from insert mode hit control n And then we'll actually go through and try to auto complete it for you. So you can use bash So that's really cool Now it doesn't work all the time and I'll only work with certain things and Sometimes it gets a little bit iffy and whether or not you're in a certain directory or whatever But for the most part it will actually auto complete stuff. So if you type if you're here slash bi You can go through and do control and again And it'll actually completely auto complete that for you. There's no other option. So if we do slash and then again It's not going to do anything because it needs a little bit to work with so if we do just ba again and do control And it will actually go through and do that again So that's auto completion without without a plugin So a lot of people install plugin in order to get that kind of functionality them has that stuff built in It's just not as good as some of the plugins. So anyways, that's really cool Okay, so the next one is a little bit about visual mode. So there's two or three here. So if you do Smaller case v. Oops, we got to get actually get back into into normal mode If you do regular v This does this letter by letter as you can see what I'm just Highlighting this letter by letter then I can go through and Yankee I can delete it using the D key and do whatever I want to do letter by letter if I hit capital V This selects it line by line now. It looks exactly the same But as As we get to lines that are longer, you can see this is selecting it line by line now There is another visual mode that is really cool. So let's just say I wanted to delete the first lines Of the next 10 lines here, but I don't want to delete anything but that first letter So if I hit control V That'll actually allow me to Select this by columns So I can go through and delete. Let's say I wanted to delete all these things. You know, I could do that so that is One that the control v selects by paragraph and it works well When you want to delete the first few Columns of a line So say for example, or the last few columns aligned if they're all in line with each other You can go through and delete all the extensions of something for you know It would kind of the it would kind of work where up here where we added a whole bunch of dot txt So if we could control v and go down here, it's not going to do exactly because as you see they're not exactly lined up But if we hit d we'll delete some of the dot txt's Uh, it works better if they're all lined up. They're all exactly the same So that is visual mode, uh in a nutshell So the last one also has to do with visual mode and there's four of them here So if I if you remember way back at the beginning of this video, which it seems like this video has gone on forever, which it has We talked about how you could change things inside of other things So we talked about how if you have parentheses And you had a whole bunch of stuff here and then you did change inside parentheses You can do that But visual mode also has something similar So let's just say you wanted to select the stuff inside the parentheses So you could do vi parentheses and it would select everything inside the parentheses It does the same thing with uh parentheses Was that where I call those parentheses? I meant uh quotes quote quotation marks. Good lord matt Video's gone for talk. So change inside quotation marks all that kind And it works that it works with parentheses it works with both kinds of brackets It works with single quotes. You can just go through. So let's do a couple more examples So let's say we have a bracket here and we got some stuff here So if we do vi brackets, it will select everything inside the brackets if we have parentheses here and we got stuff inside the parentheses we do vi parentheses it will select everything in the inside the parentheses we can also go through And select a whole paragraph by doing something similar like this So if we uh go down here where we actually have some paragraph a paragraph And we do vi p and it'll actually it actually counts as all the paragraph, but let's just say We have uh, let's see here an actual paragraph With with a space in between we go back up here And do vi p it will select the whole paragraph. So holy Shit sacks people that was one hell of a video The unedited time of this video is over an hour. That is just Blowing my mind. I did not I wanted this to be under half an hour I don't know where it will be in terms of editing because there's a lot of stuff here that I can cut out, but good lord I shouldn't see when I was putting this stuff together when I was putting this stuff together I was shooting for a hundred tips and tricks. I am so glad I stopped at 50 I would have been here for days Wasting away out of thirst and everything. So anyways, that is it For this video if you stuck it all the way through first of all, you're a trooper because I pretty much didn't stick it all the way through I almost did and I almost stopped so many times So thank you for for sticking all the way through if you if you did hit the subscribe button because there's more of this overly elongated nonsense on the channel that you can be happy with If you have just hours and hours of free time You can follow me on twitter at the linux cast. You can support me on patreon and patreon.com slash linux cast Make sure you check out the debbie in long term review that I just did that was also a really long video But not nearly as long as this one it turns out You can definitely do that. You can check that out on the page at youtube.com slash linux cast Before I go I'd like to take a moment to thank my current patrons Devon chris east coast web gen 2 is fun too marcus maiglin sven jackson knife and tool josh will lee mitchell art center merrick camp mr Fox thanks everybody for watching I'll see you next time. I need a vacation