|
|
|
14:16 |
|
|
transcript
|
7:01 |
And we're live. Welcome everyone to... No, dude, this is not a live stream, Cecil. This is a course. Visual Studio Code for Python Developers, man. This is a course? We're recording a course right now? Yes, yes. I know you're used to doing live streams, but we're doing a course now. Oh, okay. So what course is this? Tell me, remind me. Visual Studio Code for Python Developers. Oh, that's right. Yes, that's right, that's right. Hi everyone, welcome to Visual Studio Code for Python Developers. What am I supposed to do now? Now we're supposed to talk about their instructors, Cecil. Your instructors for this course are... Me and you! Dude, we're recording a course! No, you. Oh, you want me to talk about me? Okay, go ahead. I'll talk about me. Hi everyone, my name is Cecil Phillip. Developer advocate and big, big fan of Python. And that's my picture here. Is this the right finger? Yes. There you go. And that's my social thing. So if you want to reach out to me on social media at Twitter, at Mastodon, and Bluesky, and all the things, you can probably find me at this... Handle? Is that what you call these things? Yeah. Some of these different places. But super excited to be here, super excited to talk to you all. And I am joined with my buddy, Brian. That's me, looking like a doofus, as usual. Yes, I am Brian, Brian Clark, go by Clarkio on the internets. You can find me on Twitter, and I'm Brian Clark. You can find me at that handle, either underscore Clarkio, because the name's taken, or just Clarkio. And yeah, I am a Python enthusiast, I would say. Cecil and I have live-streamed learning Python before, and that's what we were joking about before. And I've been a developer for many, many years. And I'm a developer advocate now as well. And I'm excited to jump into this course and teach you about using Visual Studio Code for Python developers. Assuming you're a Python developer. I hope you're a Python developer. I hope so, too. So, we talked about... What the course is, who their instructors are, but who's this course for? Python developers? Is that it? I think so. But I think even more importantly, why we're doing this course, because one, we're both fans of Python. But we're also both fans of Visual Studio Code, right? And in some weird universe, there must be a place where people like the two of those things and want to put them together. Right? And so, then there's the question, how do Python people Python on Visual Studio Code? So, we thought it'd be a great... I think it's a great way for us to kind of take two of those things that we're really passionate about and put them together and create a resource that will be hopefully helpful for all of you. So, if you're new or maybe you're a seasoned Python developer or maybe, you know, maybe you're an architect, but like you've never used VS Code before. Maybe this is the new thing for you, right? Everyone's learning something new. So, hopefully, regardless of whatever path that you're walking, hopefully you'll learn something from what me and Brian are going to share with you during this course. Yeah. And speaking of... What you'll learn being that you're in the right place, let's talk about what we're going to cover in the course. First up, we're going to help you get set up. Okay. If you don't have Visual Studio Code, if you don't have Python already, we're going to get you... Walk you through that process very briefly, just to make sure we're all starting off on the same page. Next up, we're going to be talking about exploring the editor. So, getting acquainted with the visuals of VS Code and how you navigate around there and what the names are of different components within the UI. So, you're going to be talking about the UI of Visual Studio Code so that you know what those terms are, you know what we're referring to throughout the rest of the course, and you're familiar with it and up to speed with all that. After that, we're going to jump into editing the code. So, what's the experience like writing Python code in Visual Studio Code? And how do you go about making sure that that is up to the most optimal settings and situation in order to be able to do that successfully and efficiently? Then we're going to be talking about managing environments. So, we want to talk about that real quick. Yeah. So, one of the things that folks that if you're familiar with Python, you might have heard about virtual environments or even setting up your workspace, right? What are some of those things that you wanted to do? And maybe you already have a pattern that you'd like to use already today. How can you do that with inside of VS Code? So, we're going to try and show you how to get everything set up so that you're, you know, have the best chance to, you know, do the workflow that you're used to using the tools that we're going to show you. All right. And then next, it's going to be running in debugging. Cecil, tell us more about that. Well, if we're going to write the code, I'm going to assume we're going to want to run it at some point. Yeah. Well, if you run it, if it doesn't work, you probably need to debug it too, right? So, how does that work in Python, right? Like, how do we engage with the debugger and, you know, set breakpoints? How do we use conditional breakpoints? How do we look at some of the debug output and, you know, some of the other diagnostic tools that are inside of Python that'll help you make sure that your applications are running the way that you're expecting them to? Very good. And if you get it running, there's... This is the next thing you're going to need to be doing, right? To make sure that what you are running and using is working as expected, right? Nobody test their code, Brian. Come on. Oh, man. You got me there. I'm guilty. Nobody does that. I'm playing. You all should test your code. Don't listen to me. Test your code. Please do. And we're going to talk through some of the different, well, testing support in VS Code for Python. It's not going to be an intro to testing, but it is going to show you how to run your test, probably look at some code coverage. And again, how to, you know, use some of the navigational features inside of Visual Studio Code to make sure that your testing workflow is as efficient as possible. Excellent. And last but not least, we're going to be talking about source control, where you and I are going to demonstrate together what the experience is like checking things in, making changes, committing changes to our code on a project that we're both working on and what that experience is like for a Python project using source control within VS Code. Visual Studio Code, right? Yeah, I think one of the things I love about programming and even just being in the open source community is how we can collaborate with each other. And I think Visual Studio Code gives us tons of great tools that allow us to collaborate. And one of those is source control, right? So, you know, I think it's important for me to know that if there's a bug, I want to look at the line of code and be able to blame somebody and be like, oh, OK, I wrote this. My bad. Yeah. All right. So that's what we're going to be covering. You're going to what you can expect in the upcoming videos is a combination of either myself and Cecil together talking about a topic of choice within the what we're going to cover here. But also sometimes it'll be us as individuals teaching you about that particular topic within that module. So that's what you can expect throughout the rest of the course. In the next video, we're going to tell you what you need to be prepared, like prerequisites, that type of thing in order to get started with this course. And then after that, we'll talk about some resources you'll be able to use or throughout the whole course. course. Awesome. Sounds good. See you in the next video. Sounds good.
|
|
|
transcript
|
5:04 |
Welcome into this next video. We're going to be talking about what you will need in order to be able to follow along with this course. First up, obviously, you're going to need the most important thing. What is that, Cecil? A computer. Yeah. One of the first things that you're going to need for this course, and we should have installed or we're going to talk about how you can get it installed, is Python. We are going to talk about Python and VS Code, so hopefully you have Python installed already. If not, we have some other videos later on in the course that are going to talk about how you can get it installed. But for those of you that are pretty new or fresh, Python is a programming language, and it allows us to do a lot of cool things like build desktop applications and microservices and web apps and web APIs and tons of cool stuff. So, again, we're not going to dive into how to use Python or the syntax and the semantics. But we are going to talk about how you can be productive using Python inside of VS Code. And speaking about VS Code, I'm guessing we're going to need to install that too, right? Yes. So you will need to get this in the getting started module. You'll be able to go into detail on all of this, but I at least want to give you a high level overview of what Visual Studio Code is. It is an editor. It is not necessarily an IDE, but through its plugins and extensions, you will be able to kind of view it as on a spectrum of like whether it's an IDE or an IDE. It is not necessarily an IDE, but through its plugins and extensions, you will be able to kind of view it as on a spectrum of like whether it's an IDE or an IDE. but through its plugins and extensions, you will be able to kind of view it as on a spectrum of like whether it's an edit, more of an editor or an interactive or integrated development environment. That is, because of the rich development experience you'll get with a lot of the plugins that are available to you in the VS Code marketplace. So VS Code is a piece of software. It's a desktop client, but also it could be used in the web, for VS Code.dev and it's built with web technologies. So things like JavaScript and Electron help make it possible to be used cross-platform as a thick client application, but then also in the web, in your browser, like I was mentioning before, it is open source. So if you went to github.com/Microsoft slash VS Code, you can follow along. You can build it from source if you wanted to, even it's completely free and, you can, you know, keep up to speed with the latest releases and, and the development. Activity on it directly in this open source repository. So now that we know what you're going to need, like Python and VS Code, I mentioned editors and IDEs. What Cecil, what's the difference for folks that aren't familiar with that? What's the difference between the two? Yeah, I think that's an important thing for us to like take care of off the bat. And for folks that are in the Python space, if you've been around for a little while, you might even have heard of a couple like PyCharm as an example. And PyCharm is a really good, Python IDE, right? IDE standing for integrated development environment versus an editor. And now one of the things that you get from your IDE versus your editor is, well, you usually get a lot deeper support for introspection and debugging for, you know, a lot of analyzers, linters, all these different types of things. And they're usually already pre-packaged and bundled and ready for you to go. Right? PyCharm itself, again, it's, it's very focused on Python. We talk about this Visual Studio Code, as you'll see as we go on, it's a very extensible editor. It's good for editing code, and you can add extensions to it. You can customize it, you can tweak it, you can set whatever settings you need to set, so you can do what you want to do. But it is not an IDE, right? So again, out of the box, you can expect to have things like templates or syntax highlighting for your templating languages and all these different types of things from your IDE. And you might have that in your editor too, but usually your editor has so much better support, even support for deployments, version control, all kinds of things, but with so much more additional features. Like what Brian mentioned a little while ago, VS Code is free. It's free, it's open source, and you could download it and compile it and tweak it yourself if you wanted to. Versus something like PyCharm, well, you do have to pay some money for it. They do have licensing available for open source projects and students so that you don't have to pay or pay as much for it. But again, IDEs and editors are different, right? And they serve different purposes. So again, we're going to focus on the editor, right? Which is Visual Studio Code in this course. But PyCharm is a really great choice if it has the features that you need it to, you know, to build your application with. Yeah, and really quick to close that out, there is this awesome blog post on LogRocket about PyCharm versus VS Code that goes more in depth if you want to know and understand that better on a deeper level. You can go ahead and check that out. We'll share the link in our resources, which leads me perfectly to segue into the next video where you're going to be able to find out what other resources we have available for you to use throughout the rest of the course to help you along the way. So tune into that next.
|
|
|
transcript
|
2:11 |
Everybody. Before we actually dive into the meat of the course and start talking about the editor and customizing it and debugging and source control and all those other cool topics we're going to cover. First, I think it might be important for us to look at some of the resources that are available to you as you're just getting started with the course. As you're looking at the screen right now, what you should be seeing is the GitHub repo for the course. So VS Code-Python-Course. And so inside of here, you should find pretty much everything that you need to follow along as you're watching some of our videos. So you can imagine that the source code will be in there because GitHub, that makes sense, right? And then we'll also have a full readme that'll have links to resources, keyboard shortcuts that we use, settings and commands and things of that nature that we're using as we're going through the different chapters of this course. Yes. Anything else you think I'm missing, Brian? No, we'll have links to download VS Code in there. We'll have links to the extensions that we're talking about and we'll show you and work you through. So anything basically it's one link you need to worry about the GitHub repo for this course and then everything else will be within there to make it simple and easy for you, the viewer here watching the course. In addition to that, though, if you want to go and learn more beyond the course, one of the things you can do is go to VS Code's official documentation. They have documentation on their website for specific languages. And how? They set things up with that particular language for VS Code. And there's one for Python, of course. So you can go through here. It's a very high level type of documentation through it that you can, which links off to more things and goes into other topics that we're not going to be covering in this course. Things like Jupyter notebooks and whatnot that goes a little bit further in depth within the Python ecosystem than what we're going to be covering. You can check that out in addition. But again, the main resource you want to use is the GitHub repo. The GitHub repository. That's it. Right. And I'm going to be inside of that documentation site, so you should stick here because we're going to have a lot more fun in this course. Absolutely. All right. Well, next up for you, you're going to be moving on to the next module getting set up. Cecil and I are going to walk you through that whole process.
|
|
|
|
14:54 |
|
|
transcript
|
0:32 |
Hey everyone, welcome to chapter 2 of the Visual Studio Code for Python Developers course. So in this particular chapter, Brian and I are going to go through some of the things you need to do just to get set up to start taking this course. So we're going to talk about, you know, Python and, you know, getting Python set up in your machine, different distributions of Python. And also how you can get Visual Studio Code installed and set up in your machine. And also talking about like the different versions of Visual Studio Code and when you may or may not want to use them. Looking forward to it. Let's get right into it. Let's do it.
|
|
|
transcript
|
9:04 |
In this course, we're talking about how to use Python in VS Code. So ultimately, at some point, we should install Python, right? Like we should get some version of Python. Nah. You don't need it. No. Oh. I mean, we should at some point, right? Okay. All right. I guess so. But here's the thing. Here's the thing, right? And I see what you're saying. But here's the thing. There's so many different iterations of Python. It becomes hard for people to know like which one exactly should they install. Yeah. So I figured why don't we spend some time in this video kind of going through what are some of those different versions of Python and then, you know, some of the reasons you might pick one versus the other. Does that make sense? That makes sense. And I'm excited about that. That sounds good. Because I don't know all the different versions of Python. I just know Python. And you know what? And you know what? We'll talk about that too. Because what does Python mean? Now we get into like this whole philosophical question. Oh, wow. Yeah. I don't know. What is Python, right? What's the meaning of life, Cecil? Is it Python? What's the meaning of life? Is Python the answer? Maybe Python is the answer. Okay. But this is the first one we have. So one of the more common distributions of Python is called Anaconda. Now, this one is primarily used by a lot of folks that do data science, machine learning, that type of work. And that's because when you install this distribution of Python, right, we call these different versions distributions. It comes with like a lot of different versions of Python. It comes with different Python packages, you know, tools and utilities and stuff like that, like included in the box. That means that I don't have to go out and install a bunch of other stuff. I can just download Anaconda. And you see, I got stuff like Jupyter Notebooks. I got Pandas. I got all this stuff that's just kind of included. So it's easy for me to just start, you know, playing around with Pandas or creating graphs and like finagling with my data. So that's one of the reasons why a lot of folks like to use this particular distribution. That's interesting. That's interesting. A lot of AI based stuff. I like that it comes packaged with things. I love the names of stuff like Pandas, you know, and Jupyter. And Anaconda. Yeah. So this might be for somebody who's starting out with Python, though, this maybe is a little bit overkill. Not maybe, maybe not overkill is the right word, but it's a little bit over the top for somebody just getting started in the beginning and maybe looking to use Python with VS Code. Would you say that's the case or no? Or what do you think? Well, I would say it depends on what you call beginning. Okay. So a lot of folks that are beginning Python, they may be folks that maybe are using Excel or you're used to using some other tool for data analysis. So you know what you're doing, right? But maybe you really want tools to kind of help make your job a little bit easier. So like something like having a notebook and working with cells and stuff like that is natural for you. So now you have to learn Python to do it. So for you, maybe having to install all those additional packages. Maybe that might be overkill for you versus just, oh, okay, I just have it because I just downloaded the thing and it has everything for me. So as I'm saying, like, you know, all of these different distributions has like a purpose. And it kind of depends on it kind of depends on what your purpose is, right? Like what exactly you try to do. All right. That makes sense. All right. So I see. So that's Anaconda. The next one we have is MicroPython. What's the purpose of this one? So this one is for folks that are working with like microcontroller, you know, like those little boards. And, you know, you get your little solder. Yeah. Internet of things. Soldering iron. Yeah. Internet of things and IoT and that kind of hardware stuff. IoT stuff and, you know, plugging in sensors and controllers and all these types of stuff. But you need a very small version of Python because, again, those devices have very limited memory sets. You know what I mean? And, you know, very limited processing power. Yeah. So you want to be able to have something that's very lean and able to run in like those types of architecture. So MicroPython is a great way to do that. And it's a great way to do that. And it's a great way to do that. And it's a great way to do that. And it's a great way to do that. Yeah. Yeah. Yeah. Yeah. MicroPython is a great option for doing some of that type of stuff, too. Okay. Cool. Cool. All right. Next up, we have Iron Python. Iron Python. So this one and the next one, the next two are going to be really interesting because so Iron Python is like Python for .NET developers. Right. And some folks might be like, well, why do I want to do that? Yeah. And then, well, I mean, for a lot of folks, there's a couple of reasons. One, you might want to have like some type of interoperability. When I talk about interop, I might have like a thing. Yeah. Like a Python library that I wrote that I want to use in my .NET application or .NET DLL that I want to use in my Python application. Okay. Or I've seen folks that have done inline scripting that would allow me to like write some, you know, small little scripts, maybe in Python, interpret them and run them on the fly in my .NET application. So there's a lot of different use cases for why folks might want to do this. You know, also, too, because it's running, this version of Python is going to be running on the .NET CLR. So now the way that we think about it is, you know, I'm going to run this version of Python. Now, the way that we think about threading and, you know, multiprocessing and some of those types of things are a little bit different than it would with some of the traditional, you know, Python idioms. I got you. Now, this one, if we look, this one is up to Python 3.4. Now, the current version of Python, I believe, is like 3.12 at the time that we're recording this right now. Yeah. So as you can probably see, there is some gaps between like the current version of, you know, the default installation of Python and where it's running. But again, if you're not really needing those, you know, cutting edge features, then, you know, this should be fine. And this would be really great. Again, if you're trying to like just interop or integrate into an existing application. Okay. And you mentioned this other one, Jython is essentially similar to, it serves the same purpose as IronPython, but for Java. Yeah. Python and Java. Okay. So now when we talk about Java, we talk about like the JVM. Right. The Java Virtual Machine. Right. And for folks that are familiar with Java, maybe you are, maybe you might not be, the JVM runs lots of different languages on top of it. So Kotlin is an example that runs on the JVM. Scala runs on the JVM. Groovy, which is a different scripting language, runs on the JVM. And now we also have Jython. So that means that, again, we can pull in Java jars and packages and all these types of stuff and write Python code to run with those things too. So again, if you have any of those types of, it's a great way to run. If you don't have any of those type of interop scenarios, then it's a great option. That makes sense. And I'm talking about the version gap a little bit again. Here, this one, the current release only supports Python 2 right now, but they are working towards supporting Python 3, at least at the time of recording this. Right. Something else to keep in mind. What's great about these things too is that, you know, both this and IronPython, they are open source. So if you're interested in getting into language interop and writing compilers and parsers and all these types of things. This might be a good option for you to like contribute back to some of these projects to help make that community better. Yeah, for sure. All right. Last but not least. Python.org. It's just Python. Just Python. It's just Python. This is what I was expecting you to tell me about. And, you know, maybe we should have started with this one, but this, it's just Python, right? This is the default distribution of Python. You know, it's, you know, hosted on Python.org. It's written in C. You know, runs on tons of different architectures. It runs on tons of different architectures. And for most folks, when you install Python, you know, this is generally the version that, you know, most folks are going to be able to use. So if you're interested in like diving into this one and seeing how to install it, you can go ahead and head over to downloads. Hit that little download button in the menu bar. And you could pull it down for your system, right? It runs on Windows, Mac, Linux, and tons of other architectures as well. Awesome. All right. So this is all about getting different versions of Python. For the purposes of this course, we're going to be using throughout 3.11.3, I think, to be very specific. But if you need help getting you, the viewer, need help getting installed, Python installed on your system, you can look no further than right on this platform where you're watching this course. If you go to talkpython.fm/installing-python, you'll be able to step through this guide, this article here that will walk you through doing that to make sure you get it installed properly on your operating system. operating system and verify that it is ready and available for you to start writing python exactly and like i said before like this one's gonna help you get the default or the python version distribution written in c the one that we showed at python.org on your machine if you're interested in getting anathonda or iron python or any of those other ones make sure you go to those websites and it'll let you know like the instructions and the steps you need to take to handle those awesome well now that we know about the different types of python distributions that are there which one we're going to be using in this course and how to get it installed next in the next video we're going to talk about getting vs code set up on a machine very briefly giving you an idea what to expect in doing that so let's head on over into that what do you say cecil let's
|
|
|
transcript
|
4:48 |
So Brian, we just went through how to install different versions of Python, different distributions of Python, right? Like try to understand what version we're going to use in this particular course. But I kind of feel like we should tell people how to get Visual Studio Code installed too. That might be an important thing for us to do. So could you help us out with that? It's just a little important and I'd be happy to help you out with that. So to get folks started, if you don't already have Visual Studio Code installed at this module here, this video is going to help you out. You want to go to code.visualstudio.com, which is what we're looking at right now. And here you're going to be presented with a lot of information. But one thing I want to call out that may not be exactly apparent because right now it says download for Windows. It's picking up that I am running on a Windows machine right now as we're recording this. But VS Code is available for Windows. macOS and different distributions of Linux. Your mileage may vary on there, but you get the idea. It's meant to be cross-platform supported on all major operating systems and Linux distribution. So keep that in mind if you're looking to install it. You don't need to worry about jumping to a different operating system for the purposes of this course. You use what you want to use. Get Visual Studio Code. Now, when you come here, you can click the big blue button to download it for your operating system that you're going to be running on. But you don't need to worry about jumping to a different operating system for the purposes of this course. You can click the big blue button to download it for your operating system that you're going to be running on. But that's going to give you what's called the stable build, which is typically the blue icon that you see when you're installing it. But if you wanted to, you could potentially open up the door to... You want to get a bit adventurous. Cecil, are you feeling adventurous, man? I mean, I live on the edge. So what you could do then, since that's the case, is you can actually install the Insiders version, which would be... The way you know the difference between them is it has a green icon. And what the Insiders version is, is you're getting more frequent updates ahead of time before the stable. So you can get more frequent updates ahead of time before the stable release. Now, why you might want to do that? Well, I, like Cecil, like to live on the edge and get the latest and greatest features that are coming out in VS Code and be able to test them out and try them in my projects. But I also have found that running both... You can run both side by side, by the way. But running in Insiders, I rarely ever ran into issues where I would have to stop using that and actually switch over the stable. Like maybe two times that's happened in nearly a decade or however long I've been using VS Code. I want to say it's almost... How old is VS Code? I don't know, but it's pretty old, okay, at this point. And over those many years that I've been using it from the start, two times have I ever really had to shut down Insiders and then just reopen the project in the stable build. So try out either one, whichever one you like. If you want to see the difference between them, you look at the icon here. It's green. Okay. That signifies that it's Insiders to me, the Insiders version where I'm going to get weekly or daily even updates in the bottom right hand gear. Or for me, it's the bottom right hand gear. Okay. So that's the bottom right hand gear. But for others, it might be on the left hand side. And then if I'm in the Insider or standard stable version, it'll be looking like this with the blue icon. So just calling that out if you're interested in checking out different flavors of Visual Studio Code. But you click on that, it gives you the corresponding executable for Windows or DMB or DMG rather for macOS and so forth. And you just step through the little installation process and you'll be off and running with Visual Studio Code on your operating system. So the only one thing I want to point out with that is, and like Brian said, we like to live on the edge, right? And so we often would have both the, I guess, the stable version and the Insiders version on our systems. Sometimes when your Insiders version updates and, you know, the folks that build the plugins and the folks that build the editor aren't the same folks. And so sometimes, you know, updating to like the bleeding edge version might make some of your VS Code extensions freak out a little bit. I'm just like, it's okay. Nothing bad is going to happen. It's going to happen on your computer or your machine. But you can expect that, again, when you're living on the edge, sometimes things are going to happen, right? And so that's usually why I like to have both. I have like the Insiders version and the stable version. So I can kind of see how the worlds are different, right? And look at the updates, but also see how like my extensions react to that as well. Yeah. It's great you bring that up because there's actually a third flavor of Visual Studio Code, if you will, that you can potentially use. It's outside the scope of this course, but there is a web. So if you're using something like GitHub Codespaces or some type of cloud development environment, it can leverage most of, if not all of Visual Studio Code, just like the one that you would install on your operating system, but in your browser. And you get a lot of the conveniences of that without having to pollute your local, you know, machine that you're working on necessarily. So you can check that out. That's also there under VS Code.dev if you want to go learn more about that and find out ways you can leverage Visual Studio Code.
|
|
|
transcript
|
0:30 |
All right, folks. Well, hopefully after watching this chapter, you've learned everything you need to learn about getting set up with Visual Studio Code, different Python distributions, and having that set up on your machine. If you have any questions at all, always feel free to message either Brian and I. You can reach out to us via the Talk Python folks, and they'll make sure they send any questions and queries our way. But now, we're going to move on to the next chapter of this course, and we're going to learn a little bit more about how we could customize and get set up using Visual Studio Code.
|
|
|
|
1:08:51 |
|
|
transcript
|
2:14 |
Hey there and welcome to this module on exploring the editor with Visual Studio Code and I want to talk you through what we're going to cover in the module so you have an idea of what to expect. First of all, we're going to take a look at and get a general overview of the user interface so that we can get acquainted with it and how it works and where things are within that space. After that, we're going to take a look at the activity and secondary sidebars. These are the bars that come up on either the left hand side or the right hand side, depending on your preferences and configuration. You can hide and show those throughout your developer workflow. After that, we're going to take a look at the command panel, which is your gateway to doing anything and everything all from the keyboard to jump around between different actions and customizations right within Visual Studio Code itself. We'll take a look and understand the Explorer and workspaces, the Explorer being the area where you can open up folders and files and. Have visually see what you're working on and workspaces allowing you to logically gather things together or aggregate different projects from different folders together into Visual Studio Code. Once we're done with that, we're going to talk about the status bar, which is something that gives you active information about the current state of things when you're working on a project. So things like the file you have open the current cursor position and line that it's on stuff like that within the status bar. Then we'll talk about the terminal, which is going to allow you to run commands or navigate around different directories, things that you normally would do in an external terminal. But this one is built into Visual Studio Code. After that, we'll talk about settings. We got to be able to customize our editor to our liking. We got to tweak things, make things visible that we want visible, hide things that we don't want visible and stuff like that. Shortcuts and whatnot that you'd like to be able to do. Speaking of, we'll talk about common shortcuts that you can use to keep your workflow efficient and productive. And then we'll talk about the default settings. So if you're using a default setting, you can use that. So that you can jump through your projects, get your things done as fast as possible. After that, Cecil and I are going to talk with you about extensions, the themes that we recommend that you can check out. That'll help you and enhance your overall experience developing within Visual Studio Code. And then that will close things out for this module on exploring the editor Visual Studio Code.
|
|
|
transcript
|
5:23 |
Visual Studio Code has a user-friendly interface that consists of several components designed to enhance your coding experience. Understanding these UI components will allow you to navigate, edit, and manage your code and projects effectively while using Visual Studio Code. The menu bar is located at the top of the Visual Studio Code window, right up here. That's where we see File, Edit, Selection, View, Terminal, Help, and all those options there. It provides access to different menus such as File, Edit, View, Go, Debug, Terminal, and Help. Each menu contains a set of commands and options that you can use to perform various actions within Visual Studio Code. So if you need to open up a new file, open up a folder, save things, share, close things, all that kind of stuff is happening from the File menu along with some of the other menu options that you have here. Next up is the Activity Bar. This is positioned... along the side of the window and it's typically, by default, on the left-hand side. It consists of icons representing different functionalities and aspects of Visual Studio Code. Common icons in this bar include the Explorer view, which we have open right here, Source Control, which is this one right here, the Run and Debug view, Extensions, and Search. Each icon corresponds to a specific view or feature that you can utilize within your development workflow. After that, we have the Editor Group. That's where you see the current file that I have open right now, api.py. The Editor Group is the main area of the window where you open and edit code files. Visual Studio Code supports multiple Editor Groups, allowing you to work with multiple files simultaneously. Each Editor Group can contain one or more tabs representing individual files, as you see here. api.py is an individual file represented under its current tab here, right there. You can switch between these two tabs to see which one is the most important. You can also drag tabs around to rearrange them or split the editor so two files are side by side. Below the Editor Group you'll see the Panel area, which is where the integrated terminal, the problems view, the output, and the debug console all live. You can resize that panel by dragging the top edge up or down, depending on how much room you want for it. Over on the right-hand side, we have the Secondary Sidebar, which is hidden by default but can be turned on from the View menu. The Secondary Sidebar is handy for keeping a second view open alongside the Explorer, like the Source Control view or the Outline. You can drag any of the views from the primary sidebar over to the secondary sidebar so they sit on the right while your code stays in the middle. At the very bottom, we have the Status Bar, that thin strip running across the bottom of the window. The Status Bar shows you contextual information like the current branch in Git, the line and column your cursor is on, the file encoding, the line endings, and the language mode. You'll also see indicators for problems, warnings, and any background tasks that VS Code is running for you. A lot of those items in the Status Bar are clickable, so for example clicking the language mode lets you change the file's language association. Visual Studio Code also lets you customize the layout — you can hide and show any of these areas to suit how you like to work. So that's a quick tour of the major pieces of the Visual Studio Code interface and how they fit together. In the next videos, we'll start drilling into each of these pieces in more detail.
|
|
|
transcript
|
6:18 |
One of the most powerful components of Visual Studio Code is what is called the command palette. It allows you to access and execute various commands within Visual Studio Code. It's a versatile feature that provides a quick and efficient way to execute commands, which range from basic editor operations to advanced features and even extensions. You can open up the command palette using a keyboard shortcut, such as Ctrl-Shift-P on Windows and Linux or Command-Shift-P on Mac. Another way you can open up the command palette is by going to the View menu and clicking on Command Palette. Once the command palette is open, you can start typing to search for a specific command or feature that you want to perform. As you type, the command palette will dynamically update and filter those results, displaying any relevant commands or suggestions to you. So, what can we do here? In order to execute a command from the command palette, you just select it from the filtered list and press Enter. Or you can click on it if you'd like. So, as an example, let's say we want to close the current file that we have open. Say Close Editor. And what's nice about this is it also shows you any keyboard shortcuts that are associated with that command so that you can, over time, learn to memorize that particular keyboard shortcut instead of having to go through the command palette for that particular action. In this case, I'll hit Enter or I'll click on that one. And it did indeed close the API. If I bring up the command palette again, now I want to open a file. I hit Enter on that file. And I can choose API.py. What I find to be really great about the command palette is that even if I don't know exactly what the command is or action that I want to perform, if I start typing out what I'm looking for, it'll filter those results and give me a better idea of what might be possible. So, in this case, I want to edit settings for the command palette. How can I find those? Well, I'll bring up the command palette, Control-Shift-P, and I search for settings. And then I can see all the different options that have that keyword in it. And in particular, I realize, oh, I want to open the settings UI. Now, once in here, this is what we're talking about. We want to update some of the command palette settings. So, I'm going to search for command palette. And here we can see, let's close the bottom panel there. We can see the different options. So, we can see the different options that are related to the command palette in VS Code settings. So, we showed those two examples. And a few more examples of using the command palette that you might want to leverage it for is maybe changing the editor layout for you. So, in this case, you see I have a tab open for settings and another tab open in the editor view for the API.py file. What if we wanted to split those? Well, Control-Shift-P, and I look for split editor. And hit enter on that. And now we can see it did indeed. Split the editor. We have an editor group on the right-hand side with the settings view open. And then I can close. It looks like it duplicated in this case. And then I have the API.py on another side. Another option would be, which I personally prefer, is toggling which side of Visual Studio Code the activity bar shows up on. So, I'm going to search for activity bar. And you can see, we can focus on it or toggle the visibility of it. We can hide it completely. If I hit enter again, you'll notice when you bring up the command palette, it shows your recent command that you executed in that history. So, you can quickly jump between them if you need to go back and do something or revert something that you did. Toggle the sidebar, primary sidebar position. So, right now, that's on the left-hand side. And as I was mentioning before, my personal preference is to have it on the right-hand side. Now that you can see it's over there. The reason, really quick, sidebar on this. No pun intended. Why I want that on the right-hand side versus the left-hand side is I personally often move around my UI components or hide and show UI components. So, in this case, I like to hide and show this sidebar view so that I get more real estate to see my code. So, you can click on the currently active view to hide and show that. Or you can press control B or command B if you're on macOS. And that will toggle it on and off. In which case, you can hide and show it. In which case, you notice the behavior now. It's not as jarring on my eyes when I'm hiding and showing that versus when the sidebar is on the left-hand side. So, I'm going to press control B a few times and you'll see the code jumps. The positioning of where the code starts for me to read jumps quite a bit. And since I do that a lot in my personal workflow, I prefer it on the right-hand side. And maybe you will, too. One last really cool example of the power of the command palette that you can use it for. Is checking out extensions, too. So, control shift P to bring it back up. I'm going to search for extensions. And I have some options here. We can check for extension updates. Disable some of them. But I want to install, let's say, an extension like this. And it brings me right to the extensions view. Another thing you can search for is a lot of times people want to change the color theme of Visual Studio Code. You can start customizing it to your liking and be more visually pleasing for you. Well, I can search for theme. Click on this preferences color theme. And all within the command palette is when I'm doing this. And I can toggle through all the different options that are installed in my instance of Visual Studio Code. Some of these are built in. Some are ones that you can install separately. Which also can happen directly from the command palette. You see this top option. Sorry for the flashing there. Browse additional color themes. I hit enter on that. And now it's searching the Visual Studio Code marketplace. For all the color themes that are available out there. So maybe I want to search for Night Owl is one that I really like by Sarah Drasner. And here is the chance where I can actually see a live preview of that searching from the marketplace. All within the context of Visual Studio Code and the command palette.
|
|
|
transcript
|
7:42 |
One of the main features and functionality that you will be using within Visual Studio Code is the Explorer view and what's called workspaces. So right here on the left hand side, you can see from the activity bar, I clicked on the Explorer view and then that loads up in the primary view. Now, here you have some options. There's icons at the top that allow you to perform actions within the Explorer view and within the current context of the root folder of your project. So I can create a new file within it. I can say I want it to be like test.py if I wanted to, to create something new there. You can see it opens up automatically as soon as I create that in the editor view. Some other options that we have in these icons within the Explorer view is to create a new folder or maybe behind the scenes separately in your Windows Explorer or in Finder on macOS. You add another file within here that doesn't show up for some reason in Visual Studio Code. You can say, hey, I want to reload. Refresh. The Explorer view. I'm clicking on it right now, but nothing's changing. You can see that. And let's say things get a little unwieldy and I have too many parent child folders opened up and it's become too unwieldy to try and manually close all of them. Well, there's a collapse all folders in the Explorer view option like that. So that's the Explorer view. In a nutshell, you can also see at the bottom, there's a couple of little sashes too. So here's the main view in the Explorer view, the current root folder that I have open. But in addition to that, there's the outline. Which when you have an actual file opened up, Visual Studio Code will recognize the type of file it is. In this case, a Python file and give you a general outline of the structure of that file. In this case, we just have the API, which is a very simple file. So it's not showing a lot. But as you get a larger code file open, this will help you navigate it a little bit more easily. And last but not least, and this is something that has saved me at least once, if not twice. Now, where I've accidentally deleted something in a file that I forgot about and later needed to come back and restore it. Visual Studio Code will keep like a shadow copy of your files for you. And you can restore back to those times or the state of that file at that time, essentially. Just really saved my butt, to be honest. You know, excuse my language there, but it has. For instance, I had an ENV file, environment variables file, and that I deleted the API key that I needed and I couldn't find it or generate a new one. And that helped me restore back the API key value that I wanted. All right, so that's the Explorer view. Now, next up, as that kind of goes hand in hand with the Explorer view is a concept called workspaces. This is something that took me a little while to get my head around. But once, hopefully the way I explain it to you now, it'll be really quick and easy for you to understand. Essentially, a workspace is a way that allows us to organize projects effectively. Within Visual Studio Code. So in this case, my project, I just have this one root folder, which is for my API, the podcast API. But maybe I had a front end component to this overall project that's in a separate folder structure or a separate repo that I clone down to this machine. And I want to be able to work on that project at the same time as my API project and jump around quickly. And that's where workspaces come into play can act as even though they're not physically in the same folder structure. They can be connected virtually within Visual Studio Code using workspaces. The way workspaces are made available within Visual Studio Code is a number of ways. Well, one, one of the most prominent ways is through the file Explorer menu or the file menu. In here, you can see there's a couple of options related to that are related to workspaces. I can open a workspace file from a file. I can add a folder to the workspace. I can save my current setup as a workspace. Cause right now. It's not technically a workspace because it's just the one folder that I opened up. We can turn it into a workspace. And last but not least, you can duplicate a workspace. So maybe you have it configured a certain way that you like it, and you want to add a little bit more for a certain workflow that you have. Maybe some settings specific to that workflow. You can duplicate this workspace as like the template to work off of and configure it a bit further to your needs. But getting a little bit ahead of ourselves there. Let's talk about how we can create a workspace. So what I'm going to do is with the current project that I have open, I'm going to create a workspace. So I'm going to say save as workspace. I can give it a name and decide what, where I want to save it. In this case, I'll just put it directly in the root project where you save this workspace file doesn't really matter as long as you know where it is and where you can get to it because it acts as a manifest for you to describe where other projects that need Visual Studio Code needs to reference and pull into it. So I'm going to put it in here and I'm going to click OK. You'll notice Visual Studio Code reloads now and this top area or sash, if you will, within the Explorer view now has that workspace keyword in there instead of just the name of the folder that I had open, which was base. You'll also notice that now base that folder is a collapsible region within the Explorer view. So may not really look too different, but this next step is what's going to really show the. Power of workspaces for you. So in this case, talking about the example I was going through before where I have this API project, maybe I have my UI front end project in a separate folder. Well, I can right click in the Explorer view and I want to be able to see it within here. I can say, hey, I want to add that folder to this workspace by click on that. And let's just say for demonstration purposes, this is the folder that has. My UI in it and I click OK, and now I can navigate both of those. Within the same instance of Visual Studio Code. Again, this is like a virtual directory that references multiple other directories that are not necessarily connected. So let's say I made a mistake, though, this as you can see, this is just a essentially an empty folder that I added in here and I clicked on the wrong one. I need to remove this from my workspace. I right click on that particular dropdown and say remove folder from the workspace. Now we're back to just that base folder that we needed from before. So one of the unique things about a. Workspace is you can configure your Visual Studio Code settings to be saved to that workspace so that whenever you load up this project again or the workspace again, Visual Studio Code will apply those setting changes separate from when you open up a different workspace or a different project within Visual Studio Code. Demonstrate that will one let's take a look at what the code space file code workspace file looks like. It's essentially a JSON file. It describes the folders that should be included as part of that workspace and any settings associated to it right now. So you can see it's just empty. But if I go in and let's say maybe for this project, I want my font to be different size than what I have by default font size. I'll search for that in my settings view right now. It's set to 18. I'll click on workspace in here. And. Let's change that to 22. And I hit save. And now you'll see that one, the font size changed and it saved it into the workspace. Folder or workspace project file. All right, and that essentially summarizes workspaces that can be a powerful tool for you in those larger, more complex projects that you might be working on within Visual Studio Code.
|
|
|
transcript
|
3:07 |
Let's explore the status bar a bit further to understand its purpose and functionality and how it is commonly used. The status bar is a fundamental component of the Visual Studio Code user interface or UI. It's located at the bottom of the window as we mentioned earlier and provides essential information and indicators to enhance your coding experience. The status bar consists of various key components that display relevant information and facilitate interaction. One of them being language mode. This indicates the programming language or file type of the currently active file. In this case, I have a Python file opened up and it correctly detected that right here as you can see the language mode that I'm currently in. If I click on that, you can see that it auto detected the language mode, but I could manually change it to something else in case it did so incorrectly for some reason. The status bar also shows line and column numbers. This. Displays the current cursor position in terms of the line and column numbers in the active file. So if you notice right here, LN for line number 10 and COL column number 16. It goes directly to that. If I want to go to another one, I can click on this and I can say maybe line number 20 that's available or 15 in this case. It moves the cursor to those positions for me. But as you move it around, maybe with your arrow keys on your keyboard, you'll see those numbers changing. Such as the line number and the column that the cursor is actively at. In addition to line number and column numbers that are shown in the status bar, you can also see the indentation that's being used in the active editor. This shows the indentation settings being used in that active file. In this case, we're using four spaces. But I can change that to indent using tabs. I can change the tab size and other options within that action. Last but not least is Git integration. That can potentially be shown in the bottom of the status bar. In this case, I'm not using a Git source controlled project. But if you were and had that open in Visual Studio Code, it would be shown in the status bar. Okay, so that's a high level overview of the status bar. One other thing I'd like to call out, at least, as is the case with most of Visual Studio Code, we can customize the status bar to our liking a little bit. If you right click on the status bar, you'll get this menu with a bunch of different names of things and checkboxes. Next. So, as we were talking about before, we can see the editor indentation or the editor end of line or the encoding. All these options that are currently being displayed in the status bar, we can choose whether they are actually shown or not. So, maybe I don't want notifications to be available, which is that bell icon in the bottom right hand corner. Right now, I have no notifications. That's where they would show up if you'd like to see them and read about them further. But maybe I don't want to see those or I don't want to see the feedback icon capability anymore. I can click on that and you'll notice that the status bar has now been customized to my liking. And you can do so how you choose that fits you best. And that is the status bar.
|
|
|
transcript
|
3:33 |
One of the key tools when it comes to your overall development workflow when working on a project is your terminal or command line. This acts as a way for you to run your projects, build them, compile them, test them, all kinds of different actions you might take within the project that you're working on. And what's nice is Visual Studio Code comes with an integrated terminal built into it. The way you can access that is from a number of ways, but one being the view menu and going down to terminal. Or as you see in the menu here, the keyboard shortcut related to that is control back tick. That's for Windows and Linux or command back tick if you're on macOS. Click on that and we'll notice that the terminal view within that bottom panel is now at the forefront. I'm going to make it a little bit bigger really quick. And right off the bat, you might notice that my terminal is likely looking different than yours. And that is because I have on my host operating system Windows here or WP. WSL, Windows Subsystem for Linux. I've configured my shell and the way that shell theming is within that space. So that's how you would go about doing that yourself. But what's great here is Visual Studio Code will just reflect that. One way you need it to do that or to get that set up is by indicating to Visual Studio Code what should be your shell type. And that's where this little menu by the plus icon here, if you click that down arrow, you can see default is ZSH, which is the default default. Which is Z shell. That's my default one. But I also have access on this operating system to bash shell, JavaScript debug terminal, T mux, and then a couple other options related or related to terminal workflows. Maybe I want to split the terminal or configure terminal settings, set, select the default profile, which you can see here, which is the S H and then run tasks and configure tests. That'll be covered later. If you have set up your own shell on your operating system, just be sure to come over here. Click that little menu. And tell Visual Studio Code what the default one is. So in this case it was bash for me before, but now I switched it over to that Z shell, which I like to use personally. And that's why mine looks a little bit different here. You can get into the weeds on tweaking and configuring your shell, but that is outside the scope of this course and Visual Studio Code, to be honest. But to dive deeper into the behavior of how the terminal can be used within Visual Studio Code, you can see I have two separate instances that are open. These act as. Almost like tabs, just like how you have editor tabs for different files you might have open. You can have terminal tabs here. You can split these. Horizontally. Don't necessarily be two separate tabs that you would click into. You can have both of them visible at the same time. Let's say you accidentally opened up in that split view and you don't want that terminal anymore. You can click the little trash icon to remove it. You can move terminal into the editor area, which is nice. So you get a little bit more real estate when you're working with it. You can do that by right-clicking on the tab and choosing move terminal into editor area. Now it shows up as one of your editor tabs alongside any code files you have open. That's nice for those moments where you want to see a longer command output without it being squished. If you want to bring it back down to the bottom panel, same thing — right-click and move it back. So that's a useful little workflow when you need more vertical space. You can also drag the top of the panel up to make it taller without moving it. Either approach works depending on whether you want a quick resize or a more permanent setup. And then just close it when you're done. You can open up the other different shell types that you want. So if I wanted to create a new one, I click bash. Or. Tmux. Goes ahead and does that. I can clear the terminal from here. These are all the different terminal options, but essentially everything that you're used to doing in a separate app potentially on your operating system, you can do. You can do this directly within Visual Studio Code via the terminal view in the bottom panel.
|
|
|
transcript
|
5:52 |
All right, now it's time to get into settings for Visual Studio Code. VS Code settings allow us to tailor our coding environment the way we would like it. And that can be specific to what projects you have open or general development purposes. But there's a few ways to get access to the Visual Studio Code settings. First of all, one of the more common ways if you're more of a visual person through the UI is by going to File, Preferences, and then Settings. But that takes a little bit, a few clicks. You've got to use your mouse. If you want to use your keyboard and have quicker access to the settings, you can press, as you saw there, while I'm on Windows or on Linux, you can press Control, comma, which I just pressed to bring this up. You get the settings view. Or if you're on macOS, it would be Command, comma. And last but not least, one of the other ways that you can do it is through the Command Palette. So to bring the Command Palette up, you press Control-Shift-P on Windows and Linux. On MacOS. On MacOS, it's going to be Command-Shift-P. And then in here, I can just type in Settings, or if you wanted to, you could say Preferences as well. Right? And Open Settings UI. So that's the one you would want. And it brings us right back to that Settings UI there. So use whichever one you prefer. I personally feel that it's more efficient to just press Control, comma, for Windows and Linux, and Command, comma, for macOS. Now, as we're looking at the Settings UI here, you'll notice... at the top here, there's a few different tabs. Now, you may not see all the same ones that I have, but in particular, you should see a User and a Workspace at least. What that does is it encapsulates settings based on the different environments you might be working within. So when it comes to User, that's your user level settings. That's more globally applied across Visual Studio Code. And then Workspace is for the current workspace you're using and have open within Visual Studio Code. So in this case, this base Python project. So I can have settings tailored to that environment versus settings at a more global level at the user environment. You'll also may notice that I have this other one. It's for remote development environment. So I'm working within Windows Subsystem for Linux. So if you are doing something like that on Windows, you might have the option, this option here to configure settings based on that environment. Or if you're working within a dev container, for instance, which is outside the scope of this course, you'll be able to apply settings based on that as well. But the remainder of this, we're going to focus on user level or workspace level settings, and you can ignore that remote one. So within settings, you can actually search for whatever type of setting you might want. I know right off the bat, you can see at the front here that there's font sizes. But if I couldn't find that or I didn't know what it was I was looking for, you can start typing in the search box here to look for what you're wanting. Maybe I want to change the font, right? And I want to find all settings based on font. I just type that into the search box and I could see I get 44 different settings, related to font, font size, font family, and so forth. It's very, very efficient, very helpful to have that search box. It's improved quite a bit over the years since VS Code has been available. And I use that quite often, even if I don't know the exact name of the setting that I want to change, to find what it is that I need, and it's super helpful. So that's how you navigate settings in Visual Studio Code. Again, you can encapsulate them at the user level, workspace level. But one other thing I want to talk about with this is you can actually sync these settings. So if you work on more than one machine, so for instance, I work on a macOS machine for a laptop, but when I'm on a desktop, I'm on Windows, I can sync these settings across instances of Visual Studio Code, across operating systems as well, and machines. The way you can do that is by going to the gear icon in the bottom of the activity bar, clicking on that, and you can see I have settings sync as on. I'm going to turn it off really quick to demonstrate what that flow is like, or I can configure it to all the different options that you have related to settings sync. What ends up happening is you sign into either a GitHub account or a Microsoft account. This is what the option will look like for you if you've never set it up before, backup and sync settings. You choose which settings you want to and UI state and extensions that you want to include as part of this. We'll get into profiles in just a moment. I generally choose all and then you click on sign in and that will take you through the sign in flow with options to sign in with GitHub, which I'm already signed into my Clarkio GitHub account. Or other Microsoft based accounts. And what that will do is store your settings in a secure manner in the cloud based on whichever one you signed into. And that way when you sign into a new machine in Visual Studio Code with that same account, your settings will be synced over along with all those other capabilities that are incorporated into your account like extensions and profiles and stuff like that. Okay, I'm signed back into my settings sync account. Now the last thing I want to touch upon this when it comes to settings because I think it's related and it's really nice and I'm using it actually for the purposes of this course. You can create profiles and those profiles will be a further encapsulation of your settings. So in this case, I have a profile that's Python dev recording, but I have other ones for when I'm presenting or my just default one or VS Code default. You can create all kinds of different profiles. You can edit the profile. You can delete profiles export. And import. We can use that. So if you want to share with a colleague like your Python, the perfect Python settings and environment within Visual Studio Code, you can export that profile and share it with colleagues and friends that want to use the same approach. Same environment that you're using for developing in your Python projects. And that folks concludes everything at a high level. What you need to know to get familiar with settings in Visual Studio Code.
|
|
|
transcript
|
17:09 |
All right, brace yourselves for this video because we are going to take a look at keyboard shortcuts in Visual Studio Code. And I say brace yourselves because this is something that I'm personally passionate about in the sense of I want to be efficient and keep my hands on the keyboard as much as possible without having to touch the mouse or do anything else off of the keyboard. Now, while I say that, I'm also, I don't know every keyboard shortcut possible. I do know a lot of keyboard shortcuts in Visual Studio Code, but I don't know all of them or haven't used them all efficiently. But the idea is you'll be able to learn them on your own. And I'm going to give you a highlight of some of my favorite ones that I think you'll find useful to help you in using Visual Studio Code for writing your Python projects. Now, to start us off, though, let's first talk about how to learn shortcuts. Often the way that I come across new keyboard shortcuts is by through the visual indications that VS Code offers to you. So if you open up any menu, you'll notice to add a new text file. There's a keyboard shortcut associated. With it, that is displayed in that action. So control and on this in this case, if you're on Mac, it'll be command and right and so forth. Some of the other ones, new file, new window. This is a great way to get acquainted with some of the common things that you're doing that are you're like manually doing. But with your mouse, you can find the keyboard shortcut associated with that action in the menu of items that are there. Or if you hover over certain things. So let's say I wanted to instead of showing the Explorer view, which I have available right now. I can see that that is associated with the keyboard shortcut of control shift E or run and debug control shift D. So that's how I go about learning new keyboard shortcuts. And it's a nice little quality of life improvement that VS Code has had for quite some time now so that you can get more acquainted with new keyboard shortcuts and start incorporating it into your workflow. That's one way you can learn about it through the UI. Another way I like to do it, and this is probably the number one keyboard shortcut. If there's one keyboard shortcut you remember from. This course in this video, it's control shift P or command shift P. This opens up that command palette, which I believe we discussed previously and got you a little bit acquainted with it. But that's the gateway to everything in Visual Studio code along with the keyboard shortcuts that are associated with it. So if I wanted to create a new file. Let's do a new file. I can see that create new file has a keyboard shortcut associated with that control. Alt windows plus N. If I wanted to open something like open the keyboard shortcuts in particular, there's a keyboard shortcut for that control K and then control S on Windows and Linux. So I'm going to hit enter to bring that up because this is the third way that you can learn about new keyboard shortcuts. You can search for certain actions or commands that you would like and find the key binding that's associated with that in this table. There's even conditions and you can associate them with certain. Operating systems as well if you'd like. So this is the keyboard shortcuts view that gives you the overview of every possible keyboard shortcut and key binding that is saved and associated with Visual Studio code or any custom ones that you create. So that's how you access the shortcuts view. Now if you want to create, let's say a custom keyboard shortcut, you can either override an existing one. So like except chat input or except inline completion, I can click edit and type in whatever I want for the keyboard shortcut. So maybe. Control. I don't know. L will just make it up for now. It lets you know, by the way, that there are three existing commands that have this key binding that you will probably interfere with. So just heads up on that, but you can hit enter, press the enter key to then save that key binding to that command. I'm going to hit escape to undo that twice because I don't want to override this existing one. So that's kind of a quick overview of how you can get acquainted with keyboard shortcuts. Again, it's through visual indications, the command palette. Control shift P or in the keyboard shortcuts view directly. Now one thing I'm going to do to help with the rest of this course, I'm going to enable what's called screencast mode. Developer toggle screencast mode. And what this is going to do is it's now going to visually display whatever key bindings or keyboard shortcuts I'm using or actions that are happening. So you can get that available to you and I'll do my best and Cecil as well to keep this on throughout the rest of the course. You'll also notice every time I click, it'll highlight in red as well. So if you're somebody that wants to create a video or tutorials or anything like that, or you're displaying doing a presentation to your colleagues, it might be a setting you might want to turn on to help improve the experience of those folks that are viewing that. All right, so let's jump into some of my commonly used keyboard shortcuts that I find useful. First up, we talked about control shift P, right? That brings up the command palette and then I can search for any other command that I want. If I want to add one like a custom one. So this one right here, like open settings UI doesn't have any. Keyboard shortcut associated with it. I can click edit on it. And then in this case I can go add and then put that one in there too. So that's just a heads up on that one as well. Another way to go about adding, instead of overriding keyboard shortcut, you can add a keyboard shortcut. Another one I commonly use is once I have a file open that I want to edit like this one here, the API dot PI, I don't need to see the Explorer view or whatever it might be open. Maybe I have run and debug open anything in the side panel. If I want to minimize that I press control B. And that toggles the visibility of the primary sidebar as you saw here. Now really quick, this is a personal preference. I don't really like this view being on the right hand side because of how common I use this keyboard shortcut and you see how visually jarring it is to keep my eyes on the code when I'm doing that. So what I like to do is I like to turn, move the activity bar and this whole Explorer view sidebar rather to the right hand side. And the way you can do that is bring up the command palette. and it's toggle primary sidebar. And you can see that it's in the right hand side. So I'm going to go ahead and drag and drop this. And you notice now it's on the right hand side. And when I press control B now to hide that visibility of that, notice how it's less jarring. I love that. It's so much better. Thank me later. All right. So that's control B. Now, if I need to use the terminal to run any type of commands on my operating system or Python commands to run things, what have you, if you need to view the terminal, the way you do that is control back tick. And you'll notice it popped open this terminal here. And then I can start running whatever commands I want. I need to do here, like clear the screen or whatnot. Right. Change directories, all that fun stuff. If I want to hide that though, I just press it again. Now, one other thing that I personally edit is the whole that's to bring up specifically the terminal view. Then there's other ones for the debug console, maybe the output. You can see I'm hovering over them or any problems that, VS Code is trying to alert me to about my project. Remember that control back tick is specifically to bring you to the terminal and oftentimes this bottom panel. I always. Have the terminal tab visible in here, but I want to sometimes just hold like a quicker keyboard shortcut. It's a little hard for me to like my dexterity in my hands to press control back tick every time. Although I do use that sometimes. So I added another keyboard shortcut control J to toggle the panel visibility. Now, the reason I'm calling this out is if I have the debug console selected in here and I press control J to hide it and bring it back. It's always whatever the last visible tab in the bottom panel. Was open is what's going to show up in there. So that's just something to note. And the reason I did control J, it's one of those keyboard shortcuts. It's not associated with anything else. And I also added one because you can expand the terminal or this bottom panel to take up the full view, within Visual Studio Code. If you normally, you would just click on this. I added a keyboard shortcut instead of having to click on that. I added control shift J. Oh, it's not in this profile. Actually, let's go at it real quick. So if I want to add one, I know that this action or command is called. Maximize panel by hovering over it. So let's bring up the keyboard shortcuts, open keyboard shortcuts, and I'm going to search for, let's clear this from before. I'm going to search for maximize panel. I'm going to click plus control shift J hit enter. It said one existing command use that. Okay. Well, I don't know what that other existing one was. Let's try that again. Really quick. Out of curiosity. You can click on that to see workbench action search toggle query details. Yeah, I never really use that, so I don't know about that one. So it's okay that I'm overwriting that for my purposes, maybe not for yours. Okay. So what does that do now that I added that well control J just hides and shows that bottom panel. But when it's small like this, I can press control shift J to maximize it and then bring it back to its previous size. The nice one to have that I like in a little, little added bonus tip in there for you. Okay. Well, we talked about control shift E to show the explorer view or control B just to hide it in general. Kind of like control J. What's what else do we have here? If I need to search for something within a file, I press control F and that brings up the editor view file search. So if I want to find, yeah, like shows router or API dot anywhere I'm using that I can then see that you can expand this to then replace it as well, which I believe the toggle replaces a there's a keyboard shortcut associated with that too. I thought as well. But I might be wrong on that. You notice this one replace you hit enter. If you wanted to replace API with like, I don't know, test that first one probably messed it up or no, I just typed it there. So here's a keyboard shortcut. I use that with any text editing type of software. These are common keyboard shortcuts that maybe you already know, but just in case folks that don't know, like I made this mistake that I want to undo control Z will undo that. And so now that API was changed back to, or from test to back to API rather. Close that out. All right. So that is control fine. But if I want to find like a certain string of text through my whole project that or workspace that I'm having, I currently have open, I can press control shift F and that brings up the broader search view, which now I can look for API in across the entire project anywhere. That instance is not just in the currently open file API dot PI. I'm looking in project Tomel PI project Tomel ring, read me and all that fun stuff there. And then if I want to clear that, I can hide that control shift F to toggle it back off or no rather let's just do control B to hide that. Okay. Next up, speaking of editing, let's hide that for a second while we're editing some keyboard shortcuts more. We talked about control Z. What else can we do in here that I use often is there's a thing called multi-cursor actions in Visual Studio Code that you might not have in a regular old text editor, like notepad or something like that. And that is possible by one. There's a couple of different ways you can actually make that possible. One common way that I do it is let's say I wanted to edit all of these three lines of API dot to something else. I can press on Windows and Linux control alt down arrow down arrow and you'll notice there's two or two or three now blinking cursors. And as I move it over, they're moving in in concert together there. Right. And now I can press like control shift right arrow to select that. Okay. And I can say maybe I want to call that test instead. Right. And you notice how it edits multiple lines at the same time, all in sync together. So keep that in mind. One other way to go about doing this. If you have like a common function name or something like that, you can press F two over it and it's like edit enter to rename shift, enter to preview. So if I call that test now and now I'm, you know, assigning tests to FastAPI, and then I can use the functions off of that as well. I want to do that again. That's another way to do it. F two is to rename when you're renaming like a variable. That's something that's specific to Visual Studio Code, but maybe you have like a string of text that is not necessarily a variable that you want to edit and you know, it's in multiple places, even in comments and stuff like that. Well, in that case, you can highlight it and then you can, and you notice how VS Code kind of highlights the other ones that are even case insensitive throughout the rest of this file. I can press control D to select each instance of that slowly. So I wanted those three in just the comment there. I want to change that to like test if I wanted to as well. It did that in all cases, if I want to select all of them at once. So I go like this and I can press control shift L and that selects all instances at once. So control D to select them slowly, but surely for which one that you want. In fact, you don't even need to have it selected. You can just have the cursor right in front of it. And then it'll slowly add. Actually, if you want it, if you want it to be case insensitive, you should select it. I'm just realizing this now making this, but if you don't do that, you're going to have to do it. Then you can just press control D and step through each one that you want. So maybe I didn't want that last one. I go back up to the top here. It allows me to slowly pick which ones I want there. Okay. All right. What else we got control shift L we talked about control shift D. What does that do? That will bring up the debug view, right? In case you're done editing, you're ready to run your Python code. Now you can come in here and use the run and debug view within Visual Studio Code. Let's hide that. We got next, we got control slash. This should be fairly common for most developers in Visual Studio Code. If you want to comment out a line of code, you bring your cursor to that line and you press control forward slash. And that will comment it out. And you notice it uses the appropriate one for the language that we're working within. In this case, Python. If you want to undo that control Z again, if you want to redo something, we've been talking about control Z. If you want to redo it, you can press control shift Z to redo that thing back and forth. So if control Z to undo controls, Z, two, one, and then you're done. You can press control shift Z to redo control shift Z to redo rather control space. Something I want to tell you about. That's I think specific to Visual Studio Code, maybe some other editors and IDs out there help with this. But the interesting thing here is let's say API. Now, typically when you press dot, it will bring up this what's called like IntelliCode IntelliSense that's available in Visual Studio Code to let you know of all the different properties and functions that are available for that particular item. If that doesn't show up for you, you can manually trigger that by pressing the button. You can also trigger that by pressing control space. Sometimes that happens to me and that way I can start intentionally turning that visualization on and I can explore for which one I want. You can start typing out what I might be looking for and that highlights it even more for me. Highlights more specifically what might be relevant to what I'm looking for. Getting towards the end of the shortcuts here and there's plenty here. This is not a comprehensive list of shortcuts, but it's one of the common ones that I like to use. F5. I'm not going to press it right now. But you can. If you're using our project, they'll be there for you. If you're using our project, they'll be there for you. But if you're creating your own, you can get into creating a what's called a launch configuration in Python. More on that in another video. And last but not least, we talk about custom shortcuts. I showed you one, my control J and control shift J. One other one that I like to do is sometimes Visual Studio Code is a little bit more complicated. I'm going to show you how to do that. So let me head back into the keyboard shortcuts view and walk through adding one of my own. The flow is the same as what we did with maximize panel — find the command, click the plus icon, and assign whatever key combination you want. The nice thing here is once you start doing this for a few commands you use all the time, your hands just learn the bindings without you having to think about it. You can also export your keybindings as a JSON file, which is handy if you want to sync them across machines or share them with a teammate. If you scroll through the list here, you'll see there are a lot of commands that don't have any binding at all by default, so there's plenty of room to add your own. Just be a little careful about overriding existing ones — VS Code will warn you if there's a conflict. And if you ever want to undo what you've added, you can right-click the entry in this list and reset it back to the default. So that's how you go about wiring up your own custom shortcuts in Visual Studio Code. The big takeaway here is to lean on the visual cues in the menus, the command palette, and this shortcuts view to discover what's available. And then over time, slowly add the ones you find yourself reaching for again and again. That's the gist of it. for custom and common keyboard shortcuts in Visual Studio Code. In the next video, we're going to start talking about extensions that you can use that are just common ones that me and Cecil like. We're going to present those to you and talk a little bit more about them.
|
|
|
transcript
|
9:31 |
Hello, everyone. Welcome into this next module. We're going to be talking about extensions and themes for Visual Studio Code. And this is part of VS Code that makes it customizable to your needs, the way you want your environment to be when you're developing so you can stay productive and efficient. And I love this functionality and capability within VS Code. How about you, Cecil? Yeah, for sure. I mean, VS Code works with so many different environments, different programming languages, different types of applications. And so being able to customize it to do the thing you want it to do and, you know, work in the way that you want it to work, I think is huge. So why don't we start off with me talking about one of my favorite extensions, which actually happens to be the REST client. Now, this one's really important to me because I, you know, I'm not a UI developer. I don't, you know, move bits on the screen and work with CSS and things like that. I usually exist in the backend, right? Yeah. So I'm not a UI developer. I don't, you know, move bits on the screen and work with CSS and things like that. I usually exist in the backend, right? So a lot of what I do day to day is building APIs, and the REST client extension lets me write HTTP requests right inside a text file in VS Code and fire them off without ever leaving the editor. You just create a file with a .http or .rest extension, type out the request like GET or POST and the URL you want to hit, and you get a little send request link right above it. Click that and the response shows up in a side panel — status code, headers, body, all the things you'd want to inspect. The really nice part for me is that the request files live alongside my code, so I can check them into source control and share them with the rest of the team. No more juggling separate API client apps or copying curl commands around. Everything stays in the same window. Brian, anything you'd add on the REST client side, or do you want to jump into one of your favorites next? Yeah, that's a great example, and there are tons of others worth mentioning — things like the Python extension itself, GitLens for Git history, and so on. We'll touch on a few of our personal picks throughout the module. The main thing to take away here is that extensions are how you tailor VS Code to the way you actually work, so spend a little time poking around the marketplace and see what fits. In the next videos, we'll dig into installing extensions, where to find them, and a few more recommendations from both of us.
|
|
|
transcript
|
5:52 |
All right, so all this time, Cecil, we've been talking about more what I would describe as like functional extensions, but that's which is great. It helps enhance your developer workflow and improve that type of thing, your productivity and efficiency in Visual Studio Code. But let's get to some more of the visual style type of things that we would like to get into, which are theme extensions. That's how you can change the color and styling of Visual Studio Code is through theme extensions. So do you have one that you prefer that you use day in and day out? You know, what's funny is I switch my themes all the time. Oh, okay. You know, I like dark themes. I like light themes. I'm not one of those folks that like dark themes all the way. Yeah. Like, you know, light themes are evil. But, you know, depending on the time of day, you know, you switch your themes up, you know, it's kind of like, you know, switching clothes when you get up in the morning. So one of my favorite themes that I use a lot is called Cobalt 2. You know, regardless of whether I'm working late at night or during the day, you know what I mean? I'm a big fan of like how prominent it makes the actual code look, right? And I don't feel like the IDE is like getting in my way with distractions. Like, as you can see here, like I'm looking and... And you can see how my imports are very much like in my face, right? And the methods we're calling are very much prominent in the code. But I think that's important for me. Yeah, I like that. It's definitely one of the ones that I've used in the past. And I'm similar. Like, I tend to fluctuate in which themes I use because, you know, you like changing it up. It feels different. It feels fresh. And Cobalt 2 is one of those ones that I put in my rotation as well. And I tend to lean towards darker themes. But in certain situations, like if I'm outside... I'd rather have a lighter theme so I can read my screen a bit easier. So I'm not going to show a light theme because I generally, like 90% of the time, I don't. But this is Cobalt 2. And if folks didn't catch, the quick way you can switch between themes is bringing up the Command Palette, Control Shift P on Windows and Linux, Command Shift P on Mac. And you just type in color theme or just theme and you pick preferences color theme. And then you can actually, for ones that you already have installed, you can cycle through them quickly. But if you don't have it installed, you can just search for it. Like, and it would help you in a way. And it would help you install it from the marketplace type of thing. In any case, the one that I want to talk about is Night Owl. That's one of the ones... There's a couple different variations of it, but look at that. Isn't that beautiful? It's just so pleasant on the eyes. And I like this one because it's just... The different syntactic styling it does for me stands out a bit better. Typically, I'm switching between Python and JavaScript code and this tends to lend itself well in that regard to stand out for certain things. For certain keywords in the languages there. And there's the ability to be italicized or not. I generally don't have it italicized. I go like this. But you'll notice that, like, depending on the font you're using with Visual Studio Code, which is yet another customization you can do, it will enable you to support italicized themes. If your font supports italics, then your theme will pick up on that and enable it as well if the theme supports it. So you need both to go hand in hand in that regard. So, just to show the difference of that real quick. Alright, what's your next theme, buddy? Nice. The next theme I have is the GitHub theme. Ooh, which one though? There's a bunch. Well, so here's the thing. When you install the GitHub theme package, it gives you a lot of different options, which I think is great. So you get GitHub dark, GitHub light. So it's a theme that has multiple themes, it has multiple variations. Very similar to how you showed the... Whoa! It's so bright! Oh. It's very similar. Very similar to how you showed the Night Owl theme, and there's different variations to Night Owl. There's also different variations to the GitHub theme as well. But one of the things I like about it is it's simplistic, it's minimal. And that's one of the things that's important for me in a theme sometimes, right? Like, I just want something simple. I don't want too many things going on. Because at the end of the day, my goal is to, like, focus on the code. And like I said earlier, I like to switch back and forth. So, you know, depending on how I'm feeling, I might be using the light theme. But if I'm feeling like I'm going to be doing this later at night and I kind of want to dim things down a little bit, I'll switch over to the dark theme. So I love having the option of, you know, still staying within, like, the same style, but now I'm just switching back and forth between, like, those different light and dark options. Yeah. No, that's cool. I think I like this one the best. It's the GitHub dark default. You got to watch out for those other ones. You got to be careful. Those light themes will creep up on you. High contrast is a pretty cool tool. All right. One last one before we close things out. It is the Houston theme I want to talk about. You can see it's very similar to the ones we were talking about earlier. Again, another dark theme. I like that it's a little bit more, like, if I need a little bit more highlighting in terms of the syntax of the code, it's a noticeable difference now. And, again, you can even keep these preferences to different profiles within Visual Studio Code, which we talked about in a previous module or previous video. And those profiles will isolate those changes. So maybe you have a profile for doing Python development. Maybe you have a profile for doing Node.js. Maybe you have a profile for doing Node.js development and so forth. You can have different themes and languages and setup in your Visual Studio Code. You capture it all to fit your needs for that workflow that you're going through. Yeah, I agree with you. One of the things that I like to do is I'll have certain themes and extensions and just configurations set up for personal projects, for work projects. Maybe just change the colors so I know, oh, okay, well, this one belongs to this and this one belongs to the other one. So I have a visual indicator of, oh, okay, well, this belongs to a client. This is for work, so this is, like, the serious one, right? Like, I need to be careful what I do over here. Yep. Well, that about rounds it up, then, for everything that we want to talk about in the extensions and themes video. Hope you all enjoyed it and got some good tips out of it.
|
|
|
transcript
|
2:10 |
Alright, that was fun and we hope you enjoyed that module as much as we had fun putting it together. Let's quickly summarize what you learned so that you can reinforce that throughout this closing here. So, first of all, we learned about the user interface of Visual Studio Code and got an interview to get acquainted with that and the different aspects of it that we should know about as first-time users of Visual Studio Code. Then we talked about the activity and secondary sidebars. These and what their functions and purposes are for Visual Studio Code and how we can use those to our advantage. We talked about the command panel and how it is the gateway to all things and actions and settings and whatnot that are capabilities within Visual Studio Code that we can do right from the keyboard without even having to lift our hands over to the mouse. We talked about the Explorer and how that allows us to view different files and folders and then workspaces to help us aggregate different folders, structures together as part of one project. We took a look at the status bar and what information that provides to us. While we're writing our code, while we're using Visual Studio Code and it gives us at a glance information for us. We talked about the terminal and how that enables you to take terminal-based actions within Visual Studio Code without having to jump into a separate tool to handle that purpose. We covered the settings in Visual Studio Code that allows you to customize it to your liking but also for whenever you add new things to it like extensions that have its own settings to it. You go there to customize. You can customize that and configure things the way you need. We covered common shortcuts that you would use to help improve your efficiency and use of Visual Studio Code to hide and show different aspects of the UI or execute certain actions within the editor so that you can work productively on your Python projects in VS Code. And last but not least, Cecil and I shared some of our favorite extensions, just a couple, and themes that we like to use to help enhance our overall development experience and make the editor a little bit of our own with the different themes, and options that we have there. We hope you enjoyed it. The next module, you're going to learn more about the experience of writing Python code and what you can do there within Visual Studio Code.
|