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 Here are the default keybindings in json form which is also how
22 you can rebind them to your liking.
28 "Right": "CursorRight",
30 "ShiftUp": "SelectUp",
31 "ShiftDown": "SelectDown",
32 "ShiftLeft": "SelectLeft",
33 "ShiftRight": "SelectRight",
34 "AltLeft": "WordLeft",
35 "AltRight": "WordRight",
36 "AltShiftRight": "SelectWordRight",
37 "AltShiftLeft": "SelectWordLeft",
38 "CtrlLeft": "StartOfLine",
39 "CtrlRight": "EndOfLine",
40 "CtrlShiftLeft": "SelectToStartOfLine",
41 "CtrlShiftRight": "SelectToEndOfLine",
42 "CtrlUp": "CursorStart",
43 "CtrlDown": "CursorEnd",
44 "CtrlShiftUp": "SelectToStart",
45 "CtrlShiftDown": "SelectToEnd",
46 "Enter": "InsertEnter",
47 "Space": "InsertSpace",
48 "Backspace": "Backspace",
49 "Backspace2": "Backspace",
50 "Alt-Backspace": "DeleteWordLeft",
51 "Alt-Backspace2": "DeleteWordLeft",
57 "CtrlP": "FindPrevious",
63 "CtrlD": "DuplicateLine",
68 "PageUp": "CursorPageUp",
69 "PageDown": "CursorPageDown",
70 "CtrlG": "ToggleHelp",
71 "CtrlR": "ToggleRuler",
77 "CtrlE": "CommandMode",
79 // Emacs-style keybindings
82 "Alt-a": "StartOfLine",
89 You can use the alt keys + arrows to move word by word.
90 Ctrl left and right move the cursor to the start and end of the line, and
91 ctrl up and down move the cursor the start and end of the buffer.
93 You can hold shift with all of these movement actions to select while moving.
95 The bindings may be rebound using the `~/.config/micro/bindings.json`
96 file. Each key is bound to an action.
98 For example, to bind `Ctrl-y` to undo and `Ctrl-z` to redo, you could put the
99 following in the `bindings.json` file.
108 ### Possible commands
110 You can execute an editor command by pressing `Ctrl-e` followed by the command.
111 Here are the possible commands that you can use.
113 * `quit`: Quits micro.
114 * `save`: Saves the current buffer.
116 * `replace "search" "value" flags`: This will replace `search` with `value`.
117 The `flags` are optional.
118 At this point, there is only one flag: `c`, which enables `check` mode
119 which asks if you'd like to perform the replacement each time
121 Note that `search` must be a valid regex. If one of the arguments
122 does not have any spaces in it, you may omit the quotes.
124 * `set option value`: sets the option to value. Please see the next section for
125 a list of options you can set.
127 * `run sh-command`: runs the given shell command in the background. The
128 command's output will be displayed in one line when it finishes running.
130 * `bind key action`: creates a keybinding from key to action. See the sections on
131 keybindings above for more info about what keys and actions are available.
135 Micro stores all of the user configuration in its configuration directory.
137 Micro uses the `$XDG_CONFIG_HOME/micro` as the configuration directory. As per
138 the XDG spec, if `$XDG_CONFIG_HOME` is not set, `~/.config/micro` is used as
139 the config directory.
141 Here are the options that you can set:
143 * `colorscheme`: loads the colorscheme stored in
144 $(configDir)/colorschemes/`option`.micro
146 default value: `default`
147 Note that the default colorschemes (default, solarized, and solarized-tc)
148 are not located in configDir, because they are embedded in the micro binary
150 The colorscheme can be selected from all the files in the
151 ~/.config/micro/colorschemes/ directory. Micro comes by default with three
154 * default: this is the default colorscheme.
155 * solarized: this is the solarized colorscheme (used in the screenshot).
156 You should have the solarized color palette in your terminal to use it.
157 * solarized-tc: this is the solarized colorscheme for true color, just
158 make sure your terminal supports true color before using it and that the
159 MICRO_TRUECOLOR environment variable is set to 1 before starting micro.
162 * `tabsize`: sets the tab size to `option`
166 * `indentchar`: sets the indentation character
170 * `ignorecase`: perform case-insensitive searches
174 * `syntax`: turns syntax on or off
178 * `tabstospaces`: use spaces instead of tabs
182 * `autoindent`: when creating a new line use the same indentation as the
187 * `cursorline`: highlight the line that the cursor is on in a different color
188 (the color is defined by the colorscheme you are using)
192 * `ruler`: display line numbers
196 * `statusline`: display the status line at the bottom of the screen
200 * `savecursor`: remember where the cursor was last time the file was opened and
201 put it there when you open the file again
205 * `saveundo`: when this option is on, undo is saved even after you close a file
206 so if you close and reopen a file, you can keep undoing
210 * `scrollmargin`: amount of lines you would like to see above and below the cursor
214 * `scrollspeed`: amount of lines to scroll for one scroll event
220 Default plugin options:
222 * `linter`: lint languages on save (supported languages are C, D, Go, Java,
223 Javascript, Lua). Provided by the `linter` plugin.
227 * `goimports`: Run goimports on save. Provided by the `go` plugin.
231 * `gofmt`: Run gofmt on save. Provided by the `go` plugin.
235 Any option you set in the editor will be saved to the file
236 ~/.config/micro/settings.json so, in effect, your configuration file will be
237 created for you. If you'd like to take your configuration with you to another
238 machine, simply copy the settings.json to the other machine.