Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Collapsable code in gedit

How to collapse a function , class , or method in gedit. i managed to install all plugins for gedit , but unable to find any plugin for the same.

like image 686
Mohit Verma Avatar asked Nov 20 '12 15:11

Mohit Verma


2 Answers

In gedit 3 I am currently am using my own fork of the plugin others have mentioned. It is not perfect, but it works fairly well for me anyway. https://github.com/aeischeid/gedit-folding

like image 200
aeischeid Avatar answered Sep 30 '22 07:09

aeischeid


I just found this updated version of gedit-folding:
http://code.google.com/p/gedit-folding/issues/detail?id=4

Just download folding.py and folding.gedit-plugin and save them to ~/.local/share/gedit/plugins then enable "Simple Folding" under Edit>Preferences>Plugins.

To use, move to the very beginning of a block and press Alt+Z. I've given it a quick test with Python, Javascript and HTML files and it seemed to collapse most blocks, with the notable exception of multiline strings and comments.

It isn't perfect, but it's better than nothing, I guess.

Update: I've just tested it with badly indented code. The folding seems to be based on indentation only.

like image 37
Zecc Avatar answered Sep 30 '22 08:09

Zecc