LinuxCommandLibrary
GitHub F-Droid Google Play Store

Micro Text Editor

Getting Started

Micro is a modern terminal text editor with intuitive keybindings. If you know Ctrl+S to save and Ctrl+Z to undo, you already know the basics.
$ micro textfile.txt
copy
KeyDescription
Ctrl+qQuit (or close the current tab/split)
Ctrl+sSave current file
Ctrl+oOpen a file
Ctrl+gOpen the help menu
Ctrl+eOpen the command bar
Alt+gShow what every key does in a bar at the bottom

Navigation

Standard arrow keys, Home, End, Page Up, and Page Down all work as expected. These shortcuts provide additional movement.
KeyDescription
Ctrl+LeftMove to previous word
Ctrl+RightMove to next word
Alt+{Move to previous paragraph
Alt+}Move to next paragraph
HomeMove to beginning of line
EndMove to end of line
Ctrl+HomeMove to start of file
Ctrl+EndMove to end of file
Jump to a line with the command bar: press Ctrl+e, then type the goto command.
$ goto 42
copy

Selection

Hold Shift with any movement key to select text.
KeyDescription
Shift+ArrowExtend selection by one character or line
Ctrl+Shift+LeftSelect to previous word
Ctrl+Shift+RightSelect to next word
Shift+HomeSelect to beginning of line
Shift+EndSelect to end of line
Ctrl+aSelect all text

Editing

Copy, cut, and paste use the familiar system shortcuts.
KeyDescription
Ctrl+zUndo
Ctrl+yRedo
Ctrl+cCopy selected text
Ctrl+xCut selected text
Ctrl+vPaste from clipboard
Ctrl+kCut the current line
Ctrl+dDuplicate the current line
TabIndent selection or insert tab
Shift+TabUnindent selection
Ctrl+uStart/stop recording a macro
Ctrl+jPlay the recorded macro

Search and Replace

Search is incremental: matches highlight as you type.
KeyDescription
Ctrl+fFind
Ctrl+nFind next match
Ctrl+pFind previous match
Alt+FFind literal (no regex)
Replace runs from the command bar (Ctrl+e). It asks for confirmation at each match unless you add -a.
$ replace "search" "replacement"
copy
$ replace -a "search" "replacement"
copy

Multiple Cursors

Edit several places at once. Type normally and every cursor applies the change; press Escape to return to a single cursor.
KeyDescription
Ctrl+ClickPlace an additional cursor
Alt+nSpawn a cursor at the next match of the current word
Alt+xSkip the current match
Alt+pRemove the last added cursor
Alt+cRemove all extra cursors
Alt+mSpawn a cursor on every match

Tabs and Splits

Open files side by side or in tabs. Splits are created from the command bar (Ctrl+e).
$ vsplit other.txt
copy
$ hsplit notes.txt
copy
$ tab third.txt
copy
KeyDescription
Ctrl+tOpen a new tab
Alt+,Switch to previous tab
Alt+.Switch to next tab
Ctrl+wJump to the next split
Ctrl+qClose the current split or tab

Useful Commands & Options

The command bar (Ctrl+e) also changes settings, permanently stored in ~/.config/micro/settings.json.
$ set tabsize 4
copy
$ set tabstospaces on
copy
$ set ruler off
copy
$ set colorscheme monokai
copy
$ help defaultkeys
copy
KeyDescription
Ctrl+rToggle line numbers (ruler)
Ctrl+bRun a shell command

Mouse

Micro has built-in mouse support: click to place the cursor, drag to select text, scroll with the wheel, and double-click to select a word.
Copied to clipboard
Kai

AltStyle によって変換されたページ (->オリジナル) /