Getting Started with Vim in Visual Studio Code

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

I was skeptical about Vim, but I was sold once I actually used it. For now in VSCode, I've set my capslock to emit ctrl alt shift, and I've set ctrl alt shift + h/j/k/l for movement, along with a few other Vimish shortcuts. So now i just hold capslock down and keep my fingers on the home keys when I need to move around code, and it's wonderful.

👍︎︎ 6 👤︎︎ u/nanocyte 📅︎︎ Oct 27 2020 🗫︎ replies

I, too, am a Vim + VS Code user, but I use the Neovim extension. HIGHLY recommend checking that one out instead of VSCodeVim as it much less buggy.

👍︎︎ 21 👤︎︎ u/Iceberg_Bart_Simpson 📅︎︎ Oct 27 2020 🗫︎ replies

Are people really sure keeping your hands at the exact same (home row) place for hours is ergonomically better than letting your hands move around?

👍︎︎ 8 👤︎︎ u/diamondketo 📅︎︎ Oct 28 2020 🗫︎ replies

After watching this video I confidently chose wrist pains :)

👍︎︎ 19 👤︎︎ u/jakubiszon 📅︎︎ Oct 27 2020 🗫︎ replies

OP, your examples of you using classical method is very poor. Shift+down for selecting is common yes but "power users" (i.e., those who care about this) would be for other combos (pgdn, pgup, ctrl+shift, home, end). The point is you're suspect to downplaying classical methods over vim.

PS: However, I love visual mode. I prefer having the option to turn that om over full vim.

👍︎︎ 3 👤︎︎ u/diamondketo 📅︎︎ Oct 28 2020 🗫︎ replies

You might also want to take a look at tab9 to reduce typing

👍︎︎ 2 👤︎︎ u/just_another_life 📅︎︎ Oct 28 2020 🗫︎ replies

Great video ! Thanks for sharing ;)

👍︎︎ 2 👤︎︎ u/brieucdlf 📅︎︎ Oct 28 2020 🗫︎ replies

Drake Meme:

Nah: "Improve ergonomic practices"

Ye: "Learn vim"

👍︎︎ 1 👤︎︎ u/diamondketo 📅︎︎ Oct 28 2020 🗫︎ replies

I need help. My laptop is so slow windows is booting like 2-4 minutes.Vs code also working slow. Can someone help me to make vs code faster? (SORRY FOR BAD ENGLISH

👍︎︎ 1 👤︎︎ u/catdog123321catdog 📅︎︎ Nov 01 2020 🗫︎ replies
Captions
what's going on everyone my name is suboptimal engineer and today i'm going to help you elevate your programming skills by getting you started with vim not vim the text editor but vim in visual studio code i'm going to be going over three specific things first is going to be why you need vim commands second is going to be the visual mode philosophy and third is going to be actually setting up your vs code with bim commands and before we get started i'm going to ask for one small favor from you guys which is to leave a like for the youtube algorithm it does take me a few hours to plan and edit these videos so a simple like really does help me and the channel out quite a bit alright with that out of the way let's jump right in so why do you need vim commands development speed is an obvious game you can do a lot more with a lot fewer keystrokes using vim commands as soon as you have a solution in your mind vim makes it a lot easier to interface with your text editor you'll be able to code a lot faster but that's not the real reason why you should be learning rim commands the real reason you need to learn vim commands is for ergonomics vim helps protect your hands and wrists from random pains and aches let's take these examples into consideration you might have to go up or down quite a bit in a file right if you want to scroll down either you scroll down with your mouse or you scroll down with the arrow keys up or down but both of those actions force you to move your hand away from your home row and if you do that enough it actually starts hurting your wrist especially if you do it really quickly say i want to go down to the select button really quickly right i'm going to move my hand from my home row i'm right now on the home row i'm going to move to my mouse and go here or with vim i could just press j a couple times and it'll take me there obviously it takes a similar amount of time so going from attach down to v select with j takes the same amount of time as if i were to use my mouse to do the same thing but the difference here is the amount of distance your hand moves your hand moves no distance at all if you're just going to press j you're just moving your finger because your finger is already on jkl semicolon so pressing j is a lot easier than going to your mouse same thing for the arrow keys again pressing j to go down is a lot faster than moving your wrist all the way to the arrow key to press down so in terms of ergonomics vim is really helpful let's take another example say you want to move this below this column how would you do that normally well you would probably be in insert mode and you'd press shift down down down down down down go all the way like this and then press like a command x and then do a command v that's a very slow process you're moving your hand way more than you need to now let's suppose you do this with vim you're going to press shift v to select the line press j you don't have to go down to the arrow keys press d to delete and it is stored in your register and then you just press p to print so the number of commands that you do might be very similar but here the main difference is that you're not moving your hand away from the home row vim allows you to do a lot of things without causing a lot of hand pains because you won't be moving to the arrow keys you won't be moving to your mouse as much as you need to it just allows you to interface with your code in a much smoother manner and that's why you need to use vim commands so now that you understand why you need to use room commands let's take a look at the visual mode philosophy so if you're doing anything that is not specifically writing code just switch to normal mode normal mode lets you traverse your files using vim commands and it's just a lot faster it's just a lot smoother you won't get a lot of issues with your hand moving all the way to the arrow keys or using your mouse to traverse your file rather than you know scrolling to your mouse and going all the way down you can just press shift g to go to the last line in the file or you can press gg to go to the top of the file there's a lot of vim commands that you can use so if you're ever not writing code just be in normal mode so now that you understand why you need vim and the visual mode philosophy let's get you set up with vim inside of vs code all you have to do is go to the extensions section inside of your sidebar you can do that by pressing command shift x that opens up all of your extensions and all you have to do is search for vim if you don't have it enabled it'll just give you a button to press install and you might have to close your vs code and reopen it otherwise you know it's pretty straightforward vim just starts working right out of the bat so once you have it enabled you're already 80 there the next step is to configure some commands to make it easier to work with him and there's really only two things you need to do the first is how to get into vim mode i just say that if i press kj while i'm in insert mode so right now i'm in insert mode if i press kj that is going to remap to pressing escape so when you first set up vim the only way you can enter vim mode is by pressing escape so now i'm in vim mode and if i press j or k i'll go up or down i like that remapped to kj because obviously i don't want to move my hand all the way to the escape button to enter vim mode so now if i just press kj really quickly it enters vim mode so that is the first really important thing to get set up and the next thing that i kind of found annoying but i had to dig around quite a bit to figure out was that tabs don't work in vim if you try to press tab it actually doesn't work if you're in visual mode and that is because the default tab setting the default tab setting says that if you are in read-only mode it doesn't work as you can see right over here tabs only work if you're not in editor read only but if you're in vim mode you're in read-only mode so if you want tabs to work you actually have to write these two commands down so if i save that save that now if i press tab while i'm in bim mode as you can see tab works and then shift tab also works so yeah these are the only two things you really need to set up the first thing is to make sure that you set up the way you enter visual mode and the second thing is to just kind of enable tabs in inside of them so by default it's just not enabled if you press tab like this it won't work but you can set it up really quickly by just adding this command to your keybindings.json so yeah these are the two files to make sure you update them and yeah after that you should be pretty much good to go all the other things that i have are sort of custom for my setup maybe i'll go over them in another video but for the purpose of getting started with vim you only need to do this inside of settings.json and this inside of keybindings.json so yeah that's going to be it for today's video let me know what you guys think about vim commands in visual studio code do you think vim is essential or it's completely optional let me know down in the comments below and if you think any of my settings are pretty bad then feel free to roast me as well so yeah thanks for watching uh be sure to leave a like and subscribe for more in the future i'll catch you guys next time you
Info
Channel: Suboptimal Engineer
Views: 44,690
Rating: undefined out of 5
Keywords: suboptimal engineer, suboptimal software engineer, software engineer, software engineering, developer productivity, suboptimaleng, vim vs vscode, vim vscode, vim in vscode, vim in visual studio, vim setup, vim setup in vscode, vim in visual studio code, getting started with vim, getting started with vs code, getting started with visual studio code, getting started with vim in vscode, getting started with vim in visual studio code, vscode with vim, vim, vscode, vim in vs code
Id: h-epcklOC_g
Channel Id: undefined
Length: 8min 14sec (494 seconds)
Published: Tue Oct 27 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.