3 Micro is a terminal-based text editor that aims to be easy to use and intuitive,
4 while also taking advantage of the full capabilities of modern terminals.
8 Once you have built the editor, simply start it by running
9 `micro path/to/file.txt` or simply `micro` to open an empty buffer.
11 Micro also supports creating buffers from stdin:
17 You can move the cursor around with the arrow keys and mouse.
21 These are the default keybindings, along with their actions.
27 * Ctrl-e: Execute a command
28 * Ctrl-g: Toggle help text
29 * Ctrl-b: Run a shell command
39 * Ctrl-p: Find previous
44 * Ctrl-d: Duplicate line
48 * Home: Go to beginning of line
49 * End: Go to end of line
50 * Ctrl-r: Toggle line numbers
52 You can use the alt keys + arrows to move word by word.
53 Ctrl left and right move the cursor to the start and end of the line, and
54 ctrl up and down move the cursor the start and end of the buffer.
56 You can hold shift with all of these movement actions to select while moving.
58 The buffer bindings may be rebound using the `~/.config/micro/bindings.json`
59 file. Each key is bound to an action.
61 For example, to bind `Ctrl-y` to undo and `Ctrl-z` to redo, you could put the
62 following in the `bindings.json` file.
71 Here are the defaults:
77 "Right": "CursorRight",
79 "ShiftUp": "SelectUp",
80 "ShiftDown": "SelectDown",
81 "ShiftLeft": "SelectLeft",
82 "ShiftRight": "SelectRight",
83 "AltLeft": "WordLeft",
84 "AltRight": "WordRight",
85 "AltShiftRight": "SelectWordRight",
86 "AltShiftLeft": "SelectWordLeft",
87 "CtrlLeft": "StartOfLine",
88 "CtrlRight": "EndOfLine",
89 "CtrlShiftLeft": "SelectToStartOfLine",
90 "CtrlShiftRight": "SelectToEndOfLine",
91 "CtrlUp": "CursorStart",
92 "CtrlDown": "CursorEnd",
93 "CtrlShiftUp": "SelectToStart",
94 "CtrlShiftDown": "SelectToEnd",
95 "Enter": "InsertEnter",
96 "Space": "InsertSpace",
97 "Backspace": "Backspace",
98 "Backspace2": "Backspace",
104 "CtrlP": "FindPrevious",
110 "CtrlD": "DuplicateLine",
112 "CtrlA": "SelectAll",
117 "CtrlU": "HalfPageUp",
118 "CtrlD": "HalfPageDown",
119 "CtrlR": "ToggleRuler",
126 ### Possible commands
128 You can execute an editor command by pressing `Ctrl-e` followed by the command.
129 Here are the possible commands that you can use.
131 * `quit`: Quits micro.
132 * `save`: Saves the current buffer.
134 * `replace "search" "value" flags`: This will replace `search` with `value`.
135 The `flags` are optional.
136 At this point, there is only one flag: `c`, which enables `check` mode
137 which asks if you'd like to perform the replacement each time
139 Note that `search` must be a valid regex. If one of the arguments
140 does not have any spaces in it, you may omit the quotes.
142 * `set option value`: sets the option to value. Please see the next section for
143 a list of options you can set.
145 * `run sh-command`: runs the given shell command in the background. The
146 command's output will be displayed in one line when it finishes running.
150 Micro stores all of the user configuration in its configuration directory.
152 Micro uses the `$XDG_CONFIG_HOME/micro` as the configuration directory. As per
153 the XDG spec, if `$XDG_CONFIG_HOME` is not set, `~/.config/micro` is used as
154 the config directory.
156 Here are the options that you can set:
158 * `colorscheme`: loads the colorscheme stored in
159 $(configDir)/colorschemes/`option`.micro
161 default value: `default`
162 Note that the default colorschemes (default, solarized, and solarized-tc)
163 are not located in configDir, because they are embedded in the micro binary
165 The colorscheme can be selected from all the files in the
166 ~/.config/micro/colorschemes/ directory. Micro comes by default with three
169 * default: this is the default colorscheme.
170 * solarized: this is the solarized colorscheme (used in the screenshot).
171 You should have the solarized color palette in your terminal to use it.
172 * solarized-tc: this is the solarized colorscheme for true color, just
173 make sure your terminal supports true color before using it and that the
174 MICRO_TRUECOLOR environment variable is set to 1 before starting micro.
177 * `tabsize`: sets the tab size to `option`
181 * `indentchar`: sets the indentation character
185 * `syntax`: turns syntax on or off
189 * `tabsToSpaces`: use spaces instead of tabs
193 * `autoindent`: when creating a new line use the same indentation as the
198 * `ruler`: display line numbers
202 * `statusline`: display the status line at the bottom of the screen
206 * `scrollSpeed`: amount of lines to scroll
212 Default plugin options:
214 * `linter`: lint languages on save (supported languages are C, D, Go, Java,
215 Javascript, Lua). Provided by the `linter` plugin.
219 * `goimports`: Run goimports on save. Provided by the `go` plugin.
223 * `gofmt`: Run gofmt on save. Provided by the `go` plugin.
227 Any option you set in the editor will be saved to the file
228 ~/.config/micro/settings.json so, in effect, your configuration file will be
229 created for you. If you'd like to take your configuration with you to another
230 machine, simply copy the settings.json to the other machine.