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 `micro path/to/file.txt` or simply `micro` to open an empty buffer.
10 Micro also supports creating buffers from stdin:
16 You can move the cursor around with the arrow keys and mouse.
20 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
37 * Ctrl-p: Find previous
43 * Ctrl-u: Half page up
44 * Ctrl-d: Half page down
47 * Home: Go to beginning of file
48 * End: Go to end of file
49 * Ctrl-r: Toggle line numbers
51 The buffer bindings may be rebound using the `~/.config/micro/bindings.json` file. Each key is bound to an action.
53 For example, to bind `Ctrl-y` to undo and `Ctrl-z` to redo, you could put the following in the `bindings.json` file.
64 You can execute an editor command by pressing `Ctrl-e` followed by the command.
65 Here are the possible commands that you can use.
67 * `quit`: Quits micro.
68 * `save`: Saves the current buffer.
70 * `replace "search" "value" flags`: This will replace `search` with `value`. The `flags` are optional.
71 At this point, there is only one flag: `c`, which enables `check` mode which asks if you'd like
72 to perform the replacement each time
74 Note that `search` must be a valid regex. If one of the arguments
75 does not have any spaces in it, you may omit the quotes.
77 * `set option value`: sets the option to value. Please see the next section for a list of options you can set.
79 * `run sh-command`: runs the given shell command in the background. The command's output will be displayed
80 in one line when it finishes running.
84 Micro stores all of the user configuration in its configuration directory.
86 Micro uses the `$XDG_CONFIG_HOME/micro` as the configuration directory. As per the XDG spec,
87 if `$XDG_CONFIG_HOME` is not set, `~/.config/micro` is used as the config directory.
89 Here are the options that you can set:
91 * `colorscheme`: loads the colorscheme stored in $(configDir)/colorschemes/`option`.micro
93 default value: `default`
94 Note that the default colorschemes (default, solarized, and solarized-tc) are not located in configDir,
95 because they are embedded in the micro binary
97 The colorscheme can be selected from all the files in the ~/.config/micro/colorschemes/ directory. Micro comes by default with three colorschemes:
99 * default: this is the default colorscheme.
100 * solarized: this is the solarized colorscheme (used in the screenshot). You should have the
101 solarized color palette in your terminal to use it.
102 * solarized-tc: this is the solarized colorscheme for true color, just make sure
103 your terminal supports true color before using it and that the MICRO_TRUECOLOR environment
104 variable is set to 1 before starting micro.
107 * `tabsize`: sets the tab size to `option`
111 * `syntax`: turns syntax on or off
115 * `tabsToSpaces`: use spaces instead of tabs
119 * `autoindent`: when creating a new line use the same indentation as the previous line
123 * `ruler`: display line numbers
127 * `gofmt`: Run `gofmt` whenever the file is saved (this only applies to `.go` files)
131 * `goimports`: run `goimports` whenever the file is saved (this only applies to `.go` files)
135 Any option you set in the editor will be saved to the file ~/.config/micro/settings.json so,
136 in effect, your configuration file will be created for you. If you'd like to take your configuration
137 with you to another machine, simply copy the settings.json to the other machine.
139 In the future, the `gofmt` and `goimports` will be refactored using a plugin system. However,
140 currently they just make it easier to program micro in micro.