ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Fold Python

by svenfraeys ST2/ST3

Intelligent Folding System for Python, developed for Sublime Text

Details

  • 2014.07.22.20.06.21
  • github.​com
  • github.​com
  • 3 years ago
  • 1 hour ago
  • 3 years ago

Installs

  • Total 5K
  • Win 2K
  • OS X 2K
  • Linux 2K
Aug 22 Aug 21 Aug 20 Aug 19 Aug 18 Aug 17 Aug 16 Aug 15 Aug 14 Aug 13 Aug 12 Aug 11 Aug 10 Aug 9 Aug 8 Aug 7 Aug 6 Aug 5 Aug 4 Aug 3 Aug 2 Aug 1 Jul 31 Jul 30 Jul 29 Jul 28 Jul 27 Jul 26 Jul 25 Jul 24 Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8
Windows 3 3 1 0 2 0 1 2 0 0 1 3 7 3 2 1 0 0 1 0 2 1 1 3 1 3 0 4 1 4 4 1 1 1 3 3 2 3 2 2 1 2 7 3 1 0
OS X 0 0 0 1 0 1 2 1 4 0 0 0 2 2 2 0 0 1 2 1 1 4 2 1 3 2 2 3 1 2 2 2 7 1 0 4 3 1 1 0 1 2 1 2 1 0
Linux 0 1 1 0 1 2 4 4 1 0 0 2 0 1 0 1 1 1 1 0 0 2 0 3 2 3 1 1 2 4 0 1 2 2 0 3 1 0 2 1 3 1 1 0 1 1

Readme

Source
raw.​githubusercontent.​com

Fold Python

Intelligent Folding System for Python

Intro

You can fold, navigate, extend python code in a very fast and easy way. instant fold all methods, leaving docstrings visible, extending your current code.

Features

  • Folding code, fold and unfold contents where the cursor exists
  • Smart selecting, selecting needed pieces of code
  • Smart folding getters and setters, getters and setters will be folded as one
  • Easy navigation trough code structure : Go upwards in code blocks, go inside children
  • Documentation folding, folding all python code except documentation strings
  • Extending code, creating new siblings putting keywords correct so Sublime autocomplete can take over the rest

Installation

Alternatively, download the package from GitHub into your Packages folder

Key Bindings

Fold Python is only accesible and useful when used trough shortcuts.

All key bindings are using following pattern Ctrl+Alt+Shift+Key OR Key binding are now also connected with Ctrl+K, Ctrl+Key to improve usability

  • Ctrl+Alt+Shift+Up : Move up in code / Go to parent
  • Ctrl+Alt+Shift+Down : Move down in code / Go to adult
  • Ctrl+Alt+Shift+Left : Fold Code / Go to Parent
  • Ctrl+Alt+Shift+Right : Unfold Code / Go to Child
  • Ctrl+Alt+Shift+PageUp : Go to First Sibling / Go to Parent
  • Ctrl+Alt+Shift+PageDown : Go to Last Sibling / Go to next Adult
  • Ctrl+Alt+Shift+Home : Go to parent
  • Ctrl+Alt+Shift+End : Go to all children
  • Ctrl+Alt+Shift+Space : Select all siblings
  • Ctrl+Alt+Shift+H : Help mode, Fold content but not docstrings
  • Ctrl+Alt+Shift+I : Invert selection, Select all other siblings
  • Ctrl+Alt+Shift+0 : Fold to depth 0 starting from selection
  • Ctrl+Alt+Shift+1 : Fold to depth 1 starting from selection
  • Ctrl+Alt+Shift+2 : Fold to depth 2 starting from selection
  • Ctrl+Alt+Shift+N : Create a new sibling starting from selection
  • Ctrl+Alt+Shift+I : Go to import section of code
  • Ctrl+Alt+Shift+G : Show a list of all items in visible region. This way you can easily jump to a section in your view
  • Ctrl+Alt+Shift+S : Collapse all siblings including current cursors
  • Ctrl+Alt+Shift+V : Collapse all siblings not including current cursors

Commands

A list of commands are added to access using Ctrl+Shift+P. all commands start with “Fold Python : command name”

What's new?

21 july 2014

  • added shortcut
  • bug fixing
  • added fold python commands in Ctrl+Shift+P

26 march 2014

  • Go to import command created
  • List all items in visible region for fast navigation

25 march 2014

  • Folding Getters and Setters as one
  • Create new sibling will apply an autocomplete command

Settings

you can edit Key Binding and Settings in Preferences > Package Settings > Fold Python

  • fold_getters_setters : fold getter and matching setter together as one

Contributors

People that helped me to improve this addon ! * duqcyxwd

Todo

  • change shortcuts to a more usable shortcut list