Useful Pycharm shortcuts
For every programming language you can use either Code Editor or IDE to write your code:
Code Editor : or Text Editor is where you write your code like a text but you benefit from syntax highlighting for different programming languages, you can also make auto-completion and some other features, which help you be more efficient in writing your code
IDE : Integrated Development Environment it’s more powerful, it offers all the features that a code editor can give but also other useful features : Debugging, Version Control System (VCS), install new packages & plugins, Class mapping, a clear view for your project …etc.
So we can say that for just testing or compiling a small code, a Code Editor is a good option. but to work on project/program, an IDE is the best solution.
PyCharm (Py + Charm: Python is Charming 😆 just kidding) is one of the most widely used IDEs for Python programming language, developed by JetBrain.
In this article we will show you some useful shortcuts to use for Pycharm (JetBrain soltutions in general) which will help you be more efficient and save time for you (+ Make you look like a geek even if you are not 😉 )
let’s dive into these shortcuts :
- ctrl + a : Select all the text inside your file
- Alt + up/down : jump from a function to another
- ctrl + e: Shows you the recent visited files
- ctrl + d :
We all know ctrl + c & ctrl + v => ctrl + d is like a combination of both or to be more exact is a way to duplicate your text
- ctrl + f:
It will open a search bar to look for a specific work/sentence in your file, you can also select the expression that you want to look for and then press ctrl + f it will put it automatically in the search bar
- ctrl + shift + f:
It does the same thing as ctrl + f but it will give you more searching options : specify the directory to look in, possibility to choose the type of files to check (*.py, *.xml …), Match case …etc
- ctrl + shift + up/down or Alt+ shift + up/down:
It helps you move efficiently your selected lines to another place
- ctrl + a then ctrl + alt + i:
This is a good shortcut that help organize/auto-indent your code
- Ctrl + a → Ctrl + Alt + L:
It helps formatting your code based on the suggested code style (PEP8)
- Alt + Enter:
Import the missing packages
- ctrl + Alt + O:
Optimizes your imported packages, remove the unused ones
- ctrl + k:
Quick way to open the window to commit your changes when you are using Version Control System (VCS)
- ctrl + alt + shift + delete + insert + j + enter :
Calm down !! you are not an octopus to press all this buttons at the same time 😜
Conclusion
You can have a look at all the shortcuts by going to : File -> Settings -> Keymap
You can also change or add a shortcut to this list
I hope that I was helpful
Othmane Ghandi, With love ❤