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 line
48 * End: Go to end of line
49 * Ctrl-r: Toggle line numbers
51 You can use the alt keys + arrows to move word by word.
52 Ctrl left and right move the cursor to the start and end of the line, and
53 ctrl up and down move the cursor the start and end of the buffer.
55 You can hold shift with all of these movement actions to select while moving.
57 The buffer bindings may be rebound using the `~/.config/micro/bindings.json` file. Each key is bound to an action.
59 For example, to bind `Ctrl-y` to undo and `Ctrl-z` to redo, you could put the following in the `bindings.json` file.
70 You can execute an editor command by pressing `Ctrl-e` followed by the command.
71 Here are the possible commands that you can use.
73 * `quit`: Quits micro.
74 * `save`: Saves the current buffer.
76 * `replace "search" "value" flags`: This will replace `search` with `value`. The `flags` are optional.
77 At this point, there is only one flag: `c`, which enables `check` mode which asks if you'd like
78 to perform the replacement each time
80 Note that `search` must be a valid regex. If one of the arguments
81 does not have any spaces in it, you may omit the quotes.
83 * `set option value`: sets the option to value. Please see the next section for a list of options you can set.
85 * `run sh-command`: runs the given shell command in the background. The command's output will be displayed
86 in one line when it finishes running.
90 Micro stores all of the user configuration in its configuration directory.
92 Micro uses the `$XDG_CONFIG_HOME/micro` as the configuration directory. As per the XDG spec,
93 if `$XDG_CONFIG_HOME` is not set, `~/.config/micro` is used as the config directory.
95 Here are the options that you can set:
97 * `colorscheme`: loads the colorscheme stored in $(configDir)/colorschemes/`option`.micro
99 default value: `default`
100 Note that the default colorschemes (default, solarized, and solarized-tc) are not located in configDir,
101 because they are embedded in the micro binary
103 The colorscheme can be selected from all the files in the ~/.config/micro/colorschemes/ directory. Micro comes by default with three colorschemes:
105 * default: this is the default colorscheme.
106 * solarized: this is the solarized colorscheme (used in the screenshot). You should have the
107 solarized color palette in your terminal to use it.
108 * solarized-tc: this is the solarized colorscheme for true color, just make sure
109 your terminal supports true color before using it and that the MICRO_TRUECOLOR environment
110 variable is set to 1 before starting micro.
113 * `tabsize`: sets the tab size to `option`
117 * `syntax`: turns syntax on or off
121 * `tabsToSpaces`: use spaces instead of tabs
125 * `autoindent`: when creating a new line use the same indentation as the previous line
129 * `ruler`: display line numbers
133 * `gofmt`: Run `gofmt` whenever the file is saved (this only applies to `.go` files)
137 * `goimports`: run `goimports` whenever the file is saved (this only applies to `.go` files)
141 Any option you set in the editor will be saved to the file ~/.config/micro/settings.json so,
142 in effect, your configuration file will be created for you. If you'd like to take your configuration
143 with you to another machine, simply copy the settings.json to the other machine.
145 In the future, the `gofmt` and `goimports` will be refactored using a plugin system. However,
146 currently they just make it easier to program micro in micro.