Search code examples
pythonsublimetext3pep8

PEP8 function definitions and Sublime Text 3 code folding


If I have a function definition which spans multiple lines to keep in with PEP8 such as this:

def compile_time_table(daily_id=999, weekly_id=999, yearly_id=999, user=None,
                      zone_id=None, zone_name=None):

Sublime Text looses its ability to fold the definition:

Sublime Text 3 not folding

Is there some way to fix this?


Solution

  • For Sublime Text 3, there is a Code Folding option in the menu where EDIT resides. Click on it and choose Code Folding. Here you can see the folding methods and shortcut keys. Use the keybord shortcuts Ctrl + K and Ctrl + 1 to fold all your functions, unless you changed the default shortcuts.