PyCharm Jupyter NoteBook Keymap for Windows and Linux users¶

Open in Google Colab Open in Binder

Editing¶

Ctrl + Space¶

Basic code completion (the name of any class, method of variable, command for terminal)¶
In [ ]:
%conda --version
%pip --version
%pwd
%ls -la

Ctrl + Alt + Space¶

Class name completion (the name of any project class independently of current imports)¶
In [ ]:
%conda

Ctrl + Shift + Enter¶

Complete statement¶
In [5]:
print("Ctrl + Shift + Enter")
Ctrl + Shift + Enter

Ctrl + P¶

Parameter info (within method call arguments)¶
In [ ]:
print()
abs()

Ctrl + Q¶

Quick documentation lookup¶
In [ ]:
print() 

# @overload def print(*values: object,
#           sep: str | None = " ",
#           end: str | None = "\n",
#           file: SupportsWrite[str] | None = None,
#           flush: Literal[False] = False) -> None
# Prints the values to a stream, or to sys. stdout by default.
#  
# sep
# string inserted between values, default a space.
# end
# string appended after the last value, default a newline.
# file
# a file-like object (stream); defaults to the current sys. stdout.
# flush
# whether to forcibly flush the stream.
# `print(*values, sep=" ", end="\n", file=None, flush=False)` on docs. python. org

Shift + F1¶

External Doc¶
In [ ]:
input()

Ctrl + mouse over code¶

Brief info¶
In [ ]:
x = 4
x = x + 2
print(x)

Ctrl + F1¶

Show descriptions of error or warning at caret¶
In [ ]:
3x = 7  

Alt + Insert¶

Generate code...¶
In [ ]:
y = 5

Ctrl + O¶

Override methods - OOP¶
In [ ]:
class A:
    
    def __init__(self):
        x = 2
        self.x = x
      
    def add(self):
        return self.x + 2

    def __format__(self, __format_spec):
        return super().__format__(__format_spec)
    

Ctrl + Alt + T¶

Surround with...¶

Ctrl + /¶

Comment/uncomment with line comment¶
In [ ]:
# x = 5
# print("x: ", x)

Ctrl + Shift + /¶

Comment/uncomment with block comment¶
In [ ]:
# x = 5
# y = 1
# print("x: ", x, "y: ", y)

Ctrl + W¶

Select successively increasing code blocks¶
In [ ]:
x = "Hello PyCharm!"

print(x)

print(type(x))

Ctrl + Shift + W¶

Decrease current selection to previous state¶
In [ ]:
x = "Hello PyCharm!"

print(x)

print(type(x))

Alt + Enter¶

Show intention actions and quick-fixes¶
In [ ]:
x = ".5, "4"
print(x)

Ctrl + Alt + L or Ctrl + Alt + Shift + L¶

Reformat code¶
In [ ]:
x=2
print  (  type(x))

Ctrl + Alt + O or Alt + Enter¶

Optimize imports, Import this name¶
In [ ]:
x = numpy.random.random(100)

Ctrl + Alt + I¶

Auto-indent line(s)¶
In [ ]:
def test_function():
            print("Automatic indent for line1")
            print("Automatic indent for line2")
            print("Automatic indent for line3")

Tab / Shift + Tab¶

Indent/unindent selected lines¶
In [ ]:
def test_function():
            print("Automatic indent for line1")
    print("Automatic indent for line2")
    print("Automatic indent for line3")  

Ctrl + X or Shift + Delete¶

Cut current line or selected block to clipboard¶
In [ ]:
def test_function():
 
    print("Automatic indent for line2")
    
               print("Automatic indent for line1")
    
    print("Automatic indent for line3")  

Ctrl + C or Ctrl + Insert¶

Copy current line or selected block to clipboard¶
In [ ]:
x = 5
x = 5

Ctrl + V or Shift + Insert¶

Paste from clipboard¶
In [ ]:
x = 5
x = 5

Ctrl + V or Shift + Insert¶

Paste from clipboard¶
In [ ]:
x = 5

Ctrl + Shift + V¶

Paste from recent buffers...¶
In [ ]:
x = 5

Ctrl + D¶

Duplicate current line or selected block¶
In [ ]:
x = 5
x = 5
x = 5
x = 5

Ctrl + Y¶

Delete line at caret¶
In [ ]:
x = 5
y = 2
x = 5

Ctrl + Shift + J¶

Smart line join¶
In [ ]:
x = 5
print(x)
y = x + 4
print(y)

Ctrl + Shift + NumPad+¶

Expand all¶
In [ ]:
x = 5
print(x)
y = x + 4
print(y)

Ctrl + Shift + NumPad-¶

Collapse all¶
In [ ]:
x = 5
print(x)
y = x + 4
print(y)

Ctrl + F4¶

Close active editor tab¶
In [ ]:
x = 5

Search and Replace¶

Ctrl + F¶

Find¶
In [ ]:
x1 = 5

F3¶

Find next¶
In [ ]:
x2 = 5
x1 = 1
x2 = 4
x1 = 1

Shift + F3¶

Find previous¶
In [ ]:
x2 = 5
x1 = 1
x2 = 4
x1 = 1

Ctrl + R¶

Replace¶
In [ ]:
x5 = 5
x3 = 1
x5 = 4
x3 = 1

Ctrl + Shift + F¶

Find in path, projects, module, directory, scope¶
In [ ]:
path = "/home/sysadmin/project"
x = 5

Ctrl + Shift + R¶

Replace in path, projects, module, directory, scope¶
In [ ]:
path = "/home/sysadmin/project"
x = 5

Run and Compile¶

Alt + Shift + F10¶

Select configuration and run, files with extension .py¶
In [ ]:
x = 5
print(x)

Alt + Shift + F9¶

Select configuration and debug, files with extension .py¶
In [ ]:
x = 5
print(x)

Shift + F10¶

Run, files with extension .py¶
In [ ]:
x = 5
print(x)

Shift + F9¶

Debug, files with extension .py¶
In [ ]:
x = 5
print(x)

Ctrl + Shift + F10¶

Run context configuration from editor¶
In [ ]:
x = 5
print(x)

Links:¶

PyCharm Create and edit Jupyter notebooks¶

Run and debug Jupyter notebook code cells¶

Work with outputs¶

Manage Jupyter notebook¶