Forrest logo
tool overview
On this page you find all important commands for the CLI tool mg. If the command you are looking for is missing please ask our AI.

mg

mg is a command line text editor designed to be extremely lightweight and easy to use. It stands for "Micro GNU/Emacs" and aims to provide a subset of the functionality found in the GNU Emacs editor.

mg was created by OpenBSD developers as a smaller, more minimalist alternative to Emacs. It is written in C and follows the key bindings and interface of Emacs, making it familiar to Emacs users.

Despite its smaller size, mg still includes many powerful features, such as syntax highlighting, regular expression search and replace, macro recording, and multiple buffers. It also supports Unicode, making it capable of editing files in various languages and character sets.

mg focuses on simplicity and efficiency, favoring lightweight and fast operation. It has a small memory footprint and is designed to work well on older hardware or systems with limited resources.

One notable feature of mg is its extensibility through user-defined macros and keybindings. Users can customize and extend mg to suit their needs, adding new functionality or further optimizing their editing workflow.

mg is widely available and can be found in many Unix-like operating systems, including OpenBSD, FreeBSD, and NetBSD. It is also available as part of the mg package in various Linux distributions.

Being a command line editor, mg is popular among system administrators and programmers who prefer working in a terminal environment. It can be easily integrated into scripts and used for editing configuration files or writing code directly on the command line.

Overall, mg offers a lightweight alternative to traditional text editors without compromising on functionality. Its simplicity, speed, and extensibility make it a versatile tool for those who prefer working with command line interfaces.

List of commands for mg:

  • mg:tldr:6d0ee mg: Open files in a read-only mode.
    $ mg -R ${filename1 filename2 ---}
    try on your machine
    explain this command
  • mg:tldr:8fe82 mg: Open a file at a specified line number.
    $ mg +${line_number} ${filename}
    try on your machine
    explain this command
  • mg:tldr:a3438 mg: Disable `~` backup files while editing.
    $ mg -n ${filename}
    try on your machine
    explain this command
  • mg:tldr:cea0f mg: Open a file for editing.
    $ mg ${filename}
    try on your machine
    explain this command
tool overview