you NEED to use VS Code RIGHT NOW!!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
I don't care what you do in it. Using VS code will make your life better. It's the best way to write code, manage servers, do hacking stuff, cloud things, everything. So in this video I'm gonna show you how to use VS code. And not only that, I'll show you how I use it as a person who dabbles in pretty much everything it, so get your coffee ready, let's go. Now what you'll learn fairly quickly about VS code is that it's literally everywhere. Like check this out, I'm on GitHub inside a repository. If I just hit the period key on my keyboard, watch what happens, it is auto automatically transporting me to VS. Code mode. I'm using VS code in my browser. Just like that. But the best way to use VS code is to download it yourself and install on your computer. So go to code dot visual studio.com. Notice we can download and install it anywhere. But beyond that, it's like any other application. You know how to install things right? Just install it. Now once installed you can pretty much hit the ground running. But don't worry, after this quick coffee break I'll walk you through a few things and show you a few of the things I love using it for. Now during our coffee break, which is right now, I will spill my coffee. I'm gonna show you how you can set up your very own VS code server and the cloud. So yeah, right now you have VS code installed locally on your machine. But if you install on the cloud, you can access it from anywhere with anything like your phone. So check this out. Using one of my favorite cloud providers LE node, which is also the sponsor of this video, I can create a new LE node, a new server, go to the marketplace search for VS code. And with just a few clicks and choosing your plan, I'm gonna choose something very cheap. This'll cost me 0.01 cents an hour. Then I'll click create. And within moments and a few sips of coffee we'll have our very own VS code server in the cloud. Once it's done baking head to your network tab, grab your reverse DNS entry and suddenly you've got a VS code server in the cloud. But this is blinding my eyes, so I'll just real quickly change it to the color theme of can be dark. What is that? Oh that's like weird but okay I'll go with it. So yeah, code from anywhere even from your phone. Yeah, <laugh>, how cool is that? So if you wanna try this or anything in the cloud, check out Lin Node. They've been a sponsor of my channel for a long time. I use them for everything. And if you're a new user, you get a hundred dollars credit for 60 days for free just to play around coffee, break over. Now once you're NVS code, they're gonna try and tell you how to get started. Don't listen to 'em. I'm gonna tell you notice we'll have tabs kinda like a web browser. So just close it up. We'll first start with just opening a folder. So we'll go to file and open folder. I'll make a new folder right now. Call up my code and head select folder. And because I am the author of this folder, I do trust myself. Do you trust yourself? Now when we open a folder is kind of like opening a project. That's how vs. Code kind of sees it. And in this folder is where you'll store all your project files, all your code. So no time to waste. I'll start coding right now. I'll click on file, new file. And immediately you have like this big thing open up in the middle. This is called our command pallet. Get to know him, he'll be around for a bit. I spell pallet, right? I have to look this up now. I don't even know if I spelled it right. Dang you, it's one L. Ah, there we go. And here we'll just name our file. We'll say copy dot key Y for Python file in windows. It'll make you create the file in your finder window and then bam, you're good to go. Now right off the bat, notice this, it automatically knows that you're using Python. Got that Python symbol everywhere and then watch this. The best thing about coding applications like VS. Code is the color. Look at that. I'm colorblind, but even I can appreciate this. Our function, our string, the parentheses, different colors to help you code better and do things better. And notice even that kind of highlights your parentheses so you can know like what context you're in. That's that's pretty cool just by itself. And we've just started. Come on now. If you really wanna unlock the full power of this, check this out and down here. It's already telling us what we gotta do. It says Hey, you're using Python, you might want the Python extension. Extensions are one of the most powerful features of VS code. So let's listen to it. Let's install it. If you're following along with me, it probably is asking you the same thing. So I'll click on install right now. It immediately starts to install the Python extension from Microsoft. And again, notice it is opening up separate tabs up here, kind of like a web browser. And then also notice over here on the left on our little bar here, we're in the extension tab. Now we will talk more about extensions later, but right now I want you to go back up to the papers up here, the double papers, that's our file explorer and also close all these annoying tabs. Watch what happens with the Python extension installed. I'm gonna back up my code here and let me do a mistake. I'll type in prints instead of print. Whoa. First of all, squiggly line alert. It's yelling at us. That's called lint. It's highlighting the code. That's probably gonna be wrong. It's telling us we're wrong, which is awesome cuz like <laugh>, do you wanna be wrong? No, it also might give you some hints, which right now I'm just trying to print something. I don't need all that. But as I'm typing Coke, it'll start to tell me what I might wanna type. This is called IntelliSense and it's basically your little buddy helping you code. You're sitting there scratching your head, sipping coffee going man, what's that next thing? What? What is that? And it just tells you like, here's another example. If I do a four loop like notices, I'm typing four. It's like giving me all the other things I might wanna type in. Just look at how auto completes for me. That's so cool. Tabbing will finish it out with the most specific one. But isn't this beautiful man, I love this. Now I can spend the entire video talking about intelligence. I mean just look, just come on. But we'll move on. You'll find out, you'll discover it as you're just going through things. Now we've written our code, we wanna run it right, we wanna see what happens. We can do it right now from VS code notice I have a little play button right up here. If we click on that, oh, I don't have Python installed, let's fix that right now. So Windows doesn't have Python installed by default, Lennox and Mac and other machines will, but no sweat and Windows. It'll say, Hey, select your Python interpreter. Then it's like, Hey, it's not installed. Do you wanna install it right now? Yes I do. Right from the Windows store, once Python is installed, I'll select my interpreter as Python 10. And now when I click play at the top right, a bunch of things are gonna happen. Like watch terminal, what code, what? Two cool things, right? First our code ran right in front of our eyes. Second, we have a terminal right here inside vs. Code. Now because we're in Windows, this is our Windows terminal A defaults to power shell. But how cool is that I can do all my terminal E things, pwd ls create a new file which will show up right there. I can even do this over here on the right, I can click this button and split my terminal giving me two terminals. Now the whole terminal thing becomes very, very, very powerful here in a moment. So stay tuned. But moving on, just a few more basic things. Like first notice right here we do have our code, our files. This is the stuff that exists in that my code folder we created or whatever folder you might open. Now if you click on these dots right here on the right and change our view to see open editors, it will now also show us, hey, what's open and your editor just coffee dot pie. But if we click on test dot yammel, it's open. Now also in your explorer at the bottom we have an outline of your code, which if it were more than a simple four loop and a statement and a print statement, it would be a lot more. But hey, it shows my variable and then also a timeline of what you've been doing. And then on the left we have search which allows you a search through everything, every code you have in that folder, every piece of code. And it finds it and it puts it right there. I mean that's, I love that. Now that searches through everything. If you just wanna search through your one file that you have open in your editor, just click on it Ctrl F and you can do that. You can even like do a fine or replace if you dare. Ugh, no, I can't do that. I gotta reverse that. Okay, better. Now I wanna show you my favorite feature of VS code. And this is what I use it for mostly look up. Okay, so we're gonna go back to the extension tab right over here and we're gonna search, and by the way, they have a ton of extensions. We're gonna search for remote. And the first guy that pops up here, remote ssh, click on that and we're going to install it Now while it's installing re what? Assess open any folder on a remote machine using ssh. Now I know you're hearing those words and you're like, yeah, that's kind of cool. No, it's more than kind of cool. You have to see it to believe it. Check this out. When I first started using this I I was just like flabbergasted and I never used that word. Okay, it's installed. Notice I've got a few new friends over here. We've got a new icon for remote explorer and a new guy down here. Let's use it. I'm gonna close this tab and click on this remote explorer icon. Now y'all know I use cloud stuff all the time, especially LE node. And honestly managing remote resources hasn't been the easiest thing in the world, but vs. Code <laugh>, dude, it makes it so fun. So check it out. I'm gonna grab my IP address from my node I just created here in remote. I'm gonna go over here to SSH and click on the plus sign. That's gonna bring up the command pallet with one L. I wanna just paste in SSH route at my IP address and enter, choose my config file and I get a friendly message that my host has been added. Cool. If I refresh this real quick, there it is. So right here in VS code, check this out. I'm gonna hover over this and click on that window with the plus which says connect in a new window. Let's do that right now. Connect it, brings up my new window and notice what's happening. So first it's asking me like, Hey, is this Linux? It's gonna ask me for my password, but also notice it's remotely setting up vs code on that server or that remote machine. So setting a VS code for me. That's just one cool thing. Buckle your seat belts. So I select Linux. Yes, I do wanna connect just like SSH every SSH connection you have. And suddenly I am still in VS code. But it's different cuz at the bottom left here I am SSH into my remote host and I'm using a VS code environment. That's not my local computer, it's the guy I just connected to. So watch this. Let's open a folder. Do file open folder. Huh? Root. That's like a Lennox thing, right? Yes it is. Okay, it may prompt you for another password entry. Yes, I trust it. Stop asking me and suddenly I'm in my Lennox file system right here of this remote machine. Now this right here is how I manage all my Lin node servers I have and pretty much every server I have. Check this out. I mean I can go to terminal at the top new terminal. Dude, I'm in my Linux host. Wait show my who am I? There we go. And I can do all my Linux stuff right here. Create a new file. There it is. I can start editing it right here. But notice one thing though. How do I run this code? You're like Chuck hit the play icon. Where is it? Dude, it's not there because this is a new VS code environment. We just remote it into that Python extension we installed for our Windows machine earlier. It's not there. Easily solved though. If we go over here to extensions search for Python, it'll tell you right there. Hey, install it on this SSH host this machine you have installing it and with it installed, we got some help again. Now some other things that vs. Code unlocks pictures and videos like watch this. I'm gonna w get a photo. There it is right there. I can click on it in my explorer here and preview it. <laugh> inside vs code. What? Same thing goes for a video. Click on a video, it'll play right here in VS. Code. Keeping in mind, this is not a Linux server that has a gooey or anything. How cool is that? I feel like I'm doing the same thing as a video. Now this one's gonna break your brain. Check this out. Getting back to extensions. I'm going to search for Docker because yes vs. Code can do everything. Have you not realized that yet? It can do everything including Docker. We're going to install the official Microsoft Docker extension here on our remote server. It's installed. That was quick. And now we should have a new extension over here. Let me do additional views. Click on Docker. It will show me all my running containers. Let me run one real quick right now and look at that <laugh>. I have a container running nvs code can manage it. What like watch it shows me my images. I can also connect to our registry if I needed to. I'm not gonna do that right now, but I can manage the containers. Like if I right click this guy actually first, did you see that? It's gonna brush over that you can see all it's files, all its root file system. You can right click it, inspect it, it'll open up a file that'll tell you everything about it. Birthday, social security number, everything. You can stop and restart. And even the best thing ever is you can just attach the shell just like that. Right? Click your container, jump in there. Suddenly over here my terminal, I'm not in my terminal, I'm inside that docker container's terminal. What? Yes, I can open in browser but it says no port's available. Cause I didn't open a port. I wonder if I opened a port it would do something. Cause I wanna create another one. Engine X two is up and running. Oh, if I just highlight over it, it does that. What? That I'm gonna open and browser <laugh>. It just opens the webpage, the open port. Ooh, I love the S code. Oh I need even see this down here. You can view the networks and the volumes dude vs code. Why aren't you using this tool? <laugh>, use this right now. Right now. I know you guys love it when I say that. All of you do unanimously. So now you're seeing the power of VS. Code is in the extensions. It really is. And just two more I wanna highlight. I'm only gonna show you one of them though. And that's Azure and aws. Azure and AWS both have their own extensions that you can install. I wanna go ahead and install it here. And what that allows you to do is manage your cloud resources right from VS code. Like they, they don't want you to ever leave vs code. Just like do everything right here. And I'm okay with that. So if I click on my new Azure extension I just installed, I can create a student account right from here. That's pretty cool. But I can sign it to my Azure account, which will take me to a web site so I can get logged in. So I'm signed in, I'm gonna close the page. And now <laugh>, this is so crazy. I can look at all my resources in Azure. All right here like here's my virtual machines. And what's funny is the virtual machine I'm on right now is this one right here. And you can create new resources right from your command palette. Like I don't even understand why this is so powerful, but I love it. So I'm sure this video is already too long. I'm sorry Nick, but I wanted to introduce a tool to my audience that I think you guys should be using if you aren't already using it. So if you're new to it, this is what the pros use. They use vs code for pretty much everything. Writing code, managing their servers, doing some hacking things, all of it. So let me know below. Are you going to start using VS code or do you already use it or hey, do you use something better? Doubt it. But <laugh>, I'm curious, is there something better than this? I don't think there is. And also, hey, have you, have you hacked the YouTube algorithm today? Let's make sure you do hit that like button notification, bill, comment, subscribe. You gotta hack YouTube today. Ethically, of course.
Info
Channel: NetworkChuck
Views: 472,698
Rating: undefined out of 5
Keywords: vs code, visual studio code, ide, visual studio code tutorial, vscode extensions, vscode tutorial, visual studio code html, vscode python, vscode setup, vscode python setup, visual studio code tutorial for beginners python, visual studio code extensions
Id: 1ZfO149BJvg
Channel Id: undefined
Length: 12min 47sec (767 seconds)
Published: Fri Dec 23 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.