Productive coding in PyCharm | Getting started

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi everyone I'm Helen Scott from jetbrains and this is our pycharm a getting started video series today we're going to take a look at a bunch of tips and tricks that you can use to be more productive in your IDE [Music] [Applause] [Music] before we start I'd like to ask you to subscribe to our Channel our data says that nearly 80 percent of you have yet to subscribe if you like this and other videos in our series please make sure you click like And subscribe so you don't miss any future updates from the pycharm team let's move on to the episode in this video we're going to take a look at how you can minimize distractions navigate through your code generate new code and some productivity hacks that will help you to do the things you do most often faster for example sometimes you just want to focus on the code and you want to get rid of everything else you could of course close toolbars one by one with your mouse or you could use the keyboard shortcuts to close each toolbar but the best way to get a code only view is with view appearance enter Zen mode if like me you're quite fond of your line numbers you can get them back by right clicking in the gutter and selecting appearance show line numbers it probably won't surprise you to learn that you can leave Zen mode with the same menu you used to enter Zen mode so next time you need some headspace consider using ZEM mode to full screen your IDE with nothing but the code [Music] my code here is not very impressive but I imagine you're working on much larger more impressive code bases so how do you find your way around you can use command and b or Ctrl and B to go to declarations or usages here we can see the question done to text has several usages and we can select one to view it another way to navigate your code is with go to implementation which is command option and b or control alt and B as you have probably guessed this takes you to the well implementations in our example the implementation for choice in line is just further up in this class another top tip I have for you on navigation is to use command and square brackets or Ctrl alt in your arrow keys to move backwards and forwards through your code base in the order that you navigated through it navigating your code in this manner is a great way to build up your mental model of the functional aspects of your code base rather than digging through sequentially or perhaps even randomly [Music] generating code is not being lazy it's getting pycharmed to do the heavy lifting so you don't have to let's look at how you can be more productive by typing less first up let's look at what code we can get pychon to generate for us you can use command and N or alt and insert to get pycharm to offer code that's relevant for the context if you're inside a class we're going to get different options than if we were inside the project tool window for example pycharm will always try and do the right thing based on what you're typing the method of completion might be through live templates or post-fix completion or smart type based completion but if you're interested in learning what's available check out the links in the description so next time you think you need to type out some code constructs go ahead and see what pycharm can help you with it helps you to concentrate on the fun stuff [Music] our next stop on this tour is surround with now this feature doesn't sound particularly impressive but there's lots of really cool things you can do with it to save you time first up consider this python code for the question variable we can use surround with so command option and T or control alt and T and then select any of these options if well try accept or try finally let's go with try finally and see that pycharm has filled in the code construct for us how about this HTML code here we can use the same functionality again to wrap question dot questioned under text in a Django template let's say you want to hide this piece of code so you can focus on the rest of the file once again let's use surround with and this time we'll select editor fold and done there are more contexts that you can use surround with including XML HTML and JavaScript check out the documentation for more information [Music] sometimes you might need or want to come back to some code later maybe you want to add some functionality or fix something up that's not critical right now but you don't want to hold that information in your head let's say we want to come back to this line and fix it up later so we'll add a little comment here and we'll include the phrase fix me now when we load our to-do window the comment that includes the phrase fix me appears of course you can also use the phrase to do to get the comments to show up in your to do tool window the to do tool window shows both the to-do and the fix me comments so we can keep track of all those tasks that we need to come back to next time you think you need to hold that to-do list in your head or on that Scrappy piece of paper on your desk that we all have let pychon take the strain [Music] this tool would not be complete without a quick look at two top shortcuts that I recommend you learn and remember because they are the launch pad for all of the shortcuts first up we have search everywhere double tap shift twice and start typing in what you're looking for example editor tabs let's go into the menu and turn our editor tabs on perfect how about searching for test if we then tab along the top of the dialog we can filter what we're looking for and we can even look in our git commits super cool trick that you can do with search everywhere is calculations pychon will show you the results in your search everywhere dialog all within your integrated developer environment so that's search everywhere the next shortcut is a subset of that shortcut but it can be helpful to know it just so you can search for actions so it's command shift and a or Ctrl shift in a and that will filter the search everywhere dialog to just actions now you can start typing in your action and let pycharm help you for example Zen mode and as you'd expect you can exit Zen mode the same way that you entered it if you are paying attention you will notice that you can access find actions from the search everywhere dialog either route is valid it's whatever works for you the final shortcuts that I have for you today are ones that I use all the time you probably don't need to work with all the same files at the same time so your IDE can help you to load just a small portion of them into your head with recent files recent files is command and e or control an e and it shows you well it shows you the files you've accessed recently you can use this checkbox on the top right to further filter the list to edited files as well let's say you have some really long files in your project you know the ones the same shortcut again but this time add a shift to it so command shift and e or control shift the knee the checkbox tip is the same here as well so that's it that's recent files and recent locations they're both great ways to load your working context into your head and again minimize distraction from other code that you're not actively working on right now all right that is the end of the episode we took a look at Zen mode navigating your code with go to declaration and go to implementation we took a look at how you can generate source code we made a brief stop at surround with and we ended on some shortcuts that are useful to memorize as always this is just the tip of the iceberg so you can get started for more details you can check out the documentation if you've still got questions we are very happy to answer them please put them in the comments below and once again if you like this video please hit the Subscribe button so you won't miss any future updates from the pychon team thank you
Info
Channel: PyCharm, a JetBrains IDE
Views: 5,892
Rating: undefined out of 5
Keywords: pycharm, python ide, productive codeing
Id: OoxLZILN-uI
Channel Id: undefined
Length: 10min 17sec (617 seconds)
Published: Mon Jun 26 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.