Top 10 PyCharm Shortcuts For Efficiency | PyCharm Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys today i want to talk about 10 pycharm shortcuts that will make you more efficient and will make coding pycharm a lot more fun so let's begin with all plus enter therefore i wrote this simple program that creates a calculator object and in this case pycharm highlights an error here and if i press alt and enter while my cursor is on this calculator call this will bring up some quick fixes to resolve this error for example in this case we can use the first one or we want to use the first one to import our calculator class from a different package you can also take care of warnings with alt and enter for example this line here is underlined in yellow and if i press alt and enter here you see that we get the quick fix to reformat this whole file because there are too many blank lines and if i press enter now pycharm will fix those errors for us next up we have some line manipulation shortcuts for example this calculator has the ability to add two numbers in this case five and six and if i run this we see that um 11 is printed but let's say we want to test this function with multiple values you can use ctrl d to duplicate this line and quickly change some values and run this file again so this is pretty useful if you want to call a function multiple times and now if you want to change the order of the function call you can use ctrl shift and the arrow keys and you can change the position of one line this could also be useful in some cases if you want to refactor your code additionally we have control and x to cut a line so this will remove the whole line and if you want to insert it at a different place you can just use ctrl v and it will appear at this new place at number three we have a shortcut to comment out uh some of your code for example you can mark this block that multiplies numbers and you can press ctrl and this will automatically insert some hash characters in front of your code to comment it out and to remove those hash characters you can just press ctrl and slash again and the code will start to work again another interesting shortcut is ctrl and b and this will take you to function declarations or class declarations for example we have this calculator object here and if i put my cursor into it and press ctrl and b we get to the definition of this class and can quickly see how this class works or change some things if we need to and this works with function calls as well we can press ctrl b for example on this multiply numbers function and we see that this is a function of this calculator class and it automatically takes us there one more fun thing is that this kind of works in reverse if we are on a function declaration and press ctrl v we can see every use of our function in our project at number five we have shift shift and shift shift brings up a powerful search menu and in this search menu you can search for files classes and yeah for example we can search for our multiply numbers function and you can see that this is declared here and another useful thing is you can search for shortcuts as well so if you forget one of these shortcuts of this video then you can just search for duplicate line for example and you will see that this shortcut is control plus d another thing is you can search for settings in here for example if you search for theme you can quickly change the theme of patreon which again is very nice next up i have a shortcut that is not very pycharm specific but it is really useful in general text editing for example um if i want to print hello world the good old classic and if i type world very wrong then i could go ahead and press backspace a lot of times or i could press control backspace and control backspace deletes a whole word and i use windows my whole life and i just figured this out a few months ago through a youtube video so i really wanted to share this with you and i actually figured out that this works with ctrl delete as well so if you are at the beginning of a word and you press ctrl delete you delete the whole word at number seven we have a very amazing shortcut and this is ctrl shift alt and j so you have to press a lot of buttons but it will be worth it because for example if i have my cursor after this add here and i press ctrl shift alt j i get multiple cursors after every occurrence of the word add and this just lets me edit a lot of text very fast so i could just type add number for example i want to change this add to add number or i could do everything basically that i want and this is pretty crazy because you just got four curses and you can type with all of them simultaneously at number eight i have a shortcut that you will probably know about already and this is just alt shift and f10 to bring up your run configurations and to run your program with this specific configuration we can use the main configuration in this example we can edit our configurations and yeah probably you know about this but i just want to repeat it and a very similar shortcut is alt shift f9 and this just brings up the debug configurations if you want to learn more about debugging and specifically debugging in pycharm and how you can become better at finding problems in your code you can just check out my video on the pycharm debugger at number nine we have a useful shortcut if you want to refactor your code for example let's say we have this method here that multiplies numbers and it's called multiply numbers but let's say we want to rename it everywhere to just multiply because what else should we multiply then we can press shift f6 and this brings up this renaming dialog and in this case we can just type in our new name and press refactor and it will show us in this dialog here every occurrence of our function multiply numbers and the declaration itself and if we now press do refactor you can see that this oh sorry you can see that this function is renamed here and if we go to the function declaration we can just press ctrl v and we will see that the function declaration itself has changed its name the last shortcut for this video is just a simple navigation shortcut and it is control and e and control and e brings up this recent files dialog and will show you some of your files you recently opened and uh in this case there's not much much going on but if you have a big project and worked on some files and just want to see which files you have opened recently you can use this shortcut so this pretty much wraps up this whole video i hope this was helpful and i can guarantee you if you get used to using these shortcuts then your python experience will be a lot smoother a lot more fun and a lot more productive so if this helped you please leave a like if you have some more shortcuts or questions leave a comment and i'll see you in the next video
Info
Channel: FelixTechTips
Views: 8,703
Rating: 4.9504642 out of 5
Keywords: pycharm, tutorial, top, shortcuts, efficiency, productivity, how, to, duplicate, lines, quickfix, search, refactor, 10, comment, comment multiple, multiple comments, recent files
Id: ofR72_PxDac
Channel Id: undefined
Length: 9min 1sec (541 seconds)
Published: Sun Oct 25 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.