{"id":15148721,"url":"https://github.com/troglobit/mg","last_synced_at":"2025-05-15T17:05:43.106Z","repository":{"id":46547433,"uuid":"58325928","full_name":"troglobit/mg","owner":"troglobit","description":"Micro (GNU) Emacs-like text editor ❤️ public-domain","archived":false,"fork":false,"pushed_at":"2025-01-18T22:45:58.000Z","size":1626,"stargazers_count":445,"open_issues_count":1,"forks_count":43,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-07T23:04:04.502Z","etag":null,"topics":["alpine-linux","bsd","cygwin","debian","docker-image","dragonfly","dragonflybsd","editor","emacs","freebsd","illumos","linux","macos","micro-emacs","musl-libc","netbsd","openbsd","solaris","text-editor","unix"],"latest_commit_sha":null,"homepage":"https://man.troglobit.com/man1/mg.1.html","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/troglobit.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-08T18:41:56.000Z","updated_at":"2025-04-07T19:24:17.000Z","dependencies_parsed_at":"2024-01-14T11:48:33.480Z","dependency_job_id":"815ea597-160e-4345-8b80-88f8a9e83fd5","html_url":"https://github.com/troglobit/mg","commit_stats":{"total_commits":614,"total_committers":29,"mean_commits":21.17241379310345,"dds":"0.23127035830618892","last_synced_commit":"fbc84fc7d59fd3f7ed5134a0e2acbbd4298df81d"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troglobit%2Fmg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troglobit%2Fmg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troglobit%2Fmg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troglobit%2Fmg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/troglobit","download_url":"https://codeload.github.com/troglobit/mg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254384988,"owners_count":22062422,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alpine-linux","bsd","cygwin","debian","docker-image","dragonfly","dragonflybsd","editor","emacs","freebsd","illumos","linux","macos","micro-emacs","musl-libc","netbsd","openbsd","solaris","text-editor","unix"],"created_at":"2024-09-26T13:22:06.055Z","updated_at":"2025-05-15T17:05:38.096Z","avatar_url":"https://github.com/troglobit.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Micro (GNU) Emacs\n=================\n[![License Badge][]][License] [![GitHub Status][]][GitHub] [![Coverity Status][]][Coverity Scan]\n\nContents\n--------\n\u003ca href=\"doc/mg.png\"\u003e\u003cimg align=\"right\" src=\"doc/mg.png\" title=\"mg in action\"\u003e\u003c/a\u003e\n\n* [Introduction](#introduction)\n* [Usage](#usage)\n* [Building](#building)\n* [Docker](#docker)\n* [History](#history)\n* [Origin \u0026 References](#origin--references)\n\n\nIntroduction\n------------\n\nMg is a [Micro Emacs][] clone created in 1987, based on the original\n[MicroEMACS][] v30 released by Dave Conroy in 1985.  The name, \"Micro\nGNU Emacs\", was disputed early on by the FSF, so today it simply goes by\n`mg`.  This software is fully free and in the public domain.\n\nThe intention is to be a small, fast, and portable Emacs-like editor for\nusers who cannot, or do not want to, run the real Emacs for one reason\nor another.  Compatibility with GNU Emacs is key for Mg, separating it\nfrom other [ErsatzEmacs][] clones, because there should never be any\nreason to learn more than one Emacs flavor.\n\n\u003e Try the [latest release](https://github.com/troglobit/mg/releases/latest),\n\u003e use the tarball with a version in the name, avoid GitHub generated links!\n\u003e Releases come with a `configure` script, so you don't need autotools.\n\u003e Only a C compiler, `make` and you're set to go.\n\n\nUsage\n-----\n\nWhen Emacs was born keyboards had a `Meta` key.  Accessing functions\nwith `Meta` combinations today is usually the same as holding down the\n`Alt` key, or tapping `Esc` once.\n\nOther editors use short forms like `Ctrl-V` or `^V`, in Emacs this is\nwritten `C-v`.  Some usage examples:\n\n| **Key** | **Short** | **Example** | **Description**                       |\n|---------|-----------|-------------|---------------------------------------|\n| Meta    | M-        | M-x         | Hold down `Alt` and tap `x`           |\n| Ctrl    | C-        | C-g         | Hold down `Ctrl` and tap `g`          |\n| Ctrl    | C-        | C-x C-c     | Hold down `Ctrl` then tap `x` and `c` |\n\nTo access the built-in Quick Help, press `C-h q`, meaning: hold down\n`Ctrl` and tap `h`, then release `Ctrl` and tap `q`.  The `-` has a\nmeaning, as you can see.\n\n\nBuilding\n--------\n\nThis project is completely self hosting.  However, by default you need a\ntermcap library, like [Ncurses][], to provide APIs like: `setupterm()`,\n`tgoto()`, and `tputs()`.\n\n\u003e See below for how to *build without Ncurses*.\n\n\n### With termcap/terminfo/curses\n\nOn recent Debian/Ubuntu based systems `libtinfo-dev` can be used, on\nolder ones the include file `term.h` is missing, so `libncurses-dev`\nmust be used instead:\n\n    sudo apt install libtinfo-dev\n\nor\n\n    sudo apt install libncurses-dev\n\nOn other systems you have to install the full Ncurses library instead,\non RHEL, CentOS, and Fedora:\n\n    sudo yum install ncurses-devel\n\nor\n\n    sudo dnf install ncurses-devel\n\nOn macOS you need the Xcode command line tools and headers:\n\n    xcode-select --install\n\nThen build Mg from the unpacked release tarball:\n\n    ./configure\n    make\n    sudo make install\n\n\n### Without curses, completely stand-alone\n\n    make clean\n    ./configure --without-curses\n\tmake\n\tsudo make install\n\n\n### Building from GIT\n\nUsers who checked out the source from GitHub must run `./autogen.sh`\nfirst to create the configure script.  This requires GNU autotools to be\ninstalled on the build system.\n\nThere are several options to the configure script to disable features,\ne.g., to reduce the size, or remove features if you want to be on par\nwith the official Mg.  By default, all below features are enabled:\n\n    ./configure --help\n    [..]\n    --disable-autoexec   Disable auto-execute support\n    --disable-cmode      Disable C-mode support\n    --disable-compile    Disable C compile \u0026 grep mode, used by C-mode\n    --disable-cscope     Disable Cscope support\n    --disable-ctags      Disable ctags(1) support, required by Cscope\n    --disable-dired      Disable directory editor\n    --disable-notab      Disable notab mode support (not in OpenBSD)\n    --disable-regexp     Disable full regexp search\n    --disable-togglenl   Disable toggle-newline-prompt extension (not in OpenBSD)\n    --disable-all        Disable all optional features\n    [..]\n    --with-startup=FILE  Init file to run at startup if ~/.mg is missing\n    --with-mglog         Enable debugging to log file, default: ./log/*.log\n    --without-curses     Build without curses/termcap, default: auto\n\n\nTo build the smallest possible mg, with many features removed:\n\n    ./configure --disable-all --enable-size-optimizations\n    make\n    sudo make install-strip\n\nTo build a completely static mg with all features:\n\n    ./configure LDFLAGS=\"-static\"\n    make\n    sudo make install-strip\n\n\nDocker\n------\n\nAlpine Linux based Docker container images are available from GitHub:\n\n    docker pull ghcr.io/troglobit/mg:latest\n\nTo edit files from your host's `$HOME`, map it to the container's\n`/root` and run:\n\n    docker run -ti -v $HOME:/root ghcr.io/troglobit/mg:latest\n\nThis supports reading your `~/.mg` and it even takes arguments on the\ncommand line.  Both quick help and the tutorial are bundled.\n\n\nHistory\n-------\n\nThe history is long and intertwined with other MicroEMACS spin-offs but\ngoes something like this:\n\n* Nov 15, 1985: MicroEMACS v30 released to mod.sources by Dave G. Conroy\n* Mar  3, 1987: First Release (mg1a) via comp.sources.unix\n* May 26, 1988: Second release: (mg2a) via comp.sources.misc\n* Jan 26, 1992: Linux port released by Charles Hedrick. This version\n  later makes its way onto tsx-11, Infomagic, and various other Linux\n  repositories.\n* Feb 25, 2000: First import into the OpenBSD tree, where it is\n  currently maintained with contributions from many others.\n* May  8, 2016: Import from OpenBSD 5.9 to [GitHub][repo]\n* May 15, 2016: Mg v3.0, first port back to Linux, by Joachim Wiberg\n* Jul 22, 2018: Mg v3.1, removed libite dependency, by Joachim Wiberg\n* Aug 26, 2018: Mg v3.2, now fully portable[^1], by Joachim Wiberg\n* Dec 11, 2019: Mg v3.3, misc fixes and new features from OpenBSD\n* Aug 23, 2020: Mg v3.4, new modeline, quick-help, support for gzipped\n  files, and building without termcap/[Ncurses][], by Joachim Wiberg\n* Oct 17, 2021: Mg v3.5, support for Solaris/Illumos based UNIX systems\n  tested on OmniOS and OpenIndiana, sync with Mg from OpenBSD 7.0\n* Apr 10, 2023: Mg v3.6, sync with OpenBSD, improved ctags support\n* Aug 13, 2023: Mg v3.7, sync with OpenBSD, improved usability\n\nSee the source distribution for the list of [AUTHORS][].\n\n[^1]: This project has been extensively tested on Debian GNU/Linux,\n\tUbuntu, CentOS, Fedora, Alpine Linux, Solaris/Illumos based systems\n\tlike OmniOS, FreeBSD, NetBSD, OpenBSD, DragonFly BSD, Apple macOS \u003e=\n\t10.10, Cygwin, MSYS2, as well as a few embedded Linux systems using\n\tmusl libc and uClibc-ng.\n\n\nOrigin \u0026 References\n-------------------\n\nThis project is derived from OpenBSD Mg, which is the best (maintained)\nsource of the original Micro Emacs based on mg2a. The intention of this\nproject is to develop *new usability features*, track as many other Mg\nclones as possible, and, unlike the upstream OpenBSD version, enable\nhidden features using a standard GNU configure script, while remaining\nfriendly to porting to resource constrained systems.  New features:\n\n* Emacs-like modeline with `(row,col)` and new `display-time-mode`\n* Support for building without curses, using termios + escape seq.\n* Support for exhuberant/universal ctags `tags` file format\n* Built-in `*quick*` help using `C-h q`\n* Tutorial accessible using `C-h t`\n* Support for Ctrl-cursor + Ctrl-PgUp/PgDn like Emacs\n* Support for `M-x no-tab-mode` and `M-x version`\n* Support for opening gzipped text files in read-only mode\n\nMerged, and continously tracked, clones:\n\n* http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/mg/ (upstream)\n* https://github.com/hboetes/mg (official portable version)\n* https://github.com/ibara/mg (active)\n* https://github.com/scott-parker/mg-openbsd (inactive since 2015)\n* https://github.com/paaguti/mg3a (continuation of Bengt Larsson's mg3a)\n* https://github.com/kisom/kmg (another inactive fork with Go support)\n* https://github.com/jasperla/tinyschemg (OpenBSD mg with tinyscheme)\n\n\u003e **Note**: the official [portable Mg][] project, used by Debian and\n\u003e other GNU/Linux distributions, is maintained by Han Boetes.  Unlike\n\u003e this project, which is stand-alone, Boetes relies on [libbsd][] to\n\u003e maintain portability.\n\nPlease report any bugs and problems with the packaging and porting to\nthe GitHub issue tracker \u003chttps://github.com/troglobit/mg/issues\u003e\n\n[Micro Emacs]:     https://www.emacswiki.org/emacs/MicroEmacs\n[MicroEMACS]:      https://github.com/troglobit/MicroEMACS\n[ErsatzEmacs]:     https://www.emacswiki.org/emacs/ErsatzEmacs\n[portable Mg]:     https://github.com/hboetes/mg\n[libbsd]:          https://libbsd.freedesktop.org/wiki/\n[Ncurses]:         https://invisible-island.net/ncurses/\n[repo]:            https://github.com/troglobit/mg\n[AUTHORS]:         https://github.com/troglobit/mg/blob/master/doc/AUTHORS\n[License]:         https://unlicense.org/\n[License Badge]:   https://img.shields.io/badge/License-Unlicense-blue.svg\n[GitHub]:          https://github.com/troglobit/mg/actions/workflows/build.yml/\n[GitHub Status]:   https://github.com/troglobit/mg/actions/workflows/build.yml/badge.svg\n[Coverity Scan]:   https://scan.coverity.com/projects/8859\n[Coverity Status]: https://scan.coverity.com/projects/8859/badge.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftroglobit%2Fmg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftroglobit%2Fmg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftroglobit%2Fmg/lists"}