coding beacon

[programming & visualization]

Fold Me Tender, Fold Me True, Never Let Me Go

This post is on custom code folding all right.

Everyone loves visual / ergonomic nicities for coding, however good enough is perfect. So recently I stopped my search for a perfect solution within every IDE I happen to use and my list is as follows:

To squeeze custom code folding capabilities I use the following tricks:

(1) Java — coffee-bytes — IDE: Eclipse

http://stackoverflow.com/questions/6872921/code-folding-plugin-for-eclipse?rq=1

(2) C — standard CDT module — IDE: Eclipse

The earliest mentioning of this hack comes from Tod Gentille. You can read it here: http://syncor.blogspot.co.uk/2011/02/folding-c-code-regions-in-eclipse.html

#if (1) //Anything you want here to identify the region
… The C/C++ Code
#endif

(3) Bash scripts — Configurable Fold Handler plugin — IDE: jEdit

http://www.jedit.org/index.php?page=screenshots

(4) R — none — IDE: Eclipse

Not yet as actively working with R as I wish I did, but perhaps I shall be moving to jEdit as well.

More and more often I think about switching to Vim… (or Emacs)… to solve all these problems once and for all.

References:

Eclipse: http://eclipsebook.in/c-cpp-development/reading-code/code-folding/

Emacs: http://www.emacswiki.org/emacs/FoldingMode ( some hands-on customization example: http://stackoverflow.com/questions/4923459/hide-long-copyright-message-at-top-of-all-files/4923497#4923497 )

Vim: http://vim.wikia.com/wiki/Folding ( Manual folding, Syntax folding, Folding by expression, Folding with markers, Diff folding )

Some useful reference on code folding:

http://stackoverflow.com/questions/27582862/fold-expressions-with-arbitrary-functors/27747979#27747979

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: