Micro, the Ultimate Editor for the Mac OS Terminal!

The easiest full-featured coding, note taking, configuration editing, and writing app for the Mac OS Terminal

Stew Alexander
Awesome command line tools for the Mac
4 min readJul 14, 2023

--

<<Micro Logo>>

First off…

Why in the world would anyone want to write software, or an essay, take notes, or edit a file via the Mac OS terminal / CLI?

A couple of reasons come to mind:

  • You’re already using the terminal, and the thought of opening an app, finding the file and editing it is a pain, and what if the app cannot read the file? Micro can open just about anything …
  • You are logging in remotely to the Mac via ssh and need to write or edit a file
  • You want to explore using the Mac Terminal
  • You’re a fan, like me, of bespoke syntax highlighting!
  • Why not?

Anyway, whatever the reason, Micro is by far the easiest and most complete tool to use to do so (programming purists and Linux folks use Vim, but it has this wonky early 70s editing syntax that makes it a beast to use; or maybe Nano that still requires learning and has less than a third of Micro’s features)

So how do I install Micro?

  1. Open the Mac Terminal app (From the Desktop Finder Menu click on the “Go” menu, click on “Utilities”, then open the Terminal app by double clicking it)

2. Once the Mac Terminal app is open, type the following (and press return):

brew install micro

Wait that didn’t work, why not? The reason is you will need to install something called Homebrew which is a way to install apps for the Mac terminal / CLI. (I go more into this tool in this article), just copy and paste the below weird text to the command line (then press return), and if you have an internet connection this should install this packaging app for you; then try the above brew command again.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

3. Once Micro is installed, type “micro” and the file you want to open, or if a new file just type micro and the name you want to give to your file like so (where “hello.txt” is the file name)

$ micro hello.txt

Then after pressing enter you should see something like this, where the “1” at the left represents that you are on the first line, and ready to enter text

More on how to use Micro below …

Micro Editor Cheatsheet:

Basic Navigation:

  • Move cursor: Arrow keys, Page Up/Down, Home/End
  • Move by word: Ctrl+Left/Right

Basic Editing:

  • Cut line: Ctrl+K
  • Paste from clipboard: Ctrl+V
  • Undo: Ctrl+Z
  • Redo: Ctrl+Y
  • Search: Ctrl+F, Enter query, press Enter to cycle through results
  • Replace: Ctrl+R, Enter search query, Enter replacement, press Enter to cycle and replace

Multi-line Editing:

  • Start selection: Alt (or Option on macOS)+Click (with mouse) or Alt+Shift+Arrow keys
  • Select multiple lines: Click and drag (with mouse) or Shift+Arrow keys
  • Cut, copy, paste: Ctrl+X, Ctrl+C, Ctrl+V

File Operations:

  • Save: Ctrl+S
  • Quit: Ctrl+Q
  • Open file: Ctrl+O
  • Save as: Ctrl+Shift+S
  • New tab: Ctrl+T
  • Close tab: Ctrl+W

Split View:

  • Split horizontally: Ctrl+E followed by S
  • Split vertically: Ctrl+E followed by V
  • Navigate between splits: Ctrl+E followed by Arrow keys
  • Close split: Ctrl+Efollowed by Q

Show white space characters

To show white space characters in Micro editor, you can press the Ctrl and Shiftkeys together, and then press the 8 key. This will enable the display of whitespace characters such as spaces, tabs, and line breaks as symbols on the screen.

Customization:

  • Micro has a settings file named “settings.json”. To access and edit it:

1. Open micro and press Ctrl+E

2. Type "config" and press Enter

Micro Customizations

Micro is a highly customizable editor for Linux. Here are some cool customizations you can apply to enhance your experience:

  1. Change color scheme: Micro has several built-in color schemes. To change the color scheme, open Micro and press Ctrl+E, then type:
set colorscheme solarized

Replace “solarized” with any of the available color schemes: “default”, “simple”, “solarized-dark”, “solarized-light”, “gruvbox-dark”, “gruvbox-light”, “monokai”, “night”, or “zenburn”.

  1. Enable soft wrapping: To enable soft wrapping in Micro, press Ctrl+E and type:
set softwrap true
  1. Show line numbers: To show line numbers in Micro, press Ctrl+E and type:
set ruler true
  1. Customize keybindings: To customize keybindings, open your Micro configuration directory:
cd ~/.config/micro/

Create a “bindings.json” file and edit it:

touch bindings.json
micro bindings.json

Add your custom keybindings inside the file. For example, to map Ctrl+D to delete a line:

{
"CtrlD": "Cut"
}
  1. Install plugins: Micro has a plugin system that allows you to extend its functionality. To list available plugins, press Ctrl+E and type:
plugin list

To install a plugin, press Ctrl+E and type:

plugin install plugin_name

Replace “plugin_name” with the name of the plugin you want to install.

Remember that after applying any customization, you can save the settings by pressing Ctrl+E and typing “config”.

For more information on customizations and plugins, consult the official Micro documentation at https://github.com/zyedidia/micro.

--

--

Stew Alexander
Awesome command line tools for the Mac

Stew Alexander is a network engineer, technology journalist, programmer ​and pianist living in Mebane, NC USA (Full Bio: StewAlexander.com/bio)