Useful Pycharm shortcuts

Othmane Ghandi
Analytics Vidhya
Published in
4 min readFeb 24, 2020
Python IDE

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 + d
  • 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 + f
  • 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 + f
  • ctrl + shift + up/down or Alt+ shift + up/down:

It helps you move efficiently your selected lines to another place

ctrl + shift + up/down or Alt+ shift + up/down
  • ctrl + a then ctrl + alt + i:

This is a good shortcut that help organize/auto-indent your code

ctrl + alt + i
  • Ctrl + a → Ctrl + Alt + L:

It helps formatting your code based on the suggested code style (PEP8)

  • Alt + Enter:

Import the missing packages

Alt+ Enter
  • ctrl + Alt + O:

Optimizes your imported packages, remove the unused ones

ctrl + Alt + O
  • 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

change or add a shortcut

I hope that I was helpful

Othmane Ghandi, With love ❤

You can find me easily in Linkedin, Twitter

--

--

Othmane Ghandi
Analytics Vidhya

Senior ERP Consultant | Python developer | Business software developer | Live in Berlin, Germany