FoldingText is an extensible markdown text editor with productivity features. It’s most easily understood by watching this Demo Movie
- Markdown Editor
- Extensible with themes, scripts and plugins
- Outlining, todos, timers for productivity
To create your own themes, scripts, and plugins open FoldingText’s Help -> Software Development Kit menu item then from there you can access the SDK documentation.
Themes are made from CSS/LESS rules that you put in your user.less file. To use a theme open FoldingText based app and:
- Choose the File > Open Application Folder menu item.
- Inside that folder open your existing user.less text file, or create a new one if none exists.
- Paste in the theme extensions CSS/LESS rules and save.
- Create a new document to see the theme applied.
Scripts are made of AppleScript code that you paste into the “AppleScript Editor” application to run
To try a script:
- Create a new test document in FoldingText.
- Open the “AppleScript Editor” app and paste in the script.
- Then press the green “Run” button to run the script.
If you decide to keep the script you should install it so that it’s easier to run.
To install a script:
- Open the "AppleScript Editor" apps preferences and make sure that "Show Script menu in menu bar" is checked.
- Click on that item in your menu bar and choose “Open Scripts Folder > Open User Scripts Folder”.
- Save the script that you were testing into that folder. Make sure to save using the “Script” format, it’s faster and some scripts wont work properly unless they are saved in “Script” format.
Once you’ve done this the script will be listed in the Script menu in your menu bar. To run the script just select it from that menu. You can also use tools such as FastScripts and Keyboard Maestro to setup keyboard shortcuts to launch scripts.
Plugins are folders that end with the .ftplugin file extension and contain JavaScript and other resources.
To install a plugin put it into FoldingText’s Plug-In’s folder:
- Choose the File > Open Application Folder menu item and then locate the Plug-Ins folder.
- Copy the plugin (which is a folder ending with .ftplugin) into the Plug-Ins folder.
- Verify that a plugin is installed by choosing the FoldingText -> Plugin Manager menu item and make sure the plugin is install and has no errors. The plugin functionality should be available in any new documents that you open after installing the plugin.
First of all FoldingText is a plain-text editor, it can open any plain text file (of reasonable size) no matter what the formatting.
So by “support” I don’t mean opening and editing (it can do that with any plain text file) I mean that FoldingText will recognize the given syntax and highlight it to make it easier to read. Also note that FoldingText doesn’t have any special export of multi-markdown to other formats. For that you’d need to use Multimarkdown Composer, though you could of course still use FoldingText to edit the file.
So with that definition of “supports”, what parts of Multi-markdown syntax does FoldingText support and what parts does it not support?
Syntax highlighting supported:
- definition lists
Syntax highlighting partially supported
- footnotes
- image attributes
- citations and bibliography (works best in LaTeX using BibTeX)
Syntax highlighting unsupported:
- tables
- math support
- table and image captions
- document metadata(e.g. title, author, etc)
In the release notes for FoldingText 2.0 I said supports “large parts of MultiMarkdown”. I’m not sure how I started thinking that way, but it’s not true. “Some” parts is more correct.
- The standard “OS X menu item” shortcuts. These can be changed in System Preferences as Described Here
- Internally defined keybindings. These take precedent over the “OS X menu item” shortcuts, and can be changed with a plugin.
To change an internal keybinding you need to create a plugin that adds the new binding. For example lets say you want to rebind the Home and End keys to move to the start and end of the current line instead of to scroll to the top or bottom of your document, which is the default behavior. To do this you will:
-
[Create a plugin](#How-can-I-create-my-own-themes,-scripts and-plugins?) Here is an example plugin that shows in particular how to add new keybindings.
-
Modify that plugin to override the bindings you are interested in. In this case (changing Home and End behavior) the plugin code should be modified to this:
editor.addKeyMap({
'Home' : 'moveToBeginningOfLine',
'End' : 'moveToEndOfLine'
});Modifiers can be combined with the bound keys with:
Shift-, Cmd-, Ctrl-, and Alt- (in that order)- Then install the plugin if you haven't already done so. And create a new document, the bindings should be active in the new document.
If you are modifying keybindings it can be very useful to view FoldingText’s default keybindings so you know what you are overriding. It’s possible, but you’ll need to do some digging.
FoldingText ships with most of it’s own source code embedded inside the application bundle (not open source, but shared source so you can learn from it). Anyway to see FoldingText’s existing keybindings:
- Right click on the FoldingText.app bundle and choose “Show Package Contents”.
- Then browse into that folder and find the keybindings file at FoldingText.app/Contents/Resources/dist/sdk/sources/ft/editor/keybindings.js.
- Open that file to see FoldingText’s default text editing bindings. (There are a few others spread out through the code (you can search for addKeyMap), but that’s the vast majority of them.
-
You need to open “Terminal” app paste in something like this:
defaults write com.doubledogsoftware.FoldingText DefaultFileExtension [newextension]
That’s setting a user default for the application with the identifier: com.doubledogsoftware.FoldingText.
My focus is on macOS and iPad for the foreseeable future.