10 Years of Making Apps

SimpleEdit - The sophisticated Swift/PHP/HTML/CSS/Markdown/LaTeX/Java/JavaScript text, code & markup editor for Mac.

SimpleEdit Definitions
SimpleEdit allows you to create your own and to edit existing definitions. These definitions can be easily created and edited with SimpleEdit itself or you can use any other Plist Editor. The definitions are stored in a sub folder of its 'Application Support Folder'.

This can be found in the Mac App Store version here:
~/Library/Containers/com.myownapp.SimpleEdit/Data/Library/Application\Support/SimpleEdit/Definitions

And in the Non-MAS version here:
~/Library/Application\Support/SimpleEdit/Definitions
These definitions are 'loaded' every time you start SimpleEdit or when you create a new document. A definition is nothing else than a dictionary with objects and keys - much like JSON. You can think of definitions as rules for a language. They describe how your code's syntax will be highlighted and how you comment it. They also contain the words that are used for the completion. You will also find the items used for the command menu in such a definition file.
006
Currently SimpleEdit comes with the following definitions:

CSS
HTML
Java
JavaScript
LaTeX
Objective-C
Swift (experimental)
PHP
Plist
Text
XML


You can create as many definitions as you like and usually you directly select one when you create a new document - but, of course, you can change them at any time.

There is a reason why, at the moment, only these languages have a definition file - I don't know anything about other languages. It would be AWESOME if you could send me your definitions so that I can offer them for downloading here.

SimpleEdit is capable of working with any language, the syntax highlighting is designed to do more than just highlight some keywords. The customizable command menu can handle simple snippets, insert and replace strings, handle templates, open links, run terminal commands** - you can communicate with other Apps via AppleScript** and you can even send URL request. Please keep in mind that the sandboxed App Store version has limitations I can do nothing about and that, of course, not every fancy long-winded command may be possible simply because I have to support a wide range of possibilities.

Of course, you have to know what you are doing before you start to write furious emails - which you can do here by the way. Please check for your self first, that the problem does not sit in front of your screen. Chances are that I'm the culprit and I will happely fix it.

You may want to use this definition file as a starting point. I've used a similar approach that you may already know from other editors.

A definition needs a title and you can make it your default definition. For different tasks you could create different definitions - even if it is the same language.


Here is an overview of the items that currently are possible:

Kind 0
Replacement String (Clipboard)

Format: text_here CLIPBOARD text_here text_here %@ text_here
Replacement string using clipboard content, if available - otherwise stringWithout is used

Kind 1
Replacement String

Format: text_here %@ text_here
Replacement string using selection, if available - otherwise string will be inserted at cursor location

Kind 2
Snippet


Snippet will be inserted at cursor location

Kind 3
Template


Template will replace any possible existing text/code

Kind 4
Open URL

Format: http://twitter.com/home?status=TEXTORCODE
Open URL either with selection or complete document as escaped string

Kind 5
URL (POST) Request

Format: http://google.com/complete/search?output=toolbar&q=TEXTORCODE
URL (POST) request using selection or document as escaped string

Kind 6
Command Line Command**

Format: /usr/bin/tidy -q -i -asxml TEXTORCODEASFILE
Command line command either with temporary string or file (executable can run in Terminal)

Kind 61
Command Line (La)TeX**

Format: /usr/texbin/pdflatex TEXTORCODEASFILE
Command line command for (La)TeX packages, output will be displayed as PDF preview

Kind 7
Script Command **

Format: tell application …
Script command either with temporary string or file

Kind 8
Open Link/Website

Format: http://en.wikibooks.org/wiki/LaTeX
Open Link/Website

Kind 9
Separator

Such a command menu item consist of at least these following items:

Kind (Number)
Title (String)
String (String, the actual command/string/script etc.)


Optional (and depending on the kind):

keyString (String, used for the shortcut)
commandKeyAddition (String, used for the shortcut, available are: option and control)
outputCanReplaceDocument (BOOL)
onlyValidForSelection (BOOL)
insertOutputAtLocation (BOOL)
canReplaceSelection (BOOL)
shouldRun (BOOL, available for command line commands, will run executable in Terminal or open applet)
shouldOpenPDFPreview (BOOL, available for (La)TeX command line commands, will open output in built-in preview)
I'm pretty sure that I will have to extend these possibilities - so feedback is much appreciated. This also applies to additional document/file formats I probably will have to add in the future…
** Please note that the sandboxed MAS version has limitations (e.g. AppleScript, running executables, applets etc.) I can do nothing about.
DEFINITIONS

Syntax, baby!
How to edit and create own definiteions