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.
26 * Ctrl-e: Execute a command
27 * Ctrl-g: Toggle help text
28 * Ctrl-b: Run a shell command
38 * Ctrl-p: Find previous
44 * Ctrl-u: Half page up
45 * Ctrl-d: Half page down
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.
73 You can execute an editor command by pressing `Ctrl-e` followed by the command.
74 Here are the possible commands that you can use.
76 * `quit`: Quits micro.
77 * `save`: Saves the current buffer.
79 * `replace "search" "value" flags`: This will replace `search` with `value`.
80 The `flags` are optional.
81 At this point, there is only one flag: `c`, which enables `check` mode
82 which asks if you'd like to perform the replacement each time
84 Note that `search` must be a valid regex. If one of the arguments
85 does not have any spaces in it, you may omit the quotes.
87 * `set option value`: sets the option to value. Please see the next section for
88 a list of options you can set.
90 * `run sh-command`: runs the given shell command in the background. The
91 command's output will be displayed in one line when it finishes running.
95 Micro stores all of the user configuration in its configuration directory.
97 Micro uses the `$XDG_CONFIG_HOME/micro` as the configuration directory. As per
98 the XDG spec, if `$XDG_CONFIG_HOME` is not set, `~/.config/micro` is used as
101 Here are the options that you can set:
103 * `colorscheme`: loads the colorscheme stored in
104 $(configDir)/colorschemes/`option`.micro
106 default value: `default`
107 Note that the default colorschemes (default, solarized, and solarized-tc)
108 are not located in configDir, because they are embedded in the micro binary
110 The colorscheme can be selected from all the files in the
111 ~/.config/micro/colorschemes/ directory. Micro comes by default with three
114 * default: this is the default colorscheme.
115 * solarized: this is the solarized colorscheme (used in the screenshot).
116 You should have the solarized color palette in your terminal to use it.
117 * solarized-tc: this is the solarized colorscheme for true color, just
118 make sure your terminal supports true color before using it and that the
119 MICRO_TRUECOLOR environment variable is set to 1 before starting micro.
122 * `tabsize`: sets the tab size to `option`
126 * `syntax`: turns syntax on or off
130 * `tabsToSpaces`: use spaces instead of tabs
134 * `autoindent`: when creating a new line use the same indentation as the
139 * `ruler`: display line numbers
143 * `gofmt`: Run `gofmt` whenever the file is saved (this only applies to `.go`
148 * `goimports`: run `goimports` whenever the file is saved (this only applies
153 Any option you set in the editor will be saved to the file
154 ~/.config/micro/settings.json so, in effect, your configuration file will be
155 created for you. If you'd like to take your configuration with you to another
156 machine, simply copy the settings.json to the other machine.
158 In the future, the `gofmt` and `goimports` will be refactored using a plugin
159 system. However, currently they make it easier to program micro in micro.