How to Learn Vim Quickly and Correctly [20210422163108]

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so here's a video about how to learn vim correctly uh there's a lot of opinions about what editor you should learn how you should learn it and all this stuff and i must have done at least 10 videos on bim at this point uh but i wanted to make one that's recently updated that shows how i believe you can practice learning them the right way uh as quickly as possible using real computers and real linux as opposed to any number of other pretend things that are out there i won't go into why i think using the actual tool is important it should be obvious uh so how do you do that well the first thing is everything i do on these streams on these videos is assuming you have docker installed so whether you've got linux installed already and you've got docker or you've installed docker on your windows machine or you've installed docker on your mac it doesn't matter this is everything that i do now is assuming you have docker because if you don't have docker you are missing out on one of the most powerful opportunities for development and this is one of these these side effects of this benefit of from having docker already on your system so assuming you install docker this is all you have to do to set yourself up to practice using vim so you can run docker run and you can run any any computer that you want to if you want to do arch you can uh and we're gonna do it to keep it so it's an interactive prompt uh and then we're gonna run whatever operating system you want so if you want a true vi experience which i suggest you might want to try at some point you might want to try busybox but we're not quite ready for that yet but what's if you want to get a standard vim uh then i would suggest using debian uh or uh ubuntu or uh arch linux if you want they're all the same uh they have different package managers or fedora right so the operating system doesn't matter do you want to pick your operating system of your you like the package manager that you like i'm going to use debian and and then just run it now all of these by default will we'll start up a shell so you don't have to worry about that and this downloaded the image which i already had there and it started up a a computer a container uh that is running as root which is fine you don't care why because it's a container uh if you want to use archimo you can use whatever you want and but so here's some of the problems right here you're going to go try to run vi it's going to be like i don't know where vi is and you're going to do vim is like it's been there no how about nano is that there no how about emacs is that there no so one of the reasons i like to use containers for this stuff is because it gives you practice and how to install every time you do it now you're obviously not gonna have to do this every time uh but this is what you need to do so anytime so if you're using an app system uh you're gonna say apt uh install i'm sorry apt upgrade and this is uh date update and so after you do the app update if that succeeds then do the next thing it's called short circuit logic app update and apt install uh now this is different if you're on fedora arch linux obviously or suzy or whatever uh app install uh vim and that will get you everything for vim so it said you want to continue yes so if you install the standard bim packages they all include a program called them tutor and you can run vim tutor right there and you can do vim tutor immediately okay vim tutor is uh it's dated it's it's it was written by a bunch of college kids it didn't really know how to use the invent it's got a lot of problems uh i plan on replacing vim tutor with an image so that you'll be able to do uh stay tuned it's not not right now but eventually you'll be able to do uh docker run artifacts rob slash vim lab and it will take you through all the different things you can do with them including a command line magic iteration that is not covered anywhere else so that's coming but if you want to just use all the standard stuff that's already there without my custom container you can go here and follow the steps and do what it says you don't need to worry about messing your system up or anything because you're on a system that's been developed for you don't need to worry about adding a new user and not doing it as root at some point you want to do that but for right now you really don't care you just want to learn vim and this thing's going to get thrown away immediately afterwards anyway uh and if you if you don't want it to be this one isn't sorry if you and then when you want to come back to it so let's when you're like if you're in the middle of the session right you already know about all these things about docker but the easiest way and this is going to be hard for you to remember but if you do control pq that will detach from from control pq will detach from your running container and you'll see that it's still there happy as a clamp it's like running here we didn't give it a name so just remember note the name there's dreamy herman and if you want to go back to it you can just do darker attach uh dreamy herman or this or whatever and you can go back in there and you can pick up right where you left off in fact you could even be in the middle of editing a file uh them tutor and it will remember so if you do control a whoops sorry and you might have to get crazy here yeah so it went ahead and and it it escaped you it didn't clear you didn't clear your screen up so clear your screen but if you if you want to go back to it again you can use what i said before uh attach again and it's right where he left off still there still running there in the background so that's the beauty of docker you can come back to work on any time you want you can you can do this entire vmtutor thing in the car you don't have to be logged into some remote system all those advantages will go if if however uh you want the reason i'm going to make my own container for this and don't have it yet i'll do another video when i do but is is there is a site that i have have summarized the absolute bare essentials you need to know it's called vi survive and and what this is is just a drop dead simple introduction to them that assumes that you're using the arrow keys when you first start out and there's there's only one reason for that so you don't have to use nano or some other editor believe it or not vi is actually your bim when you use allow the arrow keys it's actually simpler to use than nano and i i just blows my mind that this was not considered when they made the decision to make now the default on so many systems which is not the truth in in the container world but um so this is all you need to learn this is something you can print this out and put it on your desk you know print it with an actual printer and put it like in your on a card uh that's it you just need to know how to exit of course uh but without saving and there's many many many other ways to do all these fancy things uh instead of escape you probably want to control left bracket uh things like that but but just to survive this is all you need and then when you need to take it up a notch you can do that and you can go uh that i i don't there's that's i i don't have a reliable link so i'm not gonna mention right now but vi survive will always be there so you can go to vi survive and you can learn to survive and um again the vi purists like yell at me and i would have yelled at me for doing that the arrows but the reason that i had the arrows is so for example i have say i was going to edit my bim rc uh i have i have blocked my ability to use arrows because i want to get good and not use zeros and there's lots of reasons for that but mostly you don't want to be going like this all the time all day you just want to like stay focused um if you want to get rid of those arrows by the way um uh here's the arrow keys and i'll go ahead and send this for fun to you you can add this to your vmrc if you're in you're probably a beginner so you don't need that going through your vmrc and customizing them is a different video right now you're just trying to get good enough so you can even edit anything so just stick with survive and pull the container down uh but for the rest of you if you would like um here is here is how to lock down your your arrow keys so if you're a more advanced user and you want to lock that down you can go you can go take care of that um so yeah uh it's gonna be really this one syntax there oh i have a syntax error apparently oh i feel so bad um this looks like my eek still's got a problem anyway so this has been a video about how to get going with vi uh there are lots of other things out there i've decided to not even mention any of them uh the most the best possible way for you to use them is to use them so do it you know oh it's a stop container let's go start it back up stop this is not nobody needs panic here uh and now we can reattach dreamy herman uh suicide vim uh what nukes assistant when you touch arrow keys uh blocking uh blocking your keys yeah if you wanna if you wanna block those arrow keys uh if you wanna block the arrow keys you can go um you can go look at my mrc so that's all in my dot files uh you can go read through there look for the stuff that has vim in it you know cycling by mrc uh when you do lose when you learn vim stick with there's a couple of the complaints as you go through and i'm going to tell you i'm going to improve this is why i'm going to make my own container i've long been uh frustrated by the fact that vim tutor teaches you vim isms that don't work that don't work in vi which vi is the editor that came before vim and that's not a problem normally unless you get on a tiny little container like busybox that only comes with vi it doesn't come with them or you get on you know bsd a system that doesn't come with them it comes with bi and that can can trip you up you know things like you that you think are fine or that are taught in the vim tutor are wrong and they won't work now that's fine if you've got them but but i don't i don't think you should become dependent on them until you've learned the other way first and then if you want to do that that's fine but you know you at least know that you're making a choice to use something that you can't use on another computer as opposed to not knowing and being surprised and when it's a very you know inopportune time and you're like stuck and you can't edit anything so so i am making uh two containers that train you and how to use just vi and by the way if you want to do that there is no tutor for it uh there is no high school point there there there is no uh tutoring for it uh the jq many of them exclusive no it's not no and by the way if you want to know if oh the joy and the capital joy if you if you want to know how to do uh uh what i want to say um uh please okay block the use of the arrow keys main learning we have so much easier uh oh hopefully yeah that will help you um so one of the things that i was going to tell you um how can i quickly jump to the end of the line and edit mode in vim uh there's lots of ways my favorite is capital a because i'm usually adding something to the end of the line so you know uh attempt foo and so usually i want to add something to the line i'm capital a is my favorite you'll notice down here i'm doing a lot of control left bracket that's because control that bracket is what is easier for me to hit than escape i do have my caps lock mapped to escape which i'll do in another video i don't i used to be against that i think that's totally fine now but yeah so control a is the best if you if you just want to go to the end it's a dollar sign but that doesn't it doesn't just doesn't insert anything by the way some of these things that i just told you are not covered in the bim tutor so start with the vim tutor don't be frustrated know that stuff's going to come in addition to it and i um and i'll get you guys a container that teaches you uh everything about them slowly if if you are a purist and you do not want to learn anything except for vi there is no tutor for vi i mean and then you might want to do something different you might want to try a container so let's make a new container so docker run it i'm going to run you can either run a busybox container okay which which comes with uh busybox comes with only vi so there is no vi there's there's vi and that's it uh and there's no vim tutor so vim via there's no vim tutors no tutor at all so if you wanna if you wanna edit files which by the way uh this is when i realized that uh that arrow keys are actually supported by vi now they weren't before uh but they are they're supported by you so you still need to disable them if you want to do that uh all of that i'll put in the in the in the tutor container at some point so stay tuned on that but if you want to learn that you can do that another way to test without getting a container at all is to install uh so let's do another one um let's run uh uh i don't know let's see uh run it let's do um i don't know let's do www diving in again well dude they've been uh and this time let's give it a name we'll call it um nvi and whoops did i do it wrong oh i always forget i think this has to go first right uh w yeah there we go so so now we have to do this app install apt update and apps install nvi so nvi is is another pure vi this is the vi that comes on bsd unix uh if you know about that and and it uh it's got lots of it's it's bug for bug exactly compatible with the original vi uh so temp blah or whatever but again there's no so this one this i mean this is how i desire this i use nvi all the time not neovim by the way i i cannot stress enough not to start with neobim if you want to use the ofm later on fine just i hate it but don't use it first okay neom can really mess you up because it's got a lot of stuff in it that it's not supported across the board so um you know just in that uh so this is this is nvi i don't think nvi puts uh because there isn't it's not it's not vi tutor there's no such thing as vi tutor which is why i need to make one because there isn't one it's kind of annoying there's nothing to train you in vi and then you know in kind of a multi-staged way teach you layer of you know do an overlay of vim skills on top of that and then do an overlay uh man vi is the tutor uh there's not even man on here i think i have to sell the docs uh is that bad if i haven't started with vi no i think it's fine most people do that skill point um people start out with mim because that's what's on the system uh i'm just gonna i'm just gonna argue that that i believe there's a better way to learn i think you should learn vi first and then layer on them on top of that and then that way if you encounter a a v uh system as orchenheimer called it when you first encountered it uh i love zorchenheimer's one of my favorite streamers and he was forced to use vi at work and there are some phenomenally awesome streams of him having used them his old life and never knowing that it was even a vi he called it v and and he was he did not know what to do it was kind of fun to watch because he did not know v he didn't know vi he only learned vim and and it was uh it was it was really funny so so for that reason uh i'd suggest learning uh vi first but there's nothing out there but stay tuned i'll get you guys a container that does that that's one of the most important skills to learn hands down if not the most important skill is how to use the vi editor on any system because it's most likely going to be the editor on the system besides ed and we could have a fun talk about that
Info
Channel: rwxrob
Views: 1,946
Rating: 4.5692306 out of 5
Keywords: games, twitch
Id: TWca-7q94SU
Channel Id: undefined
Length: 16min 38sec (998 seconds)
Published: Fri Apr 23 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.