Jump to content

micro

From ArchWiki

micro is a terminal-based text editor that aims to be easy to use and intuitive, while taking advantage of the full capabilities of modern terminals. It is shipped as a single, static binary with no dependencies.

As the name suggests, micro aims to be a successor to the nano editor, as it is easy to install and use, but micro also strives to be pleasant to use on a daily basis.

Installation

Install the micro package.

Configuration

Micro uses $MICRO_CONFIG_HOME or $XDG_CONFIG_HOME/micro as its configuration directory. If these variables are not set, it defaults to ~/.config/micro. The main settings are defined in the settings.json file. You can find all available options here.

Tip To display the main help file, press Ctrl+g.

Syntax highlighting

The colorscheme can be changed via the configuration file or from the micro command line. To do this, press Ctrl+e and type the command

set colorscheme [name]

Plugins

To install a plugin, use the command

plugin install [name]

inside micro. To remove one, use plugin remove [name]. The plugin help guide is available by running the command help plugins.

Tip If you want to create a plugin, follow the instructions in the official documentation.

Tips and tricks

Replace vi with micro

To replace vi with micro as the default text editor for commands such as visudo, set the VISUAL and EDITOR environment variables:

export VISUAL=micro
export EDITOR=micro

See also