Atom, a new text editor for programmers, just got made open source today.
It's interesting mostly in that it's based on browser tech. They took Chromium, paired it down to a stand alone app shell, added node.js's libraries for accessing the file system, networking, etc, and then used it to make a text editor.
One thing that's really cool IMO is that given it's based on a browser you have access to ALL FEATURES OF HTML at your disposal. Where as most editors are designed to just display plain text in a single (possibly user selectable) font, a browser can display text in all kinds of fonts and styles, it can display images, it can draw dynamic images using canvas, webgl, svg, .. it can display video and play audio, etc. That's more than any other text editor I know of. So I'm really interested to see if anyone figures out interesting ways to augment a text editor using those features.
On the other hand, downloading it and trying it out made me wonder what's my bare minimum set of features I feel like I need to be productive in an editor. Maybe "productive" is the wrong word. More like "Yea, I'd consider switching". So, here's a random list for me.
CUA cursor keys
That basically means I want my cursor to behave like it does in Notepad or TextEdit. Pressing → at the end of a line goes to the beginning of the next line. Pressing ← at the beginning of a line goes to the end of the previous line. If you have a long line followed by a short line, followed by a long line, the cursor is in the top long line past the length of the short line and you press ↓ the cursor will go to the end of the short line. If you press ↓ again it will go to the corresponding character that it was in the previous long line.
Those might seem obvious but not every editor works that way. Some will stop at the left side when pressing ←, some will stop or continue past the end of the line when pressing →. Some will go into virtual space when pressing ↓ from a long line to some place pass the end of a short line.
I'm used it to it a certain way and I want it to stay that way.
CUA selection
Similarly I want shift + cursor to select. That includes Shift + PgUp, Shift + PgDn, Shift + Home, Shift + End, etc.
Search and Replace with Regular Expressions
Notepad has search, I think it even has replace, but a "real" text editor has search and replace with optional regular expressions with substitution. I can search for
"_state\((\:w)\:s*,\:s*(\:w)"
and replace with"_stateFn(\u\1, \u\2)"
which basically says, Find every place that starts with "_state(" with 2 identifiers, separated by a comma, with the comma optionally being surrounded by whitespace. Each time you find that, replace it with "_stateFn(" following by the first identifier with the first letter capitalized and then followed by the second identifier also with the first letter capitalized.Search across files
I should be able to searh across files, get a list of all matches, and step through the matches. The matches should optionally stick around even if I do another search. That way I can search for stuff, go to each result, do some where their, continue to the next match.
Replace across files, with undo
I should be able to apply a search and replace across multiple files, in my project or in a tree of folders, using a filter (like *.js), I should be able to step to see each replacement before it happens, optionally tell it just to go do all of them, and in the end I should be able to undo the entire operation if I screwed up.
Keyboard Macros
I should be able to pick "Record", start typing a complex sequence of commands including searching and replacing for different things, then pick "Stop Recordinging" and finally "Playback".
Indent/Unindent blocks of code
Using tab, shift-tab
The editor should auto-intent
And it must support my indentation style out of the box. No "here's the source, add it yourself." Note: My style is not unusual.
It must colorize code
This includes all the languages I normally use, JavaScript, Python, C++, C#, bash scripts, CSS, HTML and includes being able to handle 2 or more types of formats in the same file. In other words, in an HTML file it should correctly format
style
andscript
sections. It shouldn't force me to program differently just because the editor can't handle it.Editing Columns
I should handle editing columns, meaning I should be able to select a column of text, start typing and have it edit all the columns simultaneously.
Tagging
It should support tagging the various languages and provide auto help extracted from the comments of the code. Running some external tag generating program is not sufficient as I should be able to start writing code and have the editor start providing help for the functions I just typed.
It should also support extracting tag info from common libraries like .NET dlls or system frameworks etc.
It should also let me easily jump into and out of a reference so I can easily follow code.
File Browsing
It should let me find files in my project quickly. For example picking "Open" and typing "tri" should at a minimum show all files that start with "tri" or optionally all files that contain "tri". It must do this fast and in such a way that there's no stuttering as I type while it goes and looks at and sorts 40k filenames.
Keyboard & Mouse
It must support both keyboard and mouse control. It must be 100% controllable by keyboard, letting me split windows, combine then, and switch windows, without using the mouse. At the same time I need to able to at least place the cursor using the mouse and prefer to have drop down menus to find commands I use more rarely and have no way of remembering what they are.
Tiled Windows
It must support tiled windows with multiple views into the same file and those views must be fully independent. What I'm trying to say here is that some editors let you have 2 views of the same file but those views must be in the same window. I need to be able to split my editor into multiple tiles and put whatever I want in each tile. As an example, Emacs handles this, Visual Studio does not IIRC.
I'm sure there's a bunch more idiosyncratic things that would pop up if I actually tried to switch editors but I think that's my MVE. Atom seems to be missing several of those though hopefully they'll get added. I'm a little worried that by design some of those might be hard in Atom. For example tagging in the background, can Atom handle multiple threads reading the same text or is there some other way to handle that? Maybe it happens in a worker? I have no idea.
What's your MVE?