9 ms·
Mle is a small, flexible, terminal-based text editor written in C
- mysterydip 4y agoHow do I say it? mlee? mleh? mlay? em-el-ee?
- printf_alex_ 4y agoI'm a "mleh" person
- drekipus 4y agoMelee
- onlyrealcuzzo 4y agoI think it's supposed to be Emily.
- amelius 4y ago> Favor simplicity over portability Not sure if I'd go with that one.
- forgotpwd16 4y agoUnless you plan to run it on some exotic Unix, why you'ld prefer portability over simplicity?
- deleted 4y ago[deleted]
- kazinator 4y agoHow about: For an interactive program, favor simplicity over portability to more than a handful popular platforms that people are actually using. Do not favor simplicity over portability to more than one platform. (Feel free to ignore this if you work for Microsoft, as the maintainer of calculator.exe, and similar work.) Definitely favor simplicity over portability to systems that use sign-magnitude integer representations, or have 36 bit words and 9 bit bytes, or binary files that add extra zeros to pad your file to a full sector, or have no POSIX or Windows API whatsoever, or whose null pointer is not an all-zero bit pattern, ... even if your program runs on some computer they have in the basement of the Smithsonian, they are not going to to risk installing it there, and if they do, nobody will use it.
- rkta 4y ago> Stackable key maps (modes) Does this mean I can have a vi-like experience, but I have to configure it myself? A quick look into the help page of mle was not very helpful.
- KMnO4 4y agoModes doesn’t mean Vi-like; just that you can have multiple commands on the same bindings. The power of Vi is in the grammar. It’s fairly intuitive to combine motions with verbs, and you can string together chains of commands without much thought. For example, “04wd$VU” would uppercase the first four words in a line and delete the rest of the line. I don’t think something like that would be achievable with the basic key mapping that Mle has.
- Gualdrapo 4y agoMade me doubt about my fidelity towards vis[0] but then realized mle does not have vi-like modal editing. [0] https://github.com/martanne/vis https://github.com/martanne/vis
- williamstein 4y agoI randomly stumbled on Vis a week ago and have been pretty obsessed with it. It’s amazing how little code it is (eg builds from source in a couple seconds), and the Lua integration is really cool! Also, Vis has really cool structural support for multiple cursors. I’m working on a WebAssembly port of Vis…
- deleted 4y ago[deleted]
- frou_dh 4y agoI saw this editor recently as a consequence of noticing that there seems to be a rewrite of the termbox library (ncurses alternative) in progress: https://github.com/termbox/termbox2 https://github.com/termbox/termbox2
- haunter 4y agoLove when projects use asciinema to show a quick demo. It's incredibly useful tool
- kazinator 4y agoA better alternative is to record the window with a screen recorder. Here is why, point by point: * You get a video in a standard container and modern compression format you can host anywhere, and edit with video editing tools. * Screen recorders can capture the microphone too, so you can explain what you're doing. * Importantly, they can also capture the mouse cursor, which is useful even in a demo of a TTY app that has no built-in mouse support, because you can point to things in the terminal and highlight them as you speak. Mouse-based copy and paste actions are easier for the viewer to follow when there is a cursor. * Everything you see is captured, pixel for pixel (other than very very fast, fleeting actions that are quicker than the frame rate, obviously). * If in the demo you need to scroll up through the TTY history with the scrollbar or Shift-PgUp, that is all nicely captured. Your scrollbar is included in the video. I can't recommend asciinema becuase while the tools to record TTY sessions are free, the animated rendering is done by uploading to the website. There are ways to self-host asciicast, but that looks like a huge PITA compared to a video file you can send to someone as a mail mail attachment, drop into a Slack channel, or put into a shared file directory. I don't want to become a host to give someone a file. I tried alternatives to asciicast like ttystudio; they are all a hassle compared to even the most basic screen recording app like kazaa on Ubuntu, and lose on all the above points. But at least some of the alternatives give you a GIF file you can put anywhere. Some work by simulating an ANSI terminal internally, rendering it to pixels and taking snapshots of that state --- which is just a form of screen recording! I would say it's fair to TTY specific recording an anti-pattern. It seems cool and everyone is doing it, until they slap themselves on the forehead one day.
- ducktective 4y agothat reply....omg! kazinator is a man of focus, commitment and sheer f*king will
- gnubison 4y ago
- amadeuspagel 4y ago> The default key bindings are intuitive. Input text as normal, use directional keys to move around, use Ctrl-S to save, Ctrl-O to open, Ctrl-X to exit. Ctrl-X to exit is not intuitive. That's used to cut text almost everywhere. Instead, use Ctrl-Q (quit). It's been 35 years since CUA[1]. Another terminal editor, micro[2], already adopted these conventions—Ctrl-C to copy, Ctrl-X to cut, Ctrl-V to paste—other terminal editors should as well. [1]: https://en.wikipedia.org/wiki/IBM_Common_User_Access https://en.wikipedia.org/wiki/IBM_Common_User_Access [2]: https://micro-editor.github.io/ https://micro-editor.github.io/
- Andoryuuta 4y agoFrom my perspective of using nano for all simple text editing on linux, ctrl-X to exit seems very intuitive to me. Plus it's even used in that one famous Matrix scene[1] where he is trying to close out of whatever he sees open on his computer. ;) [1]: https://youtu.be/sjoad6gcRzs?t=31 https://youtu.be/sjoad6gcRzs?t=31 (31 ~ 50s)
- amadeuspagel 4y agoBut nano doesn't use Ctrl-S to save and Ctrl-O to open, so Mle already breaks with nano.
- sigzero 4y agoNano should not be the "standard" as that community is small.
- 9dev 4y agoIs it, though? I’d argue that nano is the most accessible, easily discoverable, and usable editor for simple text editing available on almost any Linux system out there. It’s no IDE, but it never claimed it was either. It doesn’t require a manual, as even the shortcuts are shown at the bottom of the screen for reference. And it includes syntax highlighting, tab handling, and basic cut/copy/paste handling. What is it you’re missing from a standard text editor?
- Aperocky 4y agoLooks much like vim, what's the differentiation? vim is also super extensible with plugins - one of the biggest reason to use it.
- forgotpwd16 4y agoIt isn't anything like vim since it doesn't utilize a modal paradigm. Rather what mle means with modes is different keymaps depending on context, i.e. replace grep with git grep if .git exists. If you want to compare to something else, it can said it's a more advanced (aforementioned keymaps, splittable windows, and others) Lua-extensible nano.
- Aperocky 4y agoThat's too bad, I was assuming it does. Modal editing is definitely a must for terminal editors, and generally good for all editors.
- ghosty141 4y agoMy guess is the idea is that you can easily extend and customize it since the code base is kept small and simple (10k loc seems quite neat). I'm personally not the crowd who'd use this kind of software. My preference is emacs which has a different philosophy when it comes to "hacking" the editor. This project might be something for the suckless crowd.
- dbttdft 4y agoWhat's with the hacker community and their obsession with a terminal emulator? You're just writing to a framebuffer when you call printf. You may as well cut out the middleman and get better, more responsive controls and rendering of a GUI (and let's not pretend this application is not a GUI). I prefer nedit, just wish it would support Unicode. Or maybe I don't and Unicode should just stop existing. I also notice nedit has less input latency than vim on most terminal emulators.
- jbverschoor 4y agoTerminal / monospaced font gives a lot of calmness to your screen. It also forced you to think about keyboard shortcuts and controls in general.
- 9dev 4y agoBut why would I want to think about keyboard shortcuts and remember controls, if we can have better, self-discoverable interfaces rather than something designed in the 1970ies?
- chrsig 4y agoI find they're very different parts of memory. Keyboard shortcuts live in your hands -- they're muscle memory. Trying to remember where some option in a cluttered dropdown menu you used 20 minutes ago is working memory, something I'm personally terrible with. It's either whiplash out of a flow state, or risks sidetracking me. It takes practice to build muscle memory, but it's something that generally stays with you for a long time, so it's an investment. The point is that you don't think about keyboard shortcuts. You just think about the thing you need to do, and let your hands do it.
- jbverschoor 4y agoDoesnt have to be shortcuts. You know where the items are. Press menu -> 3x down, enter, enter, tab, tab, type something, done. Compare that to the same by mouse. This is why old cashier systems are so super fast.
- jbverschoor 4y agoI always liked the way Borland C++, Power Menu, and Norton Commander worked.
- hobo_mark 4y agoDoes there exist a terminal-based editor with VS Code shortcuts? 90% of the time all I want is the multi-cursor mode (Ctrl-D etc). Vim colleagues insist I could just write macros, yeah no.
- Brian_K_White 4y ago"I want X" "Here you go" "Yeah no"
- gilnaa 4y ago"I want X" "Here's Y" "Yeah no"
- bitwize 4y agoWritten in C! I see you like to live... dangerously.
- Zababa 4y agoWhat's dangerous about this? I don't know much abojt security, are text editors a common threat vector?
- t43562 4y agoI don't want to be mean. I do notice sometimes that "small text editors" have a habit of becoming more and more "fully featured" until they're not small anymore.