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.
25 * Ctrl-e: Execute a command
26 * Ctrl-g: Toggle help text
27 * Ctrl-b: Run a shell command
34 * Ctrl-p: Find previous
39 * Ctrl-d: Duplicate line
43 * Home: Go to beginning of line
44 * End: Go to end of line
45 * Ctrl-r: Toggle line numbers
47 You can use the alt keys + arrows to move word by word.
48 Ctrl left and right move the cursor to the start and end of the line, and
49 ctrl up and down move the cursor the start and end of the buffer.
51 You can hold shift with all of these movement actions to select while moving.
53 The bindings may be rebound using the `~/.config/micro/bindings.json`
54 file. Each key is bound to an action.
56 For example, to bind `Ctrl-y` to undo and `Ctrl-z` to redo, you could put the
57 following in the `bindings.json` file.
66 Here are the defaults:
72 "Right": "CursorRight",
74 "ShiftUp": "SelectUp",
75 "ShiftDown": "SelectDown",
76 "ShiftLeft": "SelectLeft",
77 "ShiftRight": "SelectRight",
78 "AltLeft": "WordLeft",
79 "AltRight": "WordRight",
80 "AltShiftRight": "SelectWordRight",
81 "AltShiftLeft": "SelectWordLeft",
82 "CtrlLeft": "StartOfLine",
83 "CtrlRight": "EndOfLine",
84 "CtrlShiftLeft": "SelectToStartOfLine",
85 "CtrlShiftRight": "SelectToEndOfLine",
86 "CtrlUp": "CursorStart",
87 "CtrlDown": "CursorEnd",
88 "CtrlShiftUp": "SelectToStart",
89 "CtrlShiftDown": "SelectToEnd",
90 "Enter": "InsertEnter",
91 "Space": "InsertSpace",
92 "Backspace": "Backspace",
93 "Backspace2": "Backspace",
99 "CtrlP": "FindPrevious",
105 "CtrlD": "DuplicateLine",
107 "CtrlA": "SelectAll",
112 "CtrlG": "ToggleHelp",
113 "CtrlR": "ToggleRuler",
116 "Esc": "ClearStatus",
117 "CtrlB": "ShellMode",
119 "CtrlE": "CommandMode",
121 // Emacs-style keybindings
122 "Alt-f": "WordRight",
124 "Alt-a": "StartOfLine",
125 "Alt-e": "EndOfLine",
127 "Alt-n": "CursorDown",
133 ### Possible commands
135 You can execute an editor command by pressing `Ctrl-e` followed by the command.
136 Here are the possible commands that you can use.
138 * `quit`: Quits micro.
139 * `save`: Saves the current buffer.
141 * `replace "search" "value" flags`: This will replace `search` with `value`.
142 The `flags` are optional.
143 At this point, there is only one flag: `c`, which enables `check` mode
144 which asks if you'd like to perform the replacement each time
146 Note that `search` must be a valid regex. If one of the arguments
147 does not have any spaces in it, you may omit the quotes.
149 * `set option value`: sets the option to value. Please see the next section for
150 a list of options you can set.
152 * `run sh-command`: runs the given shell command in the background. The
153 command's output will be displayed in one line when it finishes running.
157 Micro stores all of the user configuration in its configuration directory.
159 Micro uses the `$XDG_CONFIG_HOME/micro` as the configuration directory. As per
160 the XDG spec, if `$XDG_CONFIG_HOME` is not set, `~/.config/micro` is used as
161 the config directory.
163 Here are the options that you can set:
165 * `colorscheme`: loads the colorscheme stored in
166 $(configDir)/colorschemes/`option`.micro
168 default value: `default`
169 Note that the default colorschemes (default, solarized, and solarized-tc)
170 are not located in configDir, because they are embedded in the micro binary
172 The colorscheme can be selected from all the files in the
173 ~/.config/micro/colorschemes/ directory. Micro comes by default with three
176 * default: this is the default colorscheme.
177 * solarized: this is the solarized colorscheme (used in the screenshot).
178 You should have the solarized color palette in your terminal to use it.
179 * solarized-tc: this is the solarized colorscheme for true color, just
180 make sure your terminal supports true color before using it and that the
181 MICRO_TRUECOLOR environment variable is set to 1 before starting micro.
184 * `tabsize`: sets the tab size to `option`
188 * `indentchar`: sets the indentation character
192 * `ignorecase`: perform case-insensitive searches
196 * `syntax`: turns syntax on or off
200 * `tabstospaces`: use spaces instead of tabs
204 * `autoindent`: when creating a new line use the same indentation as the
209 * `ruler`: display line numbers
213 * `statusline`: display the status line at the bottom of the screen
217 * `savecursor`: remember where the cursor was last time the file was opened and
218 put it there when you open the file again
222 * `scrollmargin`: amount of lines you would like to see above and below the cursor
226 * `scrollspeed`: amount of lines to scroll for one scroll event
232 Default plugin options:
234 * `linter`: lint languages on save (supported languages are C, D, Go, Java,
235 Javascript, Lua). Provided by the `linter` plugin.
239 * `goimports`: Run goimports on save. Provided by the `go` plugin.
243 * `gofmt`: Run gofmt on save. Provided by the `go` plugin.
247 Any option you set in the editor will be saved to the file
248 ~/.config/micro/settings.json so, in effect, your configuration file will be
249 created for you. If you'd like to take your configuration with you to another
250 machine, simply copy the settings.json to the other machine.