Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/math2001/FoldFunctions
Sublime Text plugin to fold functions. And it supports functions with arguments on more than one line!
https://github.com/math2001/FoldFunctions
fold plugin python sublime-text
Last synced: 15 days ago
JSON representation
Sublime Text plugin to fold functions. And it supports functions with arguments on more than one line!
- Host: GitHub
- URL: https://github.com/math2001/FoldFunctions
- Owner: math2001
- License: mit
- Created: 2017-06-18T00:03:05.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-06-27T06:11:04.000Z (over 7 years ago)
- Last Synced: 2024-08-01T05:23:50.571Z (3 months ago)
- Topics: fold, plugin, python, sublime-text
- Language: Python
- Homepage:
- Size: 285 KB
- Stars: 12
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
- JavaScriptThe good part is that it supports arguments on multiple lines, like so (in this case, it's python):
```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!')
```![Example of folding with this package - FoldFunctions - through the command palette of Sublime Text](fold-functions.gif)
## Installation
Because it is not available on package control for now, you have to add this repo "manually" to your list.
### Using package control
1. 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/FoldFunctions` in the input field.
2. 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
```bash
cd "%APPDATA%\Sublime Text 3\Packages" # on window
cd ~/Library/Application\ Support/Sublime\ Text\ 3 # on mac
cd ~/.config/sublime-text-3 # on linuxgit 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 enterNote: 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:
```json
{
"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"}
]
}
```