This page is in group Technology.
Wishes for a folding editor
This post is meant for us to collect thoughts. I would appreciate anyone to comment here, and hope that we could collectively bring about a spec for a new folding editor. Maybe a programmer would emerge, too? Folding is a fantastic cognitive tool!
The starting point of this note may be seen in my Designer’s note .
The above Intro is made with the html tag <details> followed by <summary>. It gives a flavour of the first step of folding: a piece of text which is disclosed when pressing on the always visible heading, or fold crease as I was learnt to call it in the early nineties. I discovered this html tag just now (5Apr2022). But try to search for “collect” in this text with the “summary” not seen. Is this wanted semantics if this were a piece of source code?
Observe that I didn’t even tell you that the ▶ arrow points to something you may press to read the contents which reveals itself below the ▼ – it’s a semiotic fact for all of us. And then, how we close the text again. We know it, just as we immediately feel the crash when two cold water faucets have blue/cold and red/hot markings (picture). (Semiotics) (Then, why is the first arrow seem in a blue rectangle here? Ask WordPress, not me.)
The reason I’ve pointed out this “semiotic stuff” is because it also has some deeper connotations as to how we perceive text, ie. source code, ie. what it is doing, ie. the quality of the sw it’s the runnable engine of, ie. your trust in that program. There are many ways to do this, and deep folding, but not just <details>, is one of them.
Observe that my favourite folding editor is WinF (or F or WinF32 or winf32). It’s freely available at , as Windows exe and even source files. At the moment it just is best..!? (even after xcode!)
It was the F editor for the Inmos Transputer Development System that started it all. The manual is a shining example of how such manuals once were written . Many peopled hated the folding of the TDS. Here, from Wikipedia [transputer]:
The initial occam development environment for the transputer was the Inmos D700 Transputer Development System (TDS). This was an unorthodox integrated development environment incorporating an editor, compiler, linker and (post-mortem) debugger. The TDS was a transputer application written in occam. The TDS text editor was notable in that it was a folding editor, allowing blocks of code to be hidden and revealed, to make the structure of the code more apparent. Unfortunately, the combination of an unfamiliar programming language and equally unfamiliar development environment did nothing for the early popularity of the transputer. Later, Inmos would release more conventional occam cross-compilers, the occam 2 Toolsets. (text 19Nov2020)
I came in with the occam 2 toolset, was on a course in Bristol, and just loved what was left of the all folding concept: The F editor only.
Read about folding in .
Winf32 on Mac OSX
Here is a fast recipe. Download XQuartz (starting with OSX 10.8 Mountain Lion X11 is not bundled any more). I have described the XQuartz download in my “FDR2 notes“. Then download the WineApp, install and run it.
 includes a winf32.ini file for MacBook Pro with retina screen and non-numeric keyboard. Then read the winf32_osx_non_numeric_keyboard.ini that you have downloaded and rename it to winf32.ini. Then you can just doubl-click the Winf32.exe file. Yes, 147 kB does it!
Some of the important shortcuts (defined in winf32.ini)
In addition to remapping by editing in the winf32.ini, you can also see present mapping (and change it) in Options | Key bindings. Here are some that I have negotiated with the keyboard and standard shortcuts as well as what is possible. Some obvious keys I did not succeed with, like find next where I wanted “ctrl alt f2” but had to compromise to “ctrl alt 2” which is ok. But these seem to work pretty well for me:
- Fold contents alone, left indented to pos 0:
- Enter fold: ctrl backspace
- Exit fold: ctrl alt backspace
- Fold contents seen with other contents:
- Open fold: shift backspace
- Close fold: shift ctrl backspace
- Create fold: same for begin and end: ctrl shift upparrow
- Remove fold: will loose crease text: ctrl shift downarrow
- Line or fold copy/paste:
- Pick: f11
- Copy pick: f12
- Put: ctrl f11 or ctrl f12
- Find / replace
- New find: alt f1
- Find next: ctrl alt 2
- Replace current: ctrl alt 3
Now it’s just to double-click on winf32.exe to run it!
Post script: Of course, if you look at the full resolution of the picture (press on it and zoom), then it’s more obvious than ever that winf needs to be ported! It looks like the basic resolution of the winf window is low, compared to the retina resolution. And, again: see .
Update 3Dec2016: I did a comment on the WordPress plugin Collapse-O-Matic at https://wordpress.org/support/topic/expandclose-all-and-auto-expand-on-printing/, hoping to get some readers there to respond. Also see WordPress#collapse-o-matic_plugin. I also have my saying at 061:[Collapse-O-Matic plugin].
There also was this Origami editor that I used for several years. I just loved it. It was written by Vladimir Katalov from Elcom in Moscow. This is now ElcomSoft, (where he is CEO), who works with digital forensic tools. Here are some references, though, to the good old Origami:
- origami.zip – the files I found on my disk in Mar 2021. The source was open and I remember that there was a guy Mr. Green (in the UK I seem to think) who did some changes for me
The reason I updated with this info is that a fried of mine, in March 2021 sent me a file that I saw was folded and I asked which folding editor he used. Origami!
Extensions/plugins for state of the art IDEs
Microsoft Visual Studio Code
“Explicit Folding” by zokogun
Update 3Oct2022. See https://github.com/zokugun/vscode-explicit-folding
- What will C code look like in an editor that don’t support explicit folding?
- What happens with the C code if I install and use Explicit Folding and then decide to uninstall it? How is it uninstalled?
- How is a C file folded with “Explicit Folding” look for other users of VSCode that haven’t installed the extension?
- Is it possible to copy/paste a fold and thus move it around?
- Will it support nested folding? I think so, there is a “nested” keyword in there
- How does this work?
- How is a fold opened and closed?
- Does it distinguish between enter / exit (fold contents alone, left indented to pos 0) and open / close (fold contents seen with other contents) of a fold?
This note rendered my Blogspot note 012 from July 2009 as obsoleted (I have moved all over to this page).
- “Wishes for a folding editor” (1)
- “Download winf folding editor by Julian Wilson”
- “Folding editor” at Wikipedia
- WineApp http://en.wikipedia.org/wiki/Wine_(software) (Download from http://www.winehq.org)
http://en.wikipedia.org/wiki/XQuartz (Download from http://xquartz.macosforge.org/landing/)
- F editor, Preliminary version, INMOS Limited, 72 TDS 277 00, March 1991, see http://transputer.net/prog/72-tds-277-00/feditpre.pdf (This copy come from my collection, in 2020, see Transputer TRAM (was: boards for sale)). As a backup I’ve also placed a copy in my own domain: inmos_f_folding_editor_manual_1991.pdf