Legolas
Legolas

Reputation: 773

shortcuts for editing code indentation in jupyter notebook

Are there any shortcuts for code indentation editing in a jupyter notebook like available in VScode, sublime, etc? Specifically, I need help for shifting back a selected piece of code by one tab space.

Upvotes: 19

Views: 65580

Answers (4)

Olupo
Olupo

Reputation: 420

I don't know how it works in VScode, but for indentation in Jupyter Notebook you just have to mark the line/lines that you want to intend and then press SHIFT+TAB for back shifting the indentation or TAB for indentation.

Upvotes: 4

one
one

Reputation: 2585

Ctrl-] : indent
Ctrl-[ : shifting back indentation

if it doesn't work, then try:

Tab : indent
Shift + Tab : shfting back indentation

Upvotes: 39

GOVIND DIXIT
GOVIND DIXIT

Reputation: 1828

You can select the code block using Ctrl + A and then use

Ctrl + ] indent
Ctrl + [ dedent

For complete list of Jupyter notebook key shortcuts visit here

Upvotes: 5

Emre Unsal
Emre Unsal

Reputation: 159

just select and drag from the beginning of the code piece until the line you wish for while holding alt to choose multiple indexes at multiple lines (or you can use it for rectangular selection too)

after that tab for right indentation and shift+tab for left indentation

Upvotes: 4

Related Questions