The throne of “Best Linux Text Editor” is widely debated, but one thing’s for certain—nano isn’t great. It’s simple, but lacks features included in its more complex contemporaries. micro is designed to replace nano as the text editor for the masses.

Installing Micro

micro isn’t on apt yet, but it’s only a single binary, so you can install it from its install script. Luckily, they’ve given it an easy-to-remember URL, which makes installing it on remote machines fairly simple:

This installs micro to the current directory, but you’ll likely want to move it onto the PATH:

That’s it, though if you’re on macOS, you can install micro from brew:

If you have snap, micro is available there as well.

Also, some systems might not properly copy to clipboard, so you may have to install xclip:

If all else fails though, you can usually hold down Alt or Option to select the terminal text itself rather than selecting it in micro, if you’re trying to copy out of the terminal.

Using Micro

Part of what makes micro so good is how much we don’t have to explain here. You use it like any other text editor when loading in a file:

You can create new files with this syntax, as well as taking input from pipes.

The editor itself features a notable upgrade from nano, with syntax highlighting for most common file types. In addition, you’ll find a column for line numbers, in addition to two lines at the bottom for the UI.

One thing you’ll quickly notice is that micro has proper mouse support. Unlike nano, you can scroll the whole window properly with the scroll wheel (rather than moving the cursor down a line), and you can click anywhere to move the cursor. You can drag to select text as well.

We would list a bunch of micro hotkeys here, but you already know them. micro uses sensible hotkeys, so rather than saving with Control+O, you can use the familiar Control+S. You can copy and paste with Control+C and Control+V.

You can easily quit the application with Control+Q (rather than pressing Esc, both foot pedals, and a glissando of keys). Exiting this way will ask you to save the modified buffer if you’ve made any changes, which makes saving and closing quite easy.

Micro also supports undo and redo, find and replace, and a bunch of commands including support for tabs, vertical and horizontal splitting, regex support, as well as evaluating Lua expressions.

Keep in mind that if you’re on a Mac, you’ll still have to press Control, rather than Command, though you’re likely used to that if you’ve used a terminal for long enough.

How to Set Micro as The Default Editor

Bash exposes a variable for exactly this purpose called $EDITOR. You can echo yours to see what it is, but you’ll likely want to set it where you set other variables like $PATH: your .bashrc. This file may also be called .bash_profile, but it’s the main entry point for whenever you create a new shell. Open it up in … well, micro:

Then add the following line:

You can also alias micro to something short here; mc works well:

The $EDITOR variable should be respected by git (no more getting stuck in vim), but if it isn’t, you can change it manually with:

Other programs, such as crontab -e, will use the system default.