16

Is there any shortcut key in Spyder python IDE to indent the code block? For example, Like ctr+[ in Matlab, I want to indent the code block together.

3
  • 2
    <tab> on selection ? Commented Jun 9, 2016 at 8:59
  • 3
    I'm not familiar with Spyder in particular, but many IDEs will let you select all the lines you want to indent and then press tab; this will indent all of the select lines. Or use Shift-tab to un-indent. Here is a link to the documentation: pythonhosted.org/spyder/overview.html . It says that in the preferences dialogue box, one can find keyboard shortcuts. Commented Jun 9, 2016 at 12:15
  • Similar to stackoverflow.com/questions/37181491/… Commented Apr 24, 2020 at 19:12

2 Answers 2

41

Select your code and press Tab for indent and Shift+Tab to un-indent.

or go to Edit -> Indent/Unindent

Edit section also contains some other tools for editing your code.

Sign up to request clarification or add additional context in comments.

1 Comment

Does it indent with a tab, or with 4 spaces?
0

Spyder 4 select the lines and then press TAB or CTRL+] For indent and shift+TAB or CTRL+] for un-indent

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.