FoldFunctions
Sublime Text plugin to fold functions. And it supports functions with arguments on more than one line!
Details
Installs
- Total 3K
- Win 2K
- Mac 740
- Linux 796
Sep 17 | Sep 16 | Sep 15 | Sep 14 | Sep 13 | Sep 12 | Sep 11 | Sep 10 | Sep 9 | Sep 8 | Sep 7 | Sep 6 | Sep 5 | Sep 4 | Sep 3 | Sep 2 | Sep 1 | Aug 31 | Aug 30 | Aug 29 | Aug 28 | Aug 27 | Aug 26 | Aug 25 | Aug 24 | Aug 23 | 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 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 0 | 1 | 1 | 1 | 0 |
Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
FoldFunctions
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:
- JavaScript
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!')
Installation
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 findPackage Control: Add Repository
. Then enter the URL of this repo:https://github.com/math2001/FoldFunctions
in the input field. - Open up the command palette again and find
Package Control: Install Package
, and just search forFoldFunctions
. (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
git pull
Usage
The command is accessible from the command palette.
- ctrl+shift+p
- Search for
Fold Functions
- 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:
{
"keys": ["alt+f"],
"command": "fold_python_functions",
"context": [
{"key": "selector", "operand": "source.python"}
]
},
{
"keys": ["alt+f"],
"command": "fold_javascript_functions",
"context": [
{"key": "selector", "operand": "source.js"}
]
}