Sublime Text plugin to fold functions. And it supports functions with arguments on more than one line!
- Total 3K
- Win 2K
- Mac 715
- Linux 782
|Nov 30||Nov 29||Nov 28||Nov 27||Nov 26||Nov 25||Nov 24||Nov 23||Nov 22||Nov 21||Nov 20||Nov 19||Nov 18||Nov 17||Nov 16||Nov 15||Nov 14||Nov 13||Nov 12||Nov 11||Nov 10||Nov 9||Nov 8||Nov 7||Nov 6||Nov 5||Nov 4||Nov 3||Nov 2||Nov 1||Oct 31||Oct 30||Oct 29||Oct 28||Oct 27||Oct 26||Oct 25||Oct 24||Oct 23||Oct 22||Oct 21||Oct 20||Oct 19||Oct 18||Oct 17|
This package folds every functions in the current file, so that you can have a global view of it, and then unfold a few, so that you don't have to scroll a lot, skipping over the functions you're not interested in at the moment.
For now, the following language are supported:
- Python :heart:
The good part is that it supports arguments on multiple lines, like so (in this case, it's python):
def my_function(argument_number_one, argument_number_two, argument_number_three): print('It works!!') for i in range(10): print('It really does!')
Because it is not available on package control for now, you have to add this repo “manually” to your list.
Using package control
- Open up the command palette (
ctrl+shift+p), and find
Package Control: Add Repository. Then enter the URL of this repo:
https://github.com/math2001/FoldFunctionsin the input field.
- Open up the command palette again and find
Package Control: Install Package, and just search for
FoldFunctions. (just a normal install)
Using the command line
cd "%APPDATA%\Sublime Text 3\Packages" # on window cd ~/Library/Application\ Support/Sublime\ Text\ 3 # on mac cd ~/.config/sublime-text-3 # on linux git clone "https://github.com/math2001/FoldFunctions"
Which solution do I choose?
It depends of your needs:
- If you intend to just use FoldFunctions, then pick the first solution (Package Control), you'll get automatic update.
- On the opposite side, if you want to tweak it, use the second solution. Note that, to get updates, you'll have to
The command is accessible from the command palette.
- Search for
- hit enter
Note: The caption will be the same, whichever supported language file you are editing, but the actual command will change. :wink:
Adding a key binding
It's up to you, but I prefer to have this command bound to this command, in my case, alt+f. So, here's what I've done: