6 ms·
Mg: an Emacs-like editor in 160 kb
- aaronem 11y agoEasier just to learn enough of vi to get around. I mean, if I need a more familiar editor, I'm just going. to visit the file remotely via Tramp, and for simple stuff like quick config edits on remote machines, quicker just to use vi or sed or a Perl one-liner.
- sebastianavina 12y agoVery neat, I really wanted something like this
- typedweb 12y agoStandard text editor in OpenBSD. As an emacs user for 20+ years, mg feels good and not lacking like the other tiny emacs clones.
- Swizec 12y agoBut does it have Tetris?
- mixedmath 12y agoIt is no wonder that Richard Stallman asked them to change their name away from MicroGnuEmacs, especially when mg is not under GPL.
- NelsonMinar 12y agoI use mg all the time. It only takes half a second to launch and lets me use the emacs keyboard muscle memory I built up over 20 years. Happily I'm able to use a modern editor for most real editing.
- deleted 11y ago[deleted]
- beagle3 12y agoRelated: Fabrice Bellard[0]'s QEmacs. http://bellard.org/qemacs/ http://bellard.org/qemacs/ - a 160KB executable provides a mostly complete Emacs experience (sans scripting .. sort of like Mg), but does include syntax coloring, unicode, and watching video inside the editor. A 60KB stripped down version has a feature set comparable to Mg as far as I can tell. [0] of FFMPEG, QEMU, BPG, TCC, JSLINUX and more fame.
- PuercoPop 11y ago> a mostly complete Emacs experience (sans scripting ...), That is mostly not like not Emacs? Or did Zwei and other emacsen had the same key bindings as emacs and gnu's readline?
- melling 11y ago"sans scripting" The Lisp scripting is the entire point of Emacs. Who cares about the keybindings. I don't really see the point. Can't you just compile emacs? I remember 25 years ago when people thought emacs was too big, and small emacs clones were popular, but in 2015 no one cares, right? Rather than solving these easier useless problems, why doesn't someone solve the harder problem of making a better emacs clone with a high-performance Emacs Lisp clone. Then Emacs could be used to replace Visual Studio, Xcode, etc. Emacs is an editor construction kit: http://ergoemacs.org/features.html http://ergoemacs.org/features.html https://github.com/syl20bnr/spacemacs https://github.com/syl20bnr/spacemacs
- jlarocco 11y agoI was thinking the same thing. I mean, I can run full GNU Emacs on my Raspberry Pi. What's the point of a "micro emacs" missing all the good parts?
- __david__ 11y agoYou cannot, however, install full blown Emacs on your Netgear router running OpenWRT. Mg is heaven sent in cases like that. Tiny linux machines still exist (Raspberry Pi is not tiny, resource-wise).
- gnuvince 12y agoAs an Emacs guy, I really like mg(1). The one missing feature is Unicode support.
- stsp 12y agoPatches welcome. The first step would be iconv in OpenBSD base (there are existing BSD-licensed implementations to start from). Then have mg make use of it. http://marc.info/?l=openbsd-tech&m=134581162518146&w=2 http://marc.info/?l=openbsd-tech&m=134581162518146&w=2 (Edit: Or try adding a pure UTF-8 mode)
- gnuvince 11y agoLacking the time at the moment, but I've been meaning to hone my C skills and Hacking on OpenBSD seems like the best idea. Hopefully, I can finish this M.Sc. soon :)
- tjradcliffe 11y agoI'm an mg guy who uses Emacs when he has to. Unlike Emacs, mg is an editor. I don't know what tool-class Emacs properly falls into, but as many people here have pointed out, it's closer to a general-purpose scriptable environment than an editor. Editing is a side-effect of the other capabilities, very nearly. I know at least one person who uses Emacs as their shell. For those of us who just want a clean, fast, light-weight editor, mg is great. It's what Emacs would have been had it been an editor, instead of something else.
- reality_czech 11y ago"I just want an editor" is the vi philosophy, and has been since olden times. Emacs users tend to write a lot of emacs modes and lisp macros, whereas vi users generally use external programs or the shell. The thing is, vi is much better at being "just an editor" than emacs is. The key bindings for vi are highly ergonomic and let you keep your fingers on the home row almost all the time. With emacs, you're playing "twister" with your fingers, often pressing 3 or 4 keys simultaneously just do to some simple task like quitting or indenting a paragaph. vi also supports things like deleting to the end of the line, going to the end of the file, or even appending to the end of a line with a single keypress. If you're using something with emacs key bindings but no emacs-like extensibility, you're really getting the worst of both worlds. You really should just be using vi. And you will find a lot of people with your philsophy who use it, and it is installed on nearly every system out there.
- film42 12y agoI use emacs for most of my daily development, but always rely on nano or vi in the terminal due to emacs startup time. I'm going to give mg a shot this week!
- Dewie 12y agoYou could also run Emacs as a server.
- film42 12y agoI've actually looked into this, but it seemed like far too much overhead to simply open, edit and save a file; especially remotely.
- barrkel 12y agoRemotely, sure (though I usually use joe for that), but for local edits, I start emacs --daemon as part of my regular login procedure (along with creating multiple terminal windows) and thereafter use emacsclient (aliased to 'e') for almost all file editing. Only annoying thing is the way it retains buffers for modified files when you exit, even if you choose not to save them. emacs -q (or faster, -Q) could be used in a pinch, but I find default emacs almost unusable.
- mrottenkolber 12y agoYou can edit remote files directly in Emacs or simply use sshfs.
- jasonm23 11y ago1. Tramp. 2. Emacs daemon - as many suggest, why would you ever quit emacs? But if you do find you shut Emacs down... 3. Slimmed down alternative init eg. https://github.com/ocodo/.emacs.d/blob/master/emacsq https://github.com/ocodo/.emacs.d/blob/master/emacsq & https://github.com/ocodo/.emacs.d/blob/master/emacsq.el https://github.com/ocodo/.emacs.d/blob/master/emacsq.el (note this init could be even slimmer, but the start time is about 2.5 seconds, which is fast enough, and I get a very well configured environment) Or just ... 4. emacs -Q - no init. One of these are going to solve your issue, without having to interrupt your emacs flow. You could also look at your init for bottlenecks and have a secondary script. Which you can optionally run when you want those features. Keep the real init minimal. There's many strategies.
- Scarbutt 12y agoIs this toó big for busybox?
- jasonm23 11y agoIt should be ok for a busybox.
- jpmattia 12y agooff topic but related: Has anyone had any luck getting emacs to run on an ipad+keyboard, with sensible key-bindings (including a mapping for meta)?
- theophrastus 12y agoFor some curious reason all my browser right-click download efforts on that webpage resulted in a wrong-sized corrupted file. Yet good old curl does the job just fine: curl -O http://homepage.boetes.org/software/mg/mg-20150316.tar.gz And I can't remember when the last time i've had a program compile with just 'make' and no messing about. It's quite impressive. Thank you!
- philsnow 11y ago> Since it is written completely in C, there is currently _no language in which extensions can be written_; however, keys can be rebound and certain parameters can be changed in startup files. mg seems almost, but not quite, entirely unlike emacs. the thing that makes emacs emacs is not the keybindings or the so-called "modeless" editing (which is a misinterpretation by vim folks, emacs is way more modeful than vim), but the built-in scriptability / extensibility.
- SamReidHughes 11y agoNot when I'm on some tiny VM or computer and want something nicer than Nano that has something remotely close to Emacs keybindings. Then it's the keybindings, not the scriptability. I just want a reasonable editor.
- aaronem 11y agoLearn about Tramp, and for tasks complex enough to need a proper editor, you can edit those files in the same Emacs session you use for everything else. That's what I do with my RPi, for example -- it can pipe edits over an ssh session, so anything with an SSH server is eligible. (Revisiting this comment, it occurs to me to add that all my editing on my main machine is done this way. I play a game or two sometimes, so it runs Windows, but I run Emacs in a Linux VM and edit, in full X11-powered, keyboard-unfettered splendor, via transparent SSH authentication with the Windows host.)
- SamReidHughes 11y agoTramp is terrible. Sshfs is better. I don't think it's hard to think of situations where those options aren't as practical as popping open an editor on the command line that you're on.
- baohaojun 11y agoI use tramp for minor config file editting, it's not too bad. But when coding remotely, I like to setup 2 copies of code, one local, one remote. I always work on the local copy, then when I need to build, I use rsync to push the local code to the remote server for building remotely (because only the remote server has the os/compiler/cpu resources). It works great😁
- jhallenworld 11y agoHow does it compare with Jmacs (part of JOE)? BTW, anyone have a copy of Gosling's emacs? I know it went closed source, but I doubt it matters at this point.
- __david__ 11y agoI really like Mg. I tried a bunch of mini-emacsen at one point and Mg was the only one that had a decent set of Emacs key-bindings and didn't have weird gratuitous differences. It's so small that it launches instantaneously, even on tiny, slow computers.
- deleted 11y ago[deleted]
- Animats 11y agoThis has been done before, most notably as JOVE, Jonathan's Own Version of EMACS for the PDP-11. JOVE was written by Jonathan Payne while in high school, around 1980. That had to fit in a 16-bit machine, with 128KB of RAM available to the program.
- vidarh 11y agoMg's lineage is almost as old, coming out of MicroEMACS, first published in 1985. The first version of MicroGNUEmacs, now Mg, was published in 1986.
- robobro 11y agoMy .mg file - global-set-key "\^h" delete-backward-char global-set-key "\e[1~" beginning-of-line global-set-key "\e[4~" end-of-line set-default-mode fill set-fill-column 72 Been using it for quite some time and really dig it.
- minikomi 11y agoWould be even smaller without all the weird quotes in theo.c "Stop slacking you lazy bum!", "slacker slacker lazy bum bum bum slacker!", "I could search... but I'm a lazy bum ;)", "sshutup sshithead, ssharpsshooting susshi sshplats ssharking assholes.", "Lazy bums slacking on your asses." etc!
- mykhal 11y agoi you're lonely, just M-x theo ^M ^M ^M ...
- davidw 11y agoI would suggest 'jed' as a small alternative to Emacs. Its keybindings are mostly the same, and it's extensible. http://www.jedsoft.org/jed/ http://www.jedsoft.org/jed/ I happily used it on my first Linux computer, which only had 4 megs of ram.
- iso8859-1 11y agohow does this compare to torvalds emacs? https://git.kernel.org/cgit/editors/uemacs/uemacs.git https://git.kernel.org/cgit/editors/uemacs/uemacs.git
- oskarth 11y agoDid it ever occur to people that less can be more in terms of features? There might be a reason why people like Torvalds (Linux and de Raadt (OpenBSD, OpenSSH) specifically don't use the stock Emacs. Here are some other data points: Hickey (Clojure) uses the stock Acqumacs with zero customization and Graham (creator of HN and the first real web app) uses plain vi to edit Lisp. If you want to use a text editor to get work done, sane defaults and an editor that gets out of the way is king.
- josteink 11y ago> Did it ever occur to people that less can be more in terms of features? It can be, but it doesn't have to be. Sometimes more is more. As for your examples... > Here are some other data points: ... Graham (creator of HN and the first real web app) uses plain vi to edit Lisp. And you can tell the great amount of effort that makes him put into this very fine website, can't you? This is probably the worst website I frequently visit in terms of features, design, technical basis and mobile readability. It sucks in all respects except community. If this is the pinnacle of websites which vi can get us, please move everyone everywhere to anything else, notepad included. I've created better websites than this in Notepad (during my early university years), and that's not a joke.
- mhax 11y agoAt 160k it's not really in the true spirit of Emacs. ducks
- RexRollman 11y agoCleanng up software older than me: http://blog.anthrobsd.net/043.html http://blog.anthrobsd.net/043.html
- wirrbel 11y agoreally interesting how this tiny, old editor provokes so much "just use emacs" "just use vim" comments. kind of missing the point
- ehmuidifici 11y agoAlso it's still available for Archlinux (via AUR) https://www.archlinux.org/packages/community/i686/mg/ https://www.archlinux.org/packages/community/i686/mg/
- auxym 11y agoCommunity repo is a different thing from AUR
- lispm 11y agoFYI: the list of Emacs implementations: http://www.finseth.com/emacs.html http://www.finseth.com/emacs.html
- snoopybbt 11y agoHey, OP's point on the topic: I like GNU Emacs, and I run GNU Emacs most of the time. I _do_ know how to use vi/vim and I'm quite pragmatic on the matter. When I am doing server configurations, by the way, vi/vim start up way, way more quickly than GNU Emacs. This is good, but as I use emacs most of the time, I end up in mixing keyboard shortcuts. Thus, on my system, $EDITOR is /usr/bin/mg and /usr/bin/vi (vi, not vim) is a symlink to /usr/bin/mg. So I get emacs keybindings and a fast-starting editor. If i __do__ need syntax highlighting or anything, i run vim (not a symmlink) or the full GNU Emacs. Put simply.