I am coming from a VScode background , and for my recent project (on Deep Learning) I am having to manage huge code files in Spyder (Version 3), and I am not seeing any option of code folding?
I am not willing to switch to another IDE , as Spyder is very productive for my project.
Please suggest any hack to do it , if it is not there in the Spyder codebase.
In the Spyder 4.0+ version, go to View menu, unselect "lock panes and toolbars" then you can drag the top area of each pane and move them freely.
How do you show indents on Spyder? Select your code and press Tab or Shift + Tab to indent or un-indent it.
In Spyder 4 the keyboard shortcut to run the highlighted lines of code is F9. and if you want to use any other shortcut then you can change it from TOOLS>>PREFERENCES>>KEYBOARD SHORTCUTS then double click on any shortcut you want to change and change with your shortcut.
It maps alt+1 to fold the first python indent level (class definitions and functions), alt+2 to fold the second level (class methods), and alt+0 to unfold everything. It makes sure it only folds one level and doesn't fold any of the nested sub levels. You can still use za to toggle folding for the current block.
(Spyder maintainer here) You can install the first beta of Spyder 4 to get code folding.
If you use Anaconda, you need to use the following commands:
conda update anaconda
conda update spyder
or if you use pip, then you need to run
pip install -U --pre spyder
This beta is quite stable and it has been tested for more than a year.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With