Crates.io | mfte |
lib.rs | mfte |
version | 0.3.0 |
source | src |
created_at | 2017-08-04 06:51:25.491229 |
updated_at | 2017-11-27 19:29:26.714701 |
description | MFTE, the magic-free text editor |
homepage | |
repository | https://github.com/mathphreak/mfte |
max_upload_size | |
id | 26349 |
size | 83,522 |
Because I am terrible and bad at everything, I'm writing a text editor. Vim and Emacs are too complicated. Nano does almost everything I want. (I don't have an ideological grievance against Electron, but I think using it for a text editor is silly.)
It's pronounced "mifty" (rhymes with "nifty").
Works best on Windows because that's what I use. Guaranteed to compile on Mac OS and Linux; full functionality might not happen.
In the interest of not reinventing the wheel, MFTE uses EditorConfig to handle file-level settings like indent width and line endings.
In the interest of enabling my own laziness, not everything is implemented. Indent size is just about the only thing that I care about different values of, and so I've tested 2 and 4 and those work fine. Other numerical values should work too.
The simpler things, like EOF behavior and the two boolean options, should work however they're set up, but I haven't exhaustively tested them.
Setting your indentation to tabs will break everything. (Loading files with indentation set to tabs will also break everything, come to think of it. This might not be a good thing.)
You can't change character sets. It's UTF-8. This is a feature.
Powerful text editors tend to overcomplicate indentation. Nano doesn't do anything particularly clever at all. The rule is simple: assume the indentation level hasn't changed from the previous line and make it easy to add or remove a level. Decorated block comments, Markdown lists, and other line prefixes that aren't purely whitespace count too.
Windows has actual APIs for getting one keypress at a time and getting all modifier keys, so MFTE can receive (say) Ctrl+Tab or Shift+Down. If I wanted Ctrl+Shift+S to be different from Ctrl+S, that would work too.
On UNIX, meanwhile, everything is garbage. Tab is just Ctrl+I, so Ctrl+Tab is not even possible. Down is Esc [ B, so Shift+Down is obviously Esc [ 2 ; 1 B. (Apparently this is not as complicated as I was expecting it to be.)