Reputation: 773
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
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
Reputation: 2585
Ctrl-] : indent
Ctrl-[ : shifting back indentation
if it doesn't work, then try:
Tab : indent
Shift + Tab : shfting back indentation
Upvotes: 39
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
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