Pycharm / other IDE keyboard shortcut?

Jul 20, 2023
Reaction score
So something that I has been bugging me for a while is not knowing how to "back tab" (I guess??) a block of code. Or "Un-indent" Im not sure what exactly to call it but you probably get the idea. I know that in most coding text editors and IDE's you can highlight a block of code and press TAB and it will indent that whole block of code. And thats really useful when you are adding block statements and functions etc... But what would also be really useful is the exact opposite. To highlight a block of code and set it back an indent or two. I know its possible. I've seen other coders do it on youtube but I dont know how. I do prefer Pycharm but even if you know the shortcut in another editor please let me know, it might help me somehow.
Jan 24, 2024
Reaction score
In PyCharm and many other code editors, you can use the following keyboard shortcuts to indent or unindent a block of code:
  1. Indent:
    • Windows/Linux: Ctrl + ]
    • macOS: Cmd + ]
  2. Unindent:
    • Windows/Linux: Ctrl + [
    • macOS: Cmd + [
These shortcuts work when you have a block of code selected. If you want to indent or unindent a single line, you can position the cursor on that line and use the same shortcuts.

Note: The square brackets [ and ] are used to represent the actual keys on the keyboard.

If you're using a different IDE or text editor, similar shortcuts might apply. In general, you can look for "indent" and "unindent" in the keymap or keyboard shortcuts section of your editor's settings to find the specific shortcuts for your environment.

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Latest member

Latest Threads