Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

When I'm on Linux, I usually program using either gvim or emacs (depending on the language I'm working in, and the configuration of the machine). However, one thing I miss from the Windows world is code folding. Editors like Notepad++ and IDEs like Visual Studio allow shrink, or fold, blocks of code into single line headings.

Are there any Linux editors with this facility? I know Eclipse can do code folding, but I don't want to launch Eclipse just to edit a HTML file.

share|improve this question
2  
Wikipedia has a comprehensive list, and indicates which editor runs on which platform as well as code and text folding features: en.wikipedia.org/wiki/Comparison_of_text_editors – FrustratedWithFormsDesigner May 6 '11 at 15:50
Wow, so many good answers. I wish I could accept them all. – quanticle May 10 '11 at 18:04

closed as off topic by Mark Trapp Jan 26 '12 at 1:22

Questions on Programmers Stack Exchange are expected to relate to software development within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

8 Answers

up vote 17 down vote accepted

Vim has excellent code folding so Gvim does too. :help fold

share|improve this answer
1  
Gvim, too. OP asked for a GUI editor. ;) – greyfade May 6 '11 at 16:11
@greyfade fixed – Rein Henrichs May 6 '11 at 16:13
1  
Cool! I didn't realize that GVim had that capability. Its been a few years since I started learning GVim/Vim, and it still surprises me with its features. – quanticle May 10 '11 at 18:05
vim can do almost everything (except emulate Emacs)... – user1249 Nov 30 '11 at 20:38

I'm a big fan of jEdit. It's Java-based, and I've used it on Windows, Mac and Linux extensively. It includes code folding in multiple languages, among many other features, and it's ridiculously customizable.

share|improve this answer
+1 Nothing else comes close to the usability of jEdit's search and replace. – l0b0 Dec 1 '11 at 15:49

Emacs has outline mode, which provides code folding (and more). Stackoverflow had a question on this a little while back, which got some good answers on how to do this (and the usual arguments as to whether you want to, which you can safely ignore for now if you have a work pattern you're happy with).

(Note to mods -- this isn't, IMO, a duplicate of that question, as this asker wants to know what editors have this capability, and emacs is but one of them.)

share|improve this answer
Well, that's good to know. Unfortunately, I can only accept one answer, and I chose to accept the GVim one, since I use GVim more of late. – quanticle May 10 '11 at 18:07

Geany has code folding, and it's very lightweight.

share|improve this answer
1  
Geany FTW! Fast and easy to use, great for Python development. – gruszczy Nov 30 '11 at 22:04
would you mind explaining more on what it does and what it's good for? "Link-only answers" are not quite welcome at Stack Exchange – gnat May 1 at 10:04

Not as lightweight as some of the others, but I'll throw my vote in for Komodo Edit. I've been using it on a few of my recent projects, and found it while looking for good Linux editors. So far I quite like it.

share|improve this answer
Komodo Edit is quite good as a lightweight yet powerful IDE - so much so that I've never even needed to try the full IDE version! – sevenseacat May 7 '11 at 7:36

I dont see better lightweigth choices than Kate and Scite. While working with larger projects I'm used to Netbeans IDE (version 7 has just launched), for simple file views I use Kate or Scite - depending on the mood (:

share|improve this answer

I just love Kate. It not only does all this, but thanks to the modular architecture of KDE, several other applications use the same editor (Quanta (html editor), KDevelop (full blown IDE), Konqueror (all around browser)), with all the same goodies.

share|improve this answer

I used both emacs, vim, gedit, kate, eclipse, netbeans, geany, jed and many other editor in linux during the past years, and found that emacs satisfied all my needs, except for some aesthetics consideration.

Lately I discovered sublime Text 2, and even if it's still a beta and it not open source (which I reprehend usually :-) ), it's exceptionally gorgeous, fast, lightweight and stable (when working in graphic mode).

So I could only recommend you to give it a try (and yes it has folding).

share|improve this answer

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