Micro Text Editor Cheat Sheet for MacOS

In my opinion, the command-line text editor "micro" is the best alternative for vi/vim and offers more functions than nano. What's so special about it, is the intuitive UI, since many key combinations correspond to those known from other Mac programms (such as control+s for saving or control+f for searching, etc.). However, you have to use the control key instead of the command key, as the command key is already assigned to the terminal programme.

Installation

Use homebrew for installing micro on your Mac:

brew install micro

Setup for MacOS:

The keybindings on MacOS for micro are a bit problematic. The best you can do is use iTerm2 instead of the build-in Terminal.

In iTerm2 go to Preferences->Profiles->Keys->Presets and choose xterm defaults and select Esc+ for Left Option Key as well.

If you still insist on using the build-in Terminal, be sure to set Use Option key as Meta key under Preferences->Profiles->Keyboard to use option as alt.

Plugins

There are some very usefull plugins for micro. You can show a list of all available plugins by typing plugin available in the micro command line or you can find it here online.

My favorites plugins for micro are:

  • filemanager
  • editorconfig

You can install a plugin in the micro command line by typing:

plugin install <name of plugin>

You can list all installed plugins by typing in the micro command line:

plugin list

Keybindings for micro on macOS

The following keybindings asume, that you use iTerm2 with the settings mentioned above (see Setup for MacOS).

keyfunction
control+q or F10quit editor or quit current window
control+s or F2save current file
control+eopen command line
control+zundo
control+yredo
control+wcycle between window splits (see command vsplit and hsplit)
control+rtoggle line numbers on or off
 Moving around:
/ / / move cursor arround
option+ / move cursor to next word
fn+ or esc+emove cursor to end of line
fn+ or esc+amove cursor to start of line
fn+move cursor page down
fn+move cursor page up
control+ljump to line (prompts for line nr)
 Search and Replace:
control+f or F7search
control+njump to next hit of current search
control+pjump to previous hit of current search
 Text-Selection
shift+ / select character left/right
shift+option+select word left/right
shift+fn+select until end of line
shift+fn+select until start of line

Comments

No Comments

Write comment

* These fields are required