help: Exchange all indentations to spaces, remove trailing ws and generalize indentations (#3193)

* help: Exchange all indentations to spaces and remove trailing ws

* Add some missing `` marks

Co-authored-by: Jöran Karl <3951388+JoeKar@users.noreply.github.com>

* help: Generalize indentation levels

* help: Some small visual changes

- removed some superfluous whitespaces
- add a line break in before an link
- corrected one typo

---------

Co-authored-by: Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com>
This commit is contained in:
Jöran Karl 2024-03-22 17:58:44 +01:00 committed by GitHub
parent 426e6c600f
commit bb1f4dad77
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 180 additions and 179 deletions

View File

@ -8,7 +8,7 @@ This help page aims to cover two aspects of micro's syntax highlighting engine:
## Colorschemes
To change your colorscheme, press Ctrl-e in micro to bring up the command
To change your colorscheme, press `Ctrl-e` in micro to bring up the command
prompt, and type:
```
@ -93,7 +93,7 @@ and set this variable yourself.
* `solarized-tc`: this is the solarized colorscheme for true color.
* `atom-dark`: this colorscheme is based off of Atom's "dark" colorscheme.
* `cmc-tc`: A true colour variant of the cmc theme. It requires true color to
look its best. Use cmc-16 if your terminal doesn't support true color.
look its best. Use cmc-16 if your terminal doesn't support true color.
* `gruvbox-tc`: The true color version of the gruvbox colorscheme
* `material-tc`: Colorscheme based off of Google's Material Design palette
@ -106,7 +106,7 @@ be found
Custom colorschemes should be placed in the `~/.config/micro/colorschemes`
directory.
A number of custom directives are placed in a `.micro` file. Colorschemes are
A number of custom directives are placed in a `.micro` file. Colorschemes are
typically only 18-30 lines in total.
To create the colorscheme you need to link highlight groups with
@ -152,7 +152,7 @@ Then you can use the terminals 256 colors by using their numbers 1-256 (numbers
If the user's terminal supports true color, then you can also specify colors
exactly using their hex codes. If the terminal is not true color but micro is
told to use a true color colorscheme it will attempt to map the colors to the
told to use a true color colorscheme it will attempt to map the colors to the
available 256 colors.
Generally colorschemes which require true color terminals to look good are
@ -213,7 +213,7 @@ that for highlighting strings. If it's not found, it will use constant instead.
Micro tries to match the largest set of groups it can find in the colorscheme
definitions, so if, for examle `constant.bool.true` is found then micro will
use that. If `constant.bool.true` is not found but `constant.bool` is found
micro will use `constant.bool`. If not, it uses `constant`.
micro will use `constant.bool`. If not, it uses `constant`.
Here's a list of subgroups used in micro's built-in syntax files.
@ -221,10 +221,10 @@ Here's a list of subgroups used in micro's built-in syntax files.
* constant.bool
* constant.bool.true
* constant.bool.false
* constant.number
* constant.number
* constant.specialChar
* constant.string
* constant.string.url
* constant.string.url
* identifier.class (Also used for functions)
* identifier.macro
* identifier.var
@ -248,7 +248,7 @@ languages.
Micro's builtin syntax highlighting tries very hard to be sane, sensible and
provide ample coverage of the meaningful elements of a language. Micro has
syntax files built in for over 100 languages now! However, there may be
syntax files built in for over 100 languages now! However, there may be
situations where you find Micro's highlighting to be insufficient or not to
your liking. The good news is that you can create your own syntax files, and
place them in `~/.config/micro/syntax` and Micro will use those instead.

View File

@ -1,6 +1,6 @@
# Command bar
The command bar is opened by pressing Ctrl-e. It is a single-line buffer,
The command bar is opened by pressing `Ctrl-e`. It is a single-line buffer,
meaning that all keybindings from a normal buffer are supported (as well
as mouse and selection).
@ -35,12 +35,12 @@ quotes here but these are not necessary when entering the command in micro.
passed to jump inward from the end of the file; for example, -5 jumps
to the 5th-last line in the file.
* `replace 'search' 'value' ['flags']`: This will replace `search` with `value`.
* `replace 'search' 'value' ['flags']`: This will replace `search` with `value`.
The `flags` are optional. Possible flags are:
* `-a`: Replace all occurrences at once
* `-l`: Do a literal search instead of a regex search
Note that `search` must be a valid regex (unless `-l` is passed). If one
Note that `search` must be a valid regex (unless `-l` is passed). If one
of the arguments does not have any spaces in it, you may omit the quotes.
In case the search is done non-literal (without `-l`), the 'value'
@ -52,7 +52,7 @@ quotes here but these are not necessary when entering the command in micro.
* `replaceall 'search' 'value'`: this will replace all occurrences of `search`
with `value` without user confirmation.
See `replace` command for more information.
See `replace` command for more information.
* `set 'option' 'value'`: sets the option to value. See the `options` help
topic for a list of options you can set. This will modify your
@ -63,7 +63,7 @@ quotes here but these are not necessary when entering the command in micro.
* `show 'option'`: shows the current value of the given option.
* `run 'sh-command'`: runs the given shell command in the background. The
* `run 'sh-command'`: runs the given shell command in the background. The
command's output will be displayed in one line when it finishes running.
* `vsplit ['filename']`: opens a vertical split with `filename`. If no filename

View File

@ -12,13 +12,13 @@ is limited support among terminal emulators for the terminal clipboard
(which uses the OSC 52 protocol to communicate clipboard contents).
Here is a list of terminal emulators and their status:
* Kitty: supported, but only writing is enabled by default. To enable
reading, add `read-primary` and `read-clipboard` to the
`clipboard_control` option.
* `Kitty`: supported, but only writing is enabled by default. To enable
reading, add `read-primary` and `read-clipboard` to the
`clipboard_control` option.
* iTerm2: only copying (writing to clipboard) is supported. Must be enabled in
`Preferences->General-> Selection->Applications in terminal may access clipboard`.
You can use Command-v to paste.
* `iTerm2`: only copying (writing to clipboard) is supported. Must be enabled in
`Preferences->General-> Selection->Applications in terminal may access clipboard`.
You can use `Command-v` to paste.
* `st`: supported.
@ -32,7 +32,7 @@ Here is a list of terminal emulators and their status:
* `gnome-terminal`: does not support OSC 52.
* `alacritty`: supported. Since 0.13.0, reading has been disabled by default.
To reenable it, set the `terminal.osc52` option to `CopyPaste`.
To reenable it, set the `terminal.osc52` option to `CopyPaste`.
* `foot`: supported.
@ -49,12 +49,12 @@ supports OSC 52.
The recommended method of pasting is the following:
* If you are not working over SSH, use the micro keybinding (Ctrl-v
* If you are not working over SSH, use the micro keybinding (`Ctrl-v`
by default) to perform pastes. If on Linux, install `xclip` or
`xsel` beforehand.
* If you are working over SSH, use the terminal keybinding
(Ctrl-Shift-v or Command-v) to perform pastes. If your terminal
(`Ctrl-Shift-v` or `Command-v`) to perform pastes. If your terminal
does not support bracketed paste, when performing a paste first
enable the `paste` option, and when finished disable the option.
@ -63,8 +63,8 @@ The recommended method of pasting is the following:
Micro is an application that runs within the terminal. This means
that the terminal sends micro events, such as key events, mouse
events, resize events, and paste events. Micro's default keybinding
for paste is Ctrl-v. This means that when micro receives the key
event saying Ctrl-v has been pressed from the terminal, it will
for paste is `Ctrl-v`. This means that when micro receives the key
event saying `Ctrl-v` has been pressed from the terminal, it will
attempt to access the system clipboard and effect a paste. The
system clipboard will be accessed through `pbpaste` on MacOS
(installed by default), `xclip` or `xsel` on Linux (these
@ -77,8 +77,8 @@ For certain keypresses, the terminal will not send an event to
micro and will instead do something itself. In this document,
such keypresses will be called "terminal keybindings." Often
there will be a terminal keybinding for pasting and copying. On
MacOS these are Command-v and Command-c and on Linux Ctrl-Shift-v
and Ctrl-Shift-c. When the terminal keybinding for paste is
MacOS these are Command-v and Command-c and on Linux `Ctrl-Shift-v`
and `Ctrl-Shift-c`. When the terminal keybinding for paste is
executed, your terminal will access the system clipboard, and send
micro either a paste event or a list of key events (one key for each
character in the paste), depending on whether or not your terminal
@ -90,7 +90,7 @@ sends a list of key events, this can cause issues because micro
will think you manually entered each character and may add closing
brackets or automatic indentation, which will mess up the pasted
text. To avoid this, you can temporarily enable the `paste` option
while you perform the paste. When paste option is on, micro will
while you perform the paste. When paste option is on, micro will
aggregate lists of multiple key events into larger paste events.
It is a good idea to disable the `paste` option during normal use
as occasionally if you are typing quickly, the terminal will send
@ -101,7 +101,7 @@ entered.
When working over SSH, micro is running on the remote machine and
your terminal is running on your local machine. Therefore if you
would like to paste, using Ctrl-v (micro's keybinding) will not
would like to paste, using `Ctrl-v` (micro's keybinding) will not
work because when micro attempts to access the system clipboard,
it will access the remote machine's clipboard rather than the local
machine's clipboard. On the other hand, the terminal keybinding
@ -114,12 +114,12 @@ the network as a paste event, which is what you want.
The recommended method of copying is the following:
* If you are not working over SSH, use the micro keybinding (Ctrl-c by
* If you are not working over SSH, use the micro keybinding (`Ctrl-c` by
default) to perform copies. If on Linux, install `xclip` or `xsel`
beforehand.
* If you are working over SSH, use the terminal keybinding
(Ctrl-Shift-c or Command-c) to perform copies. You must first disable
(`Ctrl-Shift-c` or `Command-c`) to perform copies. You must first disable
the `mouse` option to perform a terminal selection, and you may wish
to disable line numbers and diff indicators (`ruler` and `diffgutter`
options) and close other splits. This method will only be able to copy
@ -130,14 +130,14 @@ Copying follows a similar discussion to the one above about pasting.
The primary difference is before performing a copy, the application
doing the copy must be told what text needs to be copied.
Micro has a keybinding (Ctrl-c) for copying and will access the system
Micro has a keybinding (`Ctrl-c`) for copying and will access the system
clipboard to perform the copy. The text that micro will copy into is
the text that is currently selected in micro (usually such text is
displayed with a white background). When the `mouse` option is enabled,
the mouse can be used to select text, as well as other keybindings,
such as ShiftLeft, etc...
The terminal also has a keybinding (Ctrl-Shift-c or Command-c) to perform
The terminal also has a keybinding (`Ctrl-Shift-c` or `Command-c`) to perform
a copy, and the text that it copies is the text selected by the terminal's
selection (*not* micro's selection). To select text with the terminal
selection, micro's mouse support must first be disabled by turning the

View File

@ -52,9 +52,9 @@ can change it!
| Ctrl-n | Find next instance of current search |
| Ctrl-p | Find previous instance of current search |
Note: Ctrl-n and Ctrl-p should be used from the main buffer, not from inside
the search prompt. After Ctrl-f, press enter to complete the search and then
you can use Ctrl-n and Ctrl-p to cycle through matches.
Note: `Ctrl-n` and `Ctrl-p` should be used from the main buffer, not from inside
the search prompt. After `Ctrl-f`, press enter to complete the search and then
you can use `Ctrl-n` and `Ctrl-p` to cycle through matches.
### File Operations
@ -129,7 +129,7 @@ you can use Ctrl-n and Ctrl-p to cycle through matches.
### Function keys.
Warning! The function keys may not work in all terminals!
Warning! The function keys may not work in all terminals!
| Key | Description of function |
|------ |-------------------------- |

View File

@ -4,9 +4,9 @@ Micro is an easy to use, intuitive, text editor that takes advantage of the
full capabilities of modern terminals.
Micro can be controlled by commands entered on the command bar, or with
keybindings. To open the command bar, press Ctrl-e: the `>` prompt will
keybindings. To open the command bar, press `Ctrl-e`: the `>` prompt will
display. From now on, when the documentation shows a command to run (such as
`> help`), press Ctrl-e and type the command followed by enter.
`> help`), press `Ctrl-e` and type the command followed by enter.
For a list of the default keybindings, run `> help defaultkeys`.
For more information on keybindings, see `> help keybindings`.
@ -14,7 +14,7 @@ To toggle a short list of important keybindings, press Alt-g.
## Quick-start
To quit, press Ctrl-q. Save by pressing Ctrl-s. Press Ctrl-e, as previously
To quit, press `Ctrl-q`. Save by pressing `Ctrl-s`. Press `Ctrl-e`, as previously
mentioned, to start typing commands. To see which commands are available, at the
prompt, press tab, or view the help topic with `> help commands`.
@ -26,31 +26,31 @@ If the colorscheme doesn't look good, you can change it with
or see more information about colorschemes and syntax highlighting with `> help
colors`.
Press Ctrl-w to move between splits, and type `> vsplit filename` or
Press `Ctrl-w` to move between splits, and type `> vsplit filename` or
`> hsplit filename` to open a new split.
## Accessing more help
Micro has a built-in help system which can be accessed with the `> help` command.
To view help for the various available topics, press Ctrl-e to access command
To view help for the various available topics, press `Ctrl-e` to access command
mode and type in `> help` followed by a topic. Typing just `> help` will open
this page.
Here are the available help topics:
* tutorial: A brief tutorial which gives an overview of all the other help
topics
* keybindings: Gives a full list of the default keybindings as well as how to
rebind them
* defaultkeys: Gives a more straight-forward list of the hotkey commands and
what they do
* commands: Gives a list of all the commands and what they do
* options: Gives a list of all the options you can customize
* plugins: Explains how micro's plugin system works and how to create your own
plugins
* colors: Explains micro's colorscheme and syntax highlighting engine and how
to create your own colorschemes or add new languages to the engine
* `tutorial`: A brief tutorial which gives an overview of all the other help
topics
* `keybindings`: Gives a full list of the default keybindings as well as how to
rebind them
* `defaultkeys`: Gives a more straight-forward list of the hotkey commands and
what they do
* `commands`: Gives a list of all the commands and what they do
* `options`: Gives a list of all the options you can customize
* `plugins`: Explains how micro's plugin system works and how to create your own
plugins
* `colors`: Explains micro's colorscheme and syntax highlighting engine and how
to create your own colorschemes or add new languages to the engine
For example, to open the help page on plugins you would run `> help plugins`.

View File

@ -36,15 +36,15 @@ following in the `bindings.json` file.
```
**Note:** The syntax `<Modifier><key>` is equivalent to `<Modifier>-<key>`. In
addition, Ctrl-Shift bindings are not supported by terminals, and are the same
as simply Ctrl bindings. This means that `CtrlG`, `Ctrl-G`, and `Ctrl-g` all
mean the same thing. However, for Alt this is not the case: `AltG` and `Alt-G`
addition, `Ctrl-Shift` bindings are not supported by terminals, and are the same
as simply `Ctrl` bindings. This means that `CtrlG`, `Ctrl-G`, and `Ctrl-g` all
mean the same thing. However, for `Alt` this is not the case: `AltG` and `Alt-G`
mean `Alt-Shift-g`, while `Alt-g` does not require the Shift modifier.
In addition to editing your `~/.config/micro/bindings.json`, you can run
`>bind <keycombo> <action>` For a list of bindable actions, see below.
You can also chain commands when rebinding. For example, if you want Alt-s to
You can also chain commands when rebinding. For example, if you want `Alt-s` to
save and quit you can bind it like so:
```json

View File

@ -11,10 +11,10 @@ if you have set either of the above environment variables).
Here are the available options:
* `autoindent`: when creating a new line, use the same indentation as the
* `autoindent`: when creating a new line, use the same indentation as the
previous line.
default value: `true`
default value: `true`
* `autosave`: automatically save the buffer every n seconds, where n is the
value of the autosave option. Also when quitting on a modified buffer, micro
@ -77,28 +77,28 @@ Here are the available options:
specified column. This is useful if you want column 80 to be highlighted
special for example.
default value: `0`
default value: `0`
* `colorscheme`: loads the colorscheme stored in
* `colorscheme`: loads the colorscheme stored in
$(configDir)/colorschemes/`option`.micro, This setting is `global only`.
default value: `default`
default value: `default`
Note that the default colorschemes (default, solarized, and solarized-tc)
are not located in configDir, because they are embedded in the micro
binary.
Note that the default colorschemes (default, solarized, and solarized-tc)
are not located in configDir, because they are embedded in the micro
binary.
The colorscheme can be selected from all the files in the
~/.config/micro/colorschemes/ directory. Micro comes by default with
three colorschemes:
The colorscheme can be selected from all the files in the
~/.config/micro/colorschemes/ directory. Micro comes by default with
three colorschemes:
You can read more about micro's colorschemes in the `colors` help topic
(`help colors`).
You can read more about micro's colorschemes in the `colors` help topic
(`help colors`).
* `cursorline`: highlight the line that the cursor is on in a different color
(the color is defined by the colorscheme you are using).
default value: `true`
default value: `true`
* `detectlimit`: if this is not set to 0, it will limit the amount of first
lines in a file that are matched to determine the filetype.
@ -109,7 +109,7 @@ Here are the available options:
* `diffgutter`: display diff indicators before lines.
default value: `false`
default value: `false`
* `divchars`: specifies the "divider" characters used for the dividing line
between vertical/horizontal splits. The first character is for vertical
@ -134,11 +134,11 @@ Here are the available options:
* `eofnewline`: micro will automatically add a newline to the end of the
file if one does not exist.
default value: `true`
default value: `true`
* `fakecursor`: forces micro to render the cursor using terminal colors rather
than the actual terminal cursor. This is useful when the terminal's cursor is
slow or otherwise unavailable/undesirable to use.
than the actual terminal cursor. This is useful when the terminal's cursor is
slow or otherwise unavailable/undesirable to use.
default value: `false`
@ -151,7 +151,7 @@ Here are the available options:
intensive. This option will be automatically disabled if the file size
exceeds 50KB.
default value: `false`
default value: `false`
* `fileformat`: this determines what kind of line endings micro will use for
the file. Unix line endings are just `\n` (linefeed) whereas dos line
@ -164,12 +164,12 @@ Here are the available options:
an effect if the file is empty/newly created, because otherwise the fileformat
will be automatically detected from the existing line endings.
default value: `unix` on Unix systems, `dos` on Windows
default value: `unix` on Unix systems, `dos` on Windows
* `filetype`: sets the filetype for the current buffer. Set this option to
`off` to completely disable filetype detection.
`off` to completely disable filetype detection.
default value: `unknown`. This will be automatically overridden depending
default value: `unknown`. This will be automatically overridden depending
on the file you open.
* `hlsearch`: highlight all instances of the searched text after a successful
@ -179,56 +179,56 @@ Here are the available options:
change the `hlsearch` setting. As long as `hlsearch` is set to true, the next
search will have the highlighting turned on again.
default value: `false`
default value: `false`
* `hltaberrors`: highlight tabs when spaces are expected, and spaces when tabs
are expected. More precisely: if `tabstospaces` option is on, highlight
all tab characters; if `tabstospaces` is off, highlight space characters
in the initial indent part of the line.
default value: `false`
default value: `false`
* `hltrailingws`: highlight trailing whitespaces at ends of lines. Note that
it doesn't highlight newly added trailing whitespaces that naturally occur
while typing text. It highlights only nasty forgotten trailing whitespaces.
default value: `false`
default value: `false`
* `incsearch`: enable incremental search in "Find" prompt (matching as you type).
default value: `true`
default value: `true`
* `ignorecase`: perform case-insensitive searches.
default value: `true`
default value: `true`
* `indentchar`: sets the indentation character. This will not be inserted into
files; it is only a visual indicator that whitespace is present. If set to a
printing character, it functions as a subset of the "show invisibles"
setting available in many other text editors. The color of this character is
determined by the `indent-char` field in the current theme rather than the
default text color.
files; it is only a visual indicator that whitespace is present. If set to a
printing character, it functions as a subset of the "show invisibles"
setting available in many other text editors. The color of this character is
determined by the `indent-char` field in the current theme rather than the
default text color.
default value: ` ` (space)
default value: ` ` (space)
* `infobar`: enables the line at the bottom of the editor where messages are
printed. This option is `global only`.
default value: `true`
default value: `true`
* `keepautoindent`: when using autoindent, whitespace is added for you. This
option determines if when you move to the next line without any insertions
the whitespace that was added should be deleted to remove trailing
whitespace. By default, the autoindent whitespace is deleted if the line
whitespace. By default, the autoindent whitespace is deleted if the line
was left empty.
default value: `false`
default value: `false`
* `keymenu`: display the nano-style key menu at the bottom of the screen. Note
that ToggleKeyMenu is bound to `Alt-g` by default and this is displayed in
the statusline. To disable the key binding, bind `Alt-g` to `None`.
default value: `false`
default value: `false`
* `matchbrace`: show matching braces for '()', '{}', '[]' when the cursor
is on a brace character or next to it.
@ -236,12 +236,12 @@ Here are the available options:
default value: `true`
* `matchbracestyle`: whether to underline or highlight matching braces when
`matchbrace` is enabled. The color of highlight is determined by the `match-brace`
field in the current theme. Possible values:
* `underline`: underline matching braces.
* `highlight`: use `match-brace` style from the current theme.
`matchbrace` is enabled. The color of highlight is determined by the `match-brace`
field in the current theme. Possible values:
* `underline`: underline matching braces.
* `highlight`: use `match-brace` style from the current theme.
default value: `underline`
default value: `underline`
* `mkparents`: if a file is opened on a path that does not exist, the file
cannot be saved because the parent directories don't exist. This option lets
@ -255,7 +255,7 @@ Here are the available options:
example, because the terminal has access to the local clipboard and micro
does not).
default value: `true`
default value: `true`
* `multiopen`: specifies how to layout multiple files opened at startup.
Most useful as a command-line option, like `-multiopen vsplit`. Possible
@ -264,11 +264,11 @@ Here are the available options:
* `vsplit`: open files side-by-side.
* `hsplit`: open files stacked top to bottom.
default value: `tab`
default value: `tab`
* `paste`: treat characters sent from the terminal in a single chunk as a paste
event rather than a series of manual key presses. If you are pasting using
the terminal keybinding (not Ctrl-v, which is micro's default paste
the terminal keybinding (not `Ctrl-v`, which is micro's default paste
keybinding) then it is a good idea to enable this option during the paste
and disable once the paste is over. See `> help copypaste` for details about
copying and pasting in a terminal environment.
@ -320,23 +320,23 @@ Here are the available options:
or forced `autosave` in case the buffer didn't change. A manual save will
involve the action regardless if the buffer has been changed or not.
default value: `false`
default value: `false`
* `ruler`: display line numbers.
default value: `true`
default value: `true`
* `relativeruler`: make line numbers display relatively. If set to true, all
lines except for the line that the cursor is located will display the distance
from the cursor's line.
from the cursor's line.
default value: `false`
default value: `false`
* `savecursor`: remember where the cursor was last time the file was opened and
put it there when you open the file again. Information is saved to
`~/.config/micro/buffers/`
default value: `false`
default value: `false`
* `savehistory`: remember command history between closing and re-opening
micro. Information is saved to `~/.config/micro/buffers/history`.
@ -347,7 +347,7 @@ Here are the available options:
so if you close and reopen a file, you can keep undoing. Information is
saved to `~/.config/micro/buffers/`.
default value: `false`
default value: `false`
* `scrollbar`: display a scroll bar
@ -360,31 +360,31 @@ Here are the available options:
* `scrollmargin`: margin at which the view starts scrolling when the cursor
approaches the edge of the view.
default value: `3`
default value: `3`
* `scrollspeed`: amount of lines to scroll for one scroll event.
default value: `2`
default value: `2`
* `smartpaste`: add leading whitespace when pasting multiple lines.
This will attempt to preserve the current indentation level when pasting an
unindented block.
default value: `true`
default value: `true`
* `softwrap`: wrap lines that are too long to fit on the screen.
default value: `false`
default value: `false`
* `splitbottom`: when a horizontal split is created, create it below the
current split.
default value: `true`
default value: `true`
* `splitright`: when a vertical split is created, create it to the right of the
current split.
default value: `true`
default value: `true`
* `statusformatl`: format string definition for the left-justified part of the
statusline. Special directives should be placed inside `$()`. Special
@ -403,36 +403,36 @@ Here are the available options:
* `statusline`: display the status line at the bottom of the screen.
default value: `true`
default value: `true`
* `sucmd`: specifies the super user command. On most systems this is "sudo" but
on BSD it can be "doas." This option can be customized and is only used when
saving with su.
default value: `sudo`
default value: `sudo`
* `syntax`: enables syntax highlighting.
default value: `true`
default value: `true`
* `tabmovement`: navigate spaces at the beginning of lines as if they are tabs
(e.g. move over 4 spaces at once). This option only does anything if
`tabstospaces` is on.
default value: `false`
default value: `false`
* `tabhighlight`: inverts the tab characters' (filename, save indicator, etc)
colors with respect to the tab bar.
colors with respect to the tab bar.
default value: false
default value: false
* `tabreverse`: reverses the tab bar colors when active.
default value: true
default value: true
* `tabsize`: the size in spaces that a tab character should be displayed with.
default value: `4`
default value: `4`
* `tabstospaces`: use spaces instead of tabs. Note: This option will be
overridden by [the `ftoptions` plugin](https://github.com/zyedidia/micro/blob/master/runtime/plugins/ftoptions/ftoptions.lua)
@ -440,25 +440,25 @@ Here are the available options:
your config. See [issue #2213](https://github.com/zyedidia/micro/issues/2213)
for more details.
default value: `false`
default value: `false`
* `useprimary` (only useful on unix): defines whether or not micro will use the
primary clipboard to copy selections in the background. This does not affect
the normal clipboard using Ctrl-c and Ctrl-v.
the normal clipboard using `Ctrl-c` and `Ctrl-v`.
default value: `true`
default value: `true`
* `wordwrap`: wrap long lines by words, i.e. break at spaces. This option
only does anything if `softwrap` is on.
default value: `false`
default value: `false`
* `xterm`: micro will assume that the terminal it is running in conforms to
`xterm-256color` regardless of what the `$TERM` variable actually contains.
Enabling this option may cause unwanted effects if your terminal in fact
does not conform to the `xterm-256color` standard.
Default value: `false`
default value: `false`
---
@ -481,7 +481,7 @@ or disable them:
recent Git commit rather than the diff since opening the file.
Any option you set in the editor will be saved to the file
~/.config/micro/settings.json so, in effect, your configuration file will be
~/.config/micro/settings.json so, in effect, your configuration file will be
created for you. If you'd like to take your configuration with you to another
machine, simply copy the settings.json to the other machine.
@ -583,14 +583,14 @@ all files except Go files, and `tabsize` 4 for all files except Ruby files:
```json
{
"ft:go": {
"tabstospaces": false
},
"ft:ruby": {
"tabsize": 2
},
"tabstospaces": true,
"tabsize": 4
"ft:go": {
"tabstospaces": false
},
"ft:ruby": {
"tabsize": 2
},
"tabstospaces": true,
"tabsize": 4
}
```
@ -598,13 +598,13 @@ Or similarly you can match with globs:
```json
{
"*.go": {
"tabstospaces": false
},
"*.rb": {
"tabsize": 2
},
"tabstospaces": true,
"tabsize": 4
"*.go": {
"tabstospaces": false
},
"*.rb": {
"tabsize": 2
},
"tabstospaces": true,
"tabsize": 4
}
```

View File

@ -5,7 +5,8 @@ folders containing Lua files and possibly other source files placed
in `~/.config/micro/plug`. The plugin directory (within `plug`) should
contain at least one Lua file and a `repo.json` file. The `repo.json` file
provides additional information such as the name of the plugin, the
plugin's website, dependencies, etc... [Here is an example `repo.json` file](https://github.com/micro-editor/updated-plugins/blob/master/go-plugin/repo.json)
plugin's website, dependencies, etc...
[Here is an example `repo.json` file](https://github.com/micro-editor/updated-plugins/blob/master/go-plugin/repo.json)
from the go plugin, which has the following file structure:
```
@ -82,7 +83,7 @@ end
```
The `bp` variable is a reference to the bufpane the action is being executed
within. This is almost always the current bufpane.
within. This is almost always the current bufpane.
All available actions are listed in the keybindings section of the help.
@ -127,98 +128,98 @@ The packages and functions are listed below (in Go type signatures):
usage of `time.Duration`.
* `micro/config`
- `MakeCommand(name string, action func(bp *BufPane, args[]string),
- `MakeCommand(name string, action func(bp *BufPane, args[]string),
completer buffer.Completer)`:
create a command with the given name, and lua callback function when
the command is run. A completer may also be given to specify how
autocompletion should work with the custom command.
- `FileComplete`: autocomplete using files in the current directory
- `HelpComplete`: autocomplete using names of help documents
- `OptionComplete`: autocomplete using names of options
- `OptionValueComplete`: autocomplete using names of options, and valid
- `FileComplete`: autocomplete using files in the current directory
- `HelpComplete`: autocomplete using names of help documents
- `OptionComplete`: autocomplete using names of options
- `OptionValueComplete`: autocomplete using names of options, and valid
values afterwards
- `NoComplete`: no autocompletion suggestions
- `NoComplete`: no autocompletion suggestions
- `TryBindKey(k, v string, overwrite bool) (bool, error)`: bind the key
- `TryBindKey(k, v string, overwrite bool) (bool, error)`: bind the key
`k` to the string `v` in the `bindings.json` file. If `overwrite` is
true, this will overwrite any existing binding to key `k`. Returns true
if the binding was made, and a possible error (for example writing to
`bindings.json` can cause an error).
- `Reload()`: reload configuration files.
- `Reload()`: reload configuration files.
- `AddRuntimeFileFromMemory(filetype RTFiletype, filename, data string)`:
- `AddRuntimeFileFromMemory(filetype RTFiletype, filename, data string)`:
add a runtime file to the `filetype` runtime filetype, with name
`filename` and data `data`.
- `AddRuntimeFilesFromDirectory(plugin string, filetype RTFiletype,
- `AddRuntimeFilesFromDirectory(plugin string, filetype RTFiletype,
directory, pattern string)`:
add runtime files for the given plugin with the given RTFiletype from
a directory within the plugin root. Only adds files that match the
pattern using Go's `filepath.Match`
- `AddRuntimeFile(plugin string, filetype RTFiletype, filepath string)`:
- `AddRuntimeFile(plugin string, filetype RTFiletype, filepath string)`:
add a given file inside the plugin root directory as a runtime file
to the given RTFiletype category.
- `ListRuntimeFiles(fileType RTFiletype) []string`: returns a list of
- `ListRuntimeFiles(fileType RTFiletype) []string`: returns a list of
names of runtime files of the given type.
- `ReadRuntimeFile(fileType RTFiletype, name string) string`: returns the
- `ReadRuntimeFile(fileType RTFiletype, name string) string`: returns the
contents of a given runtime file.
- `NewRTFiletype() int`: creates a new RTFiletype, and returns its value.
- `NewRTFiletype() int`: creates a new RTFiletype, and returns its value.
- `RTColorscheme`: runtime files for colorschemes.
- `RTSyntax`: runtime files for syntax files.
- `RTHelp`: runtime files for help documents.
- `RTPlugin`: runtime files for plugin source code.
- `RTColorscheme`: runtime files for colorschemes.
- `RTSyntax`: runtime files for syntax files.
- `RTHelp`: runtime files for help documents.
- `RTPlugin`: runtime files for plugin source code.
- `RegisterCommonOption(pl string, name string, defaultvalue interface{})`:
- `RegisterCommonOption(pl string, name string, defaultvalue interface{})`:
registers a new option with for the given plugin. The name of the
option will be `pl.name`, and will have the given default value. Since
this registers a common option, the option will be modifiable on a
per-buffer basis, while also having a global value (in the
GlobalSettings map).
- `RegisterGlobalOption(pl string, name string, defaultvalue interface{})`:
- `RegisterGlobalOption(pl string, name string, defaultvalue interface{})`:
same as `RegisterCommonOption` but the option cannot be modified
locally to each buffer.
- `GetGlobalOption(name string) interface{}`: returns the value of a
- `GetGlobalOption(name string) interface{}`: returns the value of a
given plugin in the `GlobalSettings` map.
- `SetGlobalOption(option, value string) error`: sets an option to a
- `SetGlobalOption(option, value string) error`: sets an option to a
given value. Same as using the `> set` command. This will parse the
value to the actual value type.
- `SetGlobalOptionNative(option string, value interface{}) error`: sets
- `SetGlobalOptionNative(option string, value interface{}) error`: sets
an option to a given value, where the type of value is the actual
type of the value internally.
* `micro/shell`
- `ExecCommand(name string, arg ...string) (string, error)`: runs an
- `ExecCommand(name string, arg ...string) (string, error)`: runs an
executable with the given arguments, and pipes the output (stderr
and stdout) of the executable to an internal buffer, which is
returned as a string, along with a possible error.
- `RunCommand(input string) (string, error)`: same as `ExecCommand`,
- `RunCommand(input string) (string, error)`: same as `ExecCommand`,
except this uses micro's argument parser to parse the arguments from
the input. For example `cat 'hello world.txt' file.txt`, will pass
two arguments in the `ExecCommand` argument list (quoting arguments
will preserve spaces).
- `RunBackgroundShell(input string) (func() string, error)`: returns a
- `RunBackgroundShell(input string) (func() string, error)`: returns a
function that will run the given shell command and return its output.
- `RunInteractiveShell(input string, wait bool, getOutput bool)
- `RunInteractiveShell(input string, wait bool, getOutput bool)
(string, error)`:
temporarily closes micro and runs the given command in the terminal.
If `wait` is true, micro will wait for the user to press enter before
returning to text editing. If `getOutput` is true, micro redirect
stdout from the command to the returned string.
- `JobStart(cmd string, onStdout, onStderr,
- `JobStart(cmd string, onStdout, onStderr,
onExit func(string, []interface{}), userargs ...interface{})
*exec.Cmd`:
Starts a background job by running the shell on the given command
@ -227,16 +228,16 @@ The packages and functions are listed below (in Go type signatures):
be passed to the callbacks, along with the output as the first
argument of the callback.
- `JobSpawn(cmd string, cmdArgs []string, onStdout, onStderr,
- `JobSpawn(cmd string, cmdArgs []string, onStdout, onStderr,
onExit func(string, []interface{}), userargs ...interface{})
*exec.Cmd`:
same as `JobStart`, except doesn't run the command through the shell
and instead takes as inputs the list of arguments.
- `JobStop(cmd *exec.Cmd)`: kills a job.
- `JobSend(cmd *exec.Cmd, data string)`: sends some data to a job's stdin.
- `JobStop(cmd *exec.Cmd)`: kills a job.
- `JobSend(cmd *exec.Cmd, data string)`: sends some data to a job's stdin.
- `RunTermEmulator(h *BufPane, input string, wait bool, getOutput bool,
- `RunTermEmulator(h *BufPane, input string, wait bool, getOutput bool,
callback func(out string, userargs []interface{}),
userargs []interface{}) error`:
starts a terminal emulator from a given BufPane with the input command.
@ -247,7 +248,7 @@ The packages and functions are listed below (in Go type signatures):
optional user arguments. This function returns an error on systems
where the terminal emulator is not supported.
- `TermEmuSupported`: true on systems where the terminal emulator is
- `TermEmuSupported`: true on systems where the terminal emulator is
supported and false otherwise. Supported systems:
* Linux
* MacOS