Does anyone know about a way to get code folding in gedit? I've found this plugin in google code, but looks like dead and doesn't work with the latest gedit.

  • 1
    I think this question is slightly different and in its core not covered in the other question. – txwikinger Oct 20 '10 at 1:22
  • @Murat: Even if it is, it's better to have one question per question. – Matthew Oct 20 '10 at 3:32
  • The question referenced in the first comment simply asks for a code-folding feature, with the currently leading answer stating there is a problem with the plugin, but not proposing a solution. This question is intended to find that solution, so is not a duplicate. – user2405 Oct 20 '10 at 12:30

Code folding in a good manner is stated to be difficult because the GtkSourceView component would need to be edited.

Still there was this simple plugin that used to work until gedit 2.28...

And it's on the official roadmap at least...

To answer your question: No currently no option (unless someone would fix the old plugin)


Solution in this page works:


  • 3
    +1, it is very basic (keyboard based only), but works! (tested on v2.30.4) – alfC Nov 4 '11 at 7:18
  • This plugin needs to be updated for Gedit 3... Ad used as a starting point for an official code folding plugin for Gedit. – trusktr Oct 3 '12 at 1:31
  • 2
    @trusktr -- looks like there are a few forks for Gedit 3. Here is one: github.com/aeischeid/gedit-folding – mason81 Nov 12 '14 at 19:03
  • @mason81 Thanks! I've since moved on to Vim though (and probably NeoVIm soon). :D – trusktr Nov 13 '14 at 0:49

gedit-folding by Jacek Pliszka is a nice simple tool to fold code on multiple levels. It is featured on the GNOME Wiki page for third party plugins for gedit 3.14.


This solution was recommended on a duplicate question.

It took 919 lines of bash code and folded onto one page. It helps me spot constants I need to move into functions. It also made me realize some functions need to be broken down into smaller chunks:

gedit folding.png

Note: To install it I had to first create the directory


Then change to that directory and run

git clone https://github.com/aeischeid/gedit-folding

Next use gedit's menu Edit -> Preferences -> Plugins -> Folding

I only wish I new Python (it's only 174 line program) so I could modify it to save folded code marks and reapply them when file is reopened. I can see now I'll be keeping the same file open for 2 weeks :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.