]> git.lizzy.rs Git - micro.git/blob - runtime/help/options.md
some additions to the plugin API
[micro.git] / runtime / help / options.md
1 ### Options
2
3 Micro stores all of the user configuration in its configuration directory.
4
5 Micro uses the `$XDG_CONFIG_HOME/micro` as the configuration directory. As per
6 the XDG spec, if `$XDG_CONFIG_HOME` is not set, `~/.config/micro` is used as 
7 the config directory.
8
9 Here are the options that you can set:
10
11 * `colorscheme`: loads the colorscheme stored in 
12    $(configDir)/colorschemes/`option`.micro
13    This setting is `global only`.
14
15         default value: `default`
16         Note that the default colorschemes (default, solarized, and solarized-tc)
17         are not located in configDir, because they are embedded in the micro binary.
18
19         The colorscheme can be selected from all the files in the 
20         ~/.config/micro/colorschemes/ directory. Micro comes by default with three
21         colorschemes:
22
23     You can read more about micro's colorschemes in the `colors` help topic
24     (`help colors`).
25
26 * `colorcolumn`: if this is not set to 0, it will display a column at the specified
27    column. This is useful if you want column 80 to be highlighted special for example.
28
29         default value: `0`
30
31 * `tabsize`: sets the tab size to `option`
32
33         default value: `4`
34
35 * `indentchar`: sets the indentation character
36
37         default value: ` `
38
39 * `infobar`: enables the line at the bottom of the editor where messages are printed.
40    This option is `global only`.
41
42         default value: `on`
43
44 * `filetype`: sets the filetype for the current buffer. This setting is `local only`
45
46     default value: this will be automatically set depending on the file you have open
47
48 * `ignorecase`: perform case-insensitive searches
49
50         default value: `off`
51
52 * `syntax`: turns syntax on or off
53
54         default value: `on`
55
56 * `tabstospaces`: use spaces instead of tabs
57
58         default value: `off`
59
60 * `autoindent`: when creating a new line use the same indentation as the 
61    previous line
62
63         default value: `on`
64
65 * `cursorline`: highlight the line that the cursor is on in a different color
66    (the color is defined by the colorscheme you are using)
67
68         default value: `on`
69
70 * `ruler`: display line numbers
71
72         default value: `on`
73
74 * `statusline`: display the status line at the bottom of the screen
75
76         default value: `on`
77
78 * `savecursor`: remember where the cursor was last time the file was opened and
79    put it there when you open the file again
80
81         default value: `off`
82
83 * `saveundo`: when this option is on, undo is saved even after you close a file
84    so if you close and reopen a file, you can keep undoing
85
86         default value: `off`
87
88 * `scrollmargin`: amount of lines you would like to see above and below the cursor
89
90         default value: `3`
91
92 * `scrollspeed`: amount of lines to scroll for one scroll event
93
94         default value: `2`
95
96 ---
97
98 Default plugin options:
99
100 * `linter`: lint languages on save (supported languages are C, D, Go, Java,
101    Javascript, Lua). Provided by the `linter` plugin.
102
103         default value: `on`
104
105 * `autoclose`: Automatically close `{}` `()` `[]` `""` `''`. Provided by the `autoclose` plugin
106
107         default value: `on`
108
109 * `goimports`: Run goimports on save. Provided by the `go` plugin.
110
111         default value: `off`
112
113 * `gofmt`: Run gofmt on save. Provided by the `go` plugin.
114
115         default value: `on`
116
117 Any option you set in the editor will be saved to the file 
118 ~/.config/micro/settings.json so, in effect, your configuration file will be 
119 created for you. If you'd like to take your configuration with you to another
120 machine, simply copy the settings.json to the other machine.
121
122 # Global and local settings
123
124 You can set these settings either globally or locally. Locally means that the setting
125 won't be saved to `~/.config/micro/settings.json` and that it will only be set in
126 the current buffer. Setting an option globally is the default, and will set the option
127 in all buffers.
128
129 The `colorscheme` option is global only, and the `filetype` option is local only. To
130 set an option locally, use `setlocal` instead of `set`.
131
132 In the `settings.json` file you can also put set options locally by specifying a glob.
133 Here is an example which has `tabstospaces` on for all files except Go files, and
134 `tabsize` 4 for all files except Ruby files:
135
136 ```json
137 {
138     "*.go": {
139         "tabstospaces": false
140     },
141     "*.rb": {
142         "tabsize": 2
143     },
144     "tabstospaces": true,
145     "tabsize": 4
146 }
147 ```
148
149 As you can see it is quite easy to set options locally using the `settings.json` file.