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

12,891

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
Share:
12,891
Nam G VU
Author by

Nam G VU

I love to learn and try new stuff; dreaming to create ones someday!

Updated on June 09, 2022

Comments

  • Nam G VU
    Nam G VU about 2 years

    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.

  • Chandan Nayak
    Chandan Nayak over 5 years
    selecting a character is the key, I was used to vs code where just keeping the cursor does the indent work.
  • Nam G VU
    Nam G VU over 5 years
    @ChandanNayak What is your point about vscode, I don't get it?
  • Chandan Nayak
    Chandan Nayak over 5 years
    I wanted to say - on vs code I do not have to select any character by just placing the cursor anywhere on the line and hit cmd + }/{ to do the indent. But with pycharm i needed to select a word/character to do the indent. Because it just tabs outward from the cursor with pycharm.
  • Nam G VU
    Nam G VU over 5 years
    Got it. Thanks for sharing. But working with Python the opensource way, vscode from microsoft should not be the IDE for us I think.
  • qiz_newbie
    qiz_newbie about 2 years
    there is a keymap named "indent Line or Selection",it dont need to select any text @ChandanNayak