mg is described as 'This is a portable version of the Mg editor from OpenBSD by an OpenBSD developer who did a bunch of overhaul work on the version of Mg found in the OpenBSD base system' and is an app in the Development category. There are more than 10 alternatives to mg for a variety of platforms, including Linux, Mac, Windows, BSD and Haiku. The best alternative is Vim, which is both free and Open Source. Other great apps like mg are GNU nano (Free, Open Source), GNU Emacs (Free, Open Source), CudaText (Free, Open Source) and Micro (Free, Open Source).
GNU nano is a small and friendly text editor. Besides basic text editing, nano offers many extra features like an interactive search and replace, go to line and column number, auto-indentation, feature toggles, internationalization support, and filename tab completion.
CudaText is a cross-platform text editor, written in Lazarus. It starts quite fast (0.5 sec with ~30 plugins on CPU Intel Core i3 3Hz). It is extensible by Python add-ons (plugins, linters, code tree parsers, external tools).
vy is a modal editor with a very modular architecture. vy is built on top of Tkinter which is one of the most productive graphical toolkits; It permits vy to have such a great programming interface for plugins.
4coder is a minimalist, cross platform, programmable, code editing environment, catering to the needs of low level programmers. It allows you to use one work flow across Windows, Linux, and Mac (with the exception of your debugger... for now.).