Notes on Text Editors
Clojurecember December Adventure
During December, 2022, I attempted to learn Clojure and set myself the project of building a text editor. Not having known any Clojure, I picked a commonly recommended GUI framework called Seesaw. It even had a text editor as one of its examples!
Unfortunately, it was just a bit too limiting to do what I wanted it to do. It’s limited to very basic text editing, pretty much the kind of stuff you have available in a textbox in the browser. Nevertheless, I did have some new/improved ideas as a result:
- Line numbers aren’t really that useful. A current/total line count might be, but the line count on the left is not really that useful outside of editors like Vim or linking to specific lines like on GitHub or other code collaboration tools.
- Basic text editing is far too limiting to be useful beyond barebones note-taking
- Modal editing is useful for avoiding hand-cramping shortcuts, but can get in the way of non-power-user editing, especially when the mouse is involved.
What one person looks for in a text editor (source of ideas)
- no modes
- syntax highlighting
- mildly scriptable
- cut copy and paste
- search and replace / regex
- open large files without hanging
- deal with long lines too
- persistent workspace
- doesn’t become difficult if i have 1000 files open at once.
- a better interface paradigm than “open” and “closed” files and a million tabs
- just closes without asking dumb questions in infinite sequences of dialogues
- well defined hypertext format with proportional fonts for comments and documentation.
- elastic tabstops
- “command palette”
- eval selection or line, replace with result or print result on next line
- literate programming support
- tab completion snippets
- a quick easy way to define tab completion snippets
- multiple cursors
- clipboard history/visible clipboard
- permutations on selection sets
- minimap/zooming
- a text editor should just let me type as normal without trying to “guess” what I want, thinking it’s smarter than me and sabotaging me.
https://mortoray.com/2016/06/14/the-simple-things-i-want-in-a-text-editor/
(From: https://merveilles.town/@zens/108651671078029864)
- display files in a grid, similar to Safari
- no concept of open files, just active and sleeping?
- files backed by some VCS, so you can easily open any past version of the file, make it current, etc.
- perhaps keep files associated with a project in tabs for quick switching, unless there are too many?