Pycharm notes

From raju

Note:- This page will be migrated to Once that is done, it will be deleted.

Current configuration

my favorite configuration

if version == 2019.3.3:

    • File -> Settings -> Appearance & Behavior -> Appearance -> Theme -> IntelliJ


    • File -> Settings -> Appearance & Behavior -> Appearance -> UI Options -> Theme -> IntelliJ
  • File -> Settings -> Appearance & Behavior -> System Settings -> Project Opening -> select "Open project in new window"
  • scrollbar -> right click -> Customize Highlighting Level -> drag it to Syntax
  • File -> Settings -> Editor -> General -> Editor Tabs -> Tab Closing Policy -> Tab limit - 20 -> OK

useful shortcuts

go to the location of current file in the project tool window

Alt+F1 -> 1


view just the functions



tags | show code outline

To go back after control clicking

  • Ctrl+Alt+Left arrow, Ctrl+Alt+Right arrow - to go back and forward
  • Ctrl+Tab - Switch to the last (most recent) tab -- similar to how Alt+Tab works


tags | coming back after navigating to a function

Jump to next/previous function

Navigating between editor tabs

  • Open a file already opened in another tab - Ctrl+Tab
  • Go to the right or to the left tab - Alt+Right or Alt+Left
  • Go back and forth through the history of visited tabs - Ctrl+Alt+Left, Ctrl+Alt+Right

view function definition


  • Ctrl+NumPad Plus - Expand the current fold
  • Ctrl+NumPad - - Close the current fold
  • Ctrl+Shift+Plus - open closed folds


tags | expand import stanza by keyboard


switch between open projects

  • Window | Next Project Window Ctrl+Alt+]
  • Window | Previous Project Window Ctrl+Alt+[
  • Window | <ProjectNameOrLocation>

project tool window


  • format the whole file - ctrl+alt+L
  • format a selection - ctrl+alt+l


tags | realign selected code

change indentation

multiple selections

To select multiple blocks of text

    select first block normally
    press ALT key for all the subsequent blocks.


run git bash in the terminal

  • File -> Settings -> Tools -> Terminal -> Shell path = "C:\Program Files\Git\bin\bash.exe" --login

The quotes are important


add new python interpreter

tags | python interpreter not available in the run configuration

Click the Project Interpreter widget in the lower right hand corner of pycharm window.
See for a pic. It is part of the status bar which is at the bottom.
-> Add Interpreter

change python console interpreter

File -> Settings -> Build, Execution, Deployment -> Console -> Python Console -> select the Python interpreter from the dropdown.


go to a line

Use Ctrl+g

sort after

  • search for whole words - \bfoo\b




Run -> Edit configurations -> Environment variables -> click the three dots icon

Add something like


Send output from a run to a file

    Edit Configurations -> Logs tab -> check "Save console output to file" -> provide the full path of the output file.

This will redirect both standard output and standard error. On subsequent runs, it overwrites the previous file.


missing features

  • Pycharm does not correctly hightlight a multiline todo item inside the comments. It assumes that a todo item is always just a single line.


  • If you have a split screen, it is not possible to click on a function call and have its definition open in the other split screen.


tags | open function definition in a different split

functions are not clickable

tags | cannot find function, not able to find imported functions, python path files in another directory, sources root, control click, functions are not clickable

Add appropriate directory as a content root

    File -> Settings -> Project: foo -> Project Structure -> Add Content Root

See also:

convert single quotes docstrings to double quoted docstrings

Code -> Inspect Code -> Whole project -> Python ... -> Convert docstring to the triple double-quoted string form


key words

  • navigation bar

wrap lines

    View -> Active Editor -> Soft-Wrap


useful videos


block selection

  • You can easily make column selection by dragging your mouse pointer while keeping the Alt key pressed.

How can I

show all unresolved references

    Code -> Inspect Code