Nam G VU
Nam G VU

Reputation: 35364

PyCharm hotkey to indent/un-indent a line at caret?

Currently we can move a line up/down by alt+shift+UP and alt+shift+DOWN

Though, when we have moved the line to target position and want to indent it, we have to go to the beginning of the line to tab/shift-tab.

I wonder if we can do that right away at caret position i.e. without having to move to the begin of line.

p.s.

My google results as this page put ctrl+alt+I not work for me.

Upvotes: 7

Views: 36740

Answers (2)

qiz_newbie
qiz_newbie

Reputation: 417

By default, the tab key execute action "indent Selection",so you must select some text. there is a keymap named "indent Line or Selection", you can use tab as its shortcut.then you dont need to select text (my pycharm version:2020.1.3)

Upvotes: 1

Nam G VU
Nam G VU

Reputation: 35364

As @cdbajorin answered, it's just one more step - selecting a character to indent whole line i.e. no-selection will indent text on the right only.

If you select a single character on the line, tab/shift tab will do the

Upvotes: 17

Related Questions