5

I am looking for a code editor with specific features. For Windows, commercial or free.

List of required features:

  1. The editor should be language-agnostic, and language-aware features should be customizable and importable/exportable via external definitions, transparent to the user if possible. So for example if I create my custom language, I can create custom lexer and highlighting schemes, etc. Ability to use or create advanced features for any language (e.g. grammar checkers, variable/function lists, etc.) obviously would be great.
  2. Scriptable/programmable: must have support for scripting (ideally with Python) with access to the text, caret, other internal editor features, so I can program editing features and bind them to shortcuts. Ideally with possibility to use GUI of the editor (e.g. show some list in a side-panel etc.).
  3. Highly customizable syntax highlighting features. I.e. not only basic things, but with ability to define the styling for individual characters and sequences (e.g. regex matching) and so that it can be set to different font, size and color for the match. (please note the emphasis). [*]
  4. Lines can be of different height. For example if I set the styler to 5pt font, and it matches the whole line - the line will have 50% height compared to the height lines with 10pt size.
  5. Ideally with support for line indents (tree-like editing). Indentation level (nesting level) must be accessible via scripting (e.g. to generate runnable Python code). (Note: please don't confuse indentation with inserting space or tabs character! Indents here = non-editable horizontal space).

[*] Important note on the requirement no.3: Even though some editors have extra rich formatting options, the common problem is that those are only applicable to the so-called 'tokens' (e.g. keywords, functions). So please note, that it is not enough. To better understand what I mean, here are concrete examples what I need to do:

  • set the font/size for cyrillic letters inside strings only;
  • set the font/size for numbers inside identifiers only;
  • set the font/size for the hyphen character inside a word; etc...

Further criteria (less important):

  • it should be fast and responsive, without much bloat;
  • it would be great if it is actively developed so at least there is a chance that some useful features will be added;
  • advanced scripting API for interactive features, for example ability to read mouse coordinates and detect the character or line under the mouse cursor;
  • adequate tabulation support (indent-aware);
  • no intrusive annoying features like something blinking, animations, switching focus, hogging the CPU&HDD etc.

Question:

Please suggest an editor which supports all of the above mentioned features.
Even if not everything is supported out of the box, but possible via scripting/extension, please also give a suggestion and some descriptions.

In other words, even if the editor is not exactly a code-editor, but it can fulfill the requirements, it can make a useful answer as well.

Not as a real example - but just to illustrate an alternative approach: for example, one can use e.g. Word or Adobe InDesign to edit the code, then generate sources and pass them to other tools. Yes, doing so would be kind of absurd for this task, but just to say - e.g. with InDesign all of the highlighting features and e.g. code generation are possible via scripting, so it's a viable option in theory.


What I have tested so far with lists by feature:

Notepad++

This editor fulfills many requirement, but still many features are limited. Super fast, no bloat. It is based on the Scintilla engine, which has many advanced features ahead of it's time. Something is possible via plug-ins. As a note, developing a plugin basically requires developing an C++ application, which may be quite a challenge.

So to my feature list:

  1. Partially. E.g. to define hilighting for a custom language must use UDL, but it's limited (see 3.). Built-in lexers are hard-coded, dev-guides are lacking.
  2. Yes - e.g. using the PythonScript plugin, and it's good.
  3. Partially. The problem is, it does not support regex-based matches.
    So I can define stylers with various fonts/sizes, but I can apply it only to the tokens which are defined by the lexer (hard-coded), or via UDL, but UDL is limited to the unified grammar tokenizer (no custom operator groups, no user-defined match sequences). So basically the Scintilla's composer supports this, but the editor does not provide this to the user, so no way to use it directly.
  4. No (all lines are of equal height).
  5. No.

gVIM

Great editor, super fast and customizable. But pretty limited in graphical features.

  1. Yes.
  2. Yes.
  3. No. (herewith limited to monospaced fonts only, but as a nice bonus it has regex-based hilighting)
  4. No.
  5. No.

VSCode

I've been testing it only for a while, so can't be sure about some features. It's pretty slow, so on a low-end machine will be hardly usable.

  1. ???. Seems like it tends to be extensible to support any language via extension, but the whole picture is unclear and its development seems pretty chaotic.
  2. ???. Extensions are possible, but I could not spot clear instructions or a dev-guide. Also it seems that many parts of the core editor are not customizable/accessible at all.
  3. No.
  4. No.
  5. No.
  • I'd take a look at Geany - I know it does 1, 2 can be done via plugin development, 3 to some degree native otherwise see 2 and plugins, 4 via plugins/plugin development, and I think 5 but I don't do python... – ivanivan Oct 14 '18 at 14:51
  • @ivanivan Geany is based on Scintilla as Notepad++ is. This should mean 4 and 5 is No (unless this will become a feature in Scintilla). Or am I missing something? – Mikhail V Oct 14 '18 at 19:55
  • @ivanivan same situation with #1/3 - to define custom language's lexer most likely you'll need to maintain a fork of the editor and need to compile the whole project, which I am not very excited about. – Mikhail V Oct 14 '18 at 20:39
1

SynWrite (freeware; CudaText is a replacement):

  • language-agnostic: check.
  • Scriptable/programmable: check, via Python plugins.
  • customizable syntax highlighting features: check, via internal Lexer Editor dialog. Dialog also supports different font name/size for fragments, ie "tokens".
  • Lines can be of different height: check, editor adapts line height to sizes of "tokens" in this line.
  • support for line indents: check, Lexer Editor allows to conigure indent-based folding.
  • Important note on the requirement no.3 - not supported, lexer highlite is based on "tokens".
  • fast and responsive: check.
0

You could try Sublime Text, it is performing quite well and is really customizable through python plugins and the like. Not sure about your points 3, 4 and 5, but maybe they are achievable via plugins.

0

It's probably worth adding Textadept to this Q&A. A glance at the ! symbols below suggests this is a bad fit. But I post it since (a) I'm genuinely uncertain about these; and (b) it's so fast, powerful, and extensible, that it's worth checking it out. Here's how it meets OP's criteria:

  1. The editor should be language-agnostic | Yes Yes.
  2. Scriptable/programmable | Yes Yes, but with Lua, not Python.
  3. Highly customizable syntax highlighting features | Note I think so, but not sure. See the manual on "lexer syntax" to see if it meets the need.
  4. Lines can be of different height | Note Not sure! Never done this, but if other criteria are met, worth checking this out.
  5. Ideally with support for line indents (tree-like editing) | Note Again, not sure.

Additional notes:

  • very actively maintained, with responsive developer (really impressive, actually)
  • Scintilla-based
  • very well documented
  • given OP's interest in Cyrillic, here's the entry from Wikipedia.ru.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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