mirror of
https://github.com/zyedidia/micro
synced 2024-11-05 17:41:24 +00:00
Update some docs
This commit is contained in:
parent
5dfaaf8856
commit
b41fc10b8f
8 changed files with 59 additions and 94 deletions
|
@ -1467,3 +1467,7 @@ func (h *BufPane) RemoveAllMultiCursors() bool {
|
|||
h.multiWord = false
|
||||
return true
|
||||
}
|
||||
|
||||
func (h *BufPane) None() bool {
|
||||
return false
|
||||
}
|
||||
|
|
|
@ -510,6 +510,7 @@ var BufKeyActions = map[string]BufKeyAction{
|
|||
"RemoveAllMultiCursors": (*BufPane).RemoveAllMultiCursors,
|
||||
"SkipMultiCursor": (*BufPane).SkipMultiCursor,
|
||||
"JumpToMatchingBrace": (*BufPane).JumpToMatchingBrace,
|
||||
"None": (*BufPane).None,
|
||||
|
||||
// This was changed to InsertNewline but I don't want to break backwards compatibility
|
||||
"InsertEnter": (*BufPane).InsertNewline,
|
||||
|
|
|
@ -2,48 +2,62 @@
|
|||
|
||||
This help page aims to cover two aspects of micro's syntax highlighting engine:
|
||||
|
||||
- How to create colorschemes and use them
|
||||
- How to create syntax files to add to the list of languages micro can highlight
|
||||
|
||||
- How to create colorschemes and use them.
|
||||
- How to create syntax files to add to the list of languages micro can highlight.
|
||||
|
||||
## Colorschemes
|
||||
|
||||
To change your colorscheme, press Ctrl-E in micro to bring up the command
|
||||
prompt, and type:
|
||||
|
||||
```
|
||||
set colorscheme solarized
|
||||
set colorscheme monokai
|
||||
```
|
||||
|
||||
(or whichever colorscheme you choose).
|
||||
|
||||
Micro comes with a number of colorschemes by default. Here is the list:
|
||||
Micro comes with a number of colorschemes by default. Modern terminals tend to
|
||||
have three different kinds of color support. The most common is 256 color where
|
||||
the terminal provides 256 standardized colors (except the first 16 may be configured
|
||||
by the user). A 256-color theme requires a terminal with 256 color support and
|
||||
is the most portable.
|
||||
|
||||
A 16-color theme uses the 16 user-configurable colors (or 16 default colors on
|
||||
old terminals). These colorschemes are guranteed to work, but won't look great
|
||||
unless the 16 colors are configured to the user's liking. Using a 16-color theme
|
||||
will also preserve the terminal's theme because the terminal usually uses its 16
|
||||
colors for prompts or other coloring.
|
||||
|
||||
Some terminals support "true color" with 16 million colors (using standard RGB values).
|
||||
There is no one standard for this color support among terminals so this method
|
||||
is not guaranteed to work. Usually truecolor must also be enabled by the user. The
|
||||
colorschemes using true color will look exactly as intended. If true color is not
|
||||
supported, a true color colorscheme will approximate its colors to 256-color.
|
||||
|
||||
Here is the list of colorschemes:
|
||||
|
||||
### 256 color
|
||||
|
||||
These should work and look nice in most terminals. I recommend these
|
||||
themes the most.
|
||||
|
||||
* `monokai`: this is the monokai colorscheme; you may recognize it as Sublime
|
||||
Text's default colorscheme. It requires true color to look perfect, but the
|
||||
256 color approximation looks very good as well. It's also the default
|
||||
colorscheme.
|
||||
* `monokai` (also the `default` colorscheme)
|
||||
* `zenburn`
|
||||
* `gruvbox`
|
||||
* `darcula`
|
||||
* `twilight`
|
||||
* `railscast`
|
||||
* `bubblegum`: a light colorscheme
|
||||
* `bubblegum`
|
||||
|
||||
### 16 color
|
||||
|
||||
These may vary widely based on the 16 colors selected for your terminal.
|
||||
|
||||
* `simple`: this is the simplest colorscheme. It uses 16 colors which are set by
|
||||
your terminal
|
||||
* `solarized`: You should have the solarized color palette in your terminal to use this colorscheme properly.
|
||||
* `simple`
|
||||
* `solarized` (must have the solarized color palette in your terminal to use this colorscheme properly)
|
||||
* `cmc-16`
|
||||
* `cmc-paper`: cmc-16, but on a white background. (Actually light grey
|
||||
on most ANSI (16-color) terminals)
|
||||
* `geany`: Colorscheme based on geany's default highlighting.
|
||||
* `cmc-paper`
|
||||
* `geany`
|
||||
|
||||
### True color
|
||||
|
||||
|
@ -56,22 +70,10 @@ These require terminals that support true color and require `MICRO_TRUECOLOR=1`
|
|||
* `gruvbox-tc`: The true color version of the gruvbox colorscheme
|
||||
* `github-tc`: The true color version of the Github colorscheme
|
||||
|
||||
### Monochrome
|
||||
|
||||
You can also use `monochrome` if you'd prefer to have just the terminal's default
|
||||
foreground and background colors. Note: This provides no syntax highlighting!
|
||||
|
||||
### Other
|
||||
|
||||
See `help gimmickcolors` for a list of some true colour themes that are more
|
||||
just for fun than for serious use. (Though feel free if you want!)
|
||||
|
||||
|
||||
## Creating a Colorscheme
|
||||
|
||||
Micro's colorschemes are also extremely simple to create. The default ones can
|
||||
be found
|
||||
[here](https://github.com/zyedidia/micro/tree/master/runtime/colorschemes).
|
||||
be found [here](https://github.com/zyedidia/micro/tree/master/runtime/colorschemes).
|
||||
|
||||
They are only about 18-30 lines in total.
|
||||
|
||||
|
|
|
@ -29,9 +29,6 @@ Here are the possible commands that you can use.
|
|||
|
||||
* `show option`: shows the current value of the given option.
|
||||
|
||||
* `eval "expression"`: Evaluates a Lua expression. Note that micro will not
|
||||
print anything so you should use `messenger:Message(...)` to display a value.
|
||||
|
||||
* `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.
|
||||
|
||||
|
@ -51,23 +48,11 @@ Here are the possible commands that you can use.
|
|||
|
||||
* `log`: opens a log of all messages and debug statements.
|
||||
|
||||
* `plugin install plugin_name`: installs the given plugin.
|
||||
|
||||
* `plugin remove plugin_name`: removes the given plugin.
|
||||
|
||||
* `plugin list`: lists all installed plugins.
|
||||
|
||||
* `plugin update`: updates all installed plugins.
|
||||
* `plugin version pl`: shows version for specified plugin.
|
||||
|
||||
* `plugin search plugin_name`: searches for the given plugin. Note that you can
|
||||
find a list of all available plugins at
|
||||
github.com/micro-editor/plugin-channel.
|
||||
|
||||
You can also see more information about the plugin manager in the
|
||||
`Plugin Manager` section of the `plugins` help topic.
|
||||
|
||||
* `plugin available`: list plugins available for download (this includes any
|
||||
plugins that may be already installed).
|
||||
* `plugin info pl`: shows additional info for specified plugin.
|
||||
|
||||
* `reload`: reloads all runtime files.
|
||||
|
||||
|
@ -98,6 +83,8 @@ The following commands are provided by the default plugins:
|
|||
|
||||
* `lint`: Lint the current file for errors.
|
||||
|
||||
* `comment`: automatically comment or uncomment current selection or line.
|
||||
|
||||
# Command Parsing
|
||||
|
||||
When running a command, you can use extra syntax that micro will expand before
|
||||
|
|
|
@ -1,25 +1,23 @@
|
|||
# Micro help text
|
||||
|
||||
Thank you for downloading and using micro.
|
||||
|
||||
Micro is a terminal-based text editor that aims to be easy to use and intuitive,
|
||||
while also taking advantage of the full capabilities of modern terminals.
|
||||
|
||||
To open the command bar, press CtrlE. This enables a `>` prompt for typing
|
||||
commands. From now on when the documentation says to run a command such as
|
||||
`> help`, this means press CtrlE and type `help` (and press enter to execute
|
||||
the command).
|
||||
|
||||
|
||||
For a list of the default keybindings press CtrlE and type `help defaultkeys`.
|
||||
For a list of the default keybindings run `> help defaultkeys`.
|
||||
For more information on keybindings see `> help keybindings`.
|
||||
|
||||
See the next section for more information about documentation and help.
|
||||
|
||||
## Quick-start
|
||||
|
||||
Press CtrlQ to quit, and CtrlS to save. Press CtrlE to start typing commands and
|
||||
you can see which commands are available by pressing tab, or by viewing the help
|
||||
topic `> help commands`. When I write `> ...` I mean press CtrlE and then type
|
||||
whatever is there.
|
||||
topic `> help commands`.
|
||||
|
||||
Move the cursor around with the mouse or the arrow keys. Type
|
||||
Move the cursor around with the mouse or the arrow keys. Run
|
||||
`> help defaultkeys` to get a quick, easy overview of the default hotkeys and
|
||||
what they do. For more info on rebinding keys, see type `> help keybindings`.
|
||||
|
||||
|
@ -30,7 +28,6 @@ see more information with `> help colors`.
|
|||
Press CtrlW 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 much like Vim's (although less extensive).
|
||||
|
@ -53,8 +50,7 @@ Here are the possible help topics that you can read:
|
|||
* 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 press CtrlE and type
|
||||
`help plugins`.
|
||||
For example, to open the help page on plugins you would run `> help plugins`.
|
||||
|
||||
I recommend looking at the `tutorial` help file because it is short for each
|
||||
section and gives concrete examples of how to use the various configuration
|
||||
|
|
|
@ -5,7 +5,7 @@ hotkeys are fully customizable to your liking.
|
|||
|
||||
Custom keybindings are stored internally in micro if changed with the `> bind`
|
||||
command or you can also be added in the file `~/.config/micro/bindings.json` as
|
||||
discussed below. For a list of the default keybindings in the json format used
|
||||
discussed below. For a list of the default keybindings in the json format used
|
||||
by micro, please see the end of this file. For a more user-friendly list with
|
||||
explanations of what the default hotkeys are and what they do, please see
|
||||
`> help defaultkeys` (a json formatted list of default keys is included
|
||||
|
@ -20,7 +20,6 @@ cursor the start and end of the buffer.
|
|||
|
||||
You can hold shift with all of these movement actions to select while moving.
|
||||
|
||||
|
||||
## Rebinding keys
|
||||
|
||||
The bindings may be rebound using the `~/.config/micro/bindings.json` file. Each
|
||||
|
@ -120,12 +119,10 @@ You can do this in linux using the loadkeys program.
|
|||
|
||||
Coming soon!
|
||||
|
||||
|
||||
## Unbinding keys
|
||||
|
||||
It is also possible to disable any of the default key bindings by use of the
|
||||
`UnbindKey` action in the user's `bindings.json` file.
|
||||
|
||||
`None` action in the user's `bindings.json` file.
|
||||
|
||||
## Bindable actions and bindable keys
|
||||
|
||||
|
@ -222,7 +219,7 @@ SpawnMultiCursorSelect
|
|||
RemoveMultiCursor
|
||||
RemoveAllMultiCursors
|
||||
SkipMultiCursor
|
||||
UnbindKey
|
||||
None
|
||||
JumpToMatchingBrace
|
||||
```
|
||||
|
||||
|
@ -486,3 +483,9 @@ Additionally, alt keys can be bound by using `Alt-key`. For example `Alt-a` or
|
|||
`Ctrl` so `Alt-a` could be rewritten as `Alta` (case matters for alt bindings).
|
||||
This is why in the default keybindings you can see `AltShiftLeft` instead of
|
||||
`Alt-ShiftLeft` (they are equivalent).
|
||||
|
||||
Please note that terminal emulators are strange applications and micro only receives
|
||||
key events that the terminal decides to send. Some terminal emulators may not
|
||||
send certain events even if this document says micro can receive the event. To see
|
||||
exactly what micro receives from the terminal when you press a key, run the `> raw`
|
||||
command.
|
||||
|
|
|
@ -246,31 +246,14 @@ Here are the options that you can set:
|
|||
|
||||
---
|
||||
|
||||
Default plugin options:
|
||||
|
||||
* `autoclose`: automatically close `{}` `()` `[]` `""` `''`. Provided by the
|
||||
`autoclose` plugin
|
||||
|
||||
default value: `true`
|
||||
|
||||
* `ftoptions`: by default, micro will set some options based on the filetype. At
|
||||
the moment, micro will use tabs for makefiles and spaces for python and yaml
|
||||
files regardless of your settings. If you would like to disable this behavior
|
||||
turn this option off.
|
||||
|
||||
default value: `true`
|
||||
|
||||
* `linter`: Automatically lint when the file is saved. Provided by the `linter`
|
||||
plugin.
|
||||
|
||||
default value: `true`
|
||||
Plugin options: all plugins come with a special option to enable or disable them. THe option
|
||||
is a boolean with the same name as the plugin itself.
|
||||
|
||||
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
|
||||
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.
|
||||
|
||||
|
||||
## Global and local settings
|
||||
|
||||
You can set these settings either globally or locally. Locally means that the
|
||||
|
|
|
@ -8,17 +8,6 @@ Hopefully you'll find this useful.
|
|||
|
||||
See `> help defaultkeys` for a list an explanation of the default keybindings.
|
||||
|
||||
### Plugins
|
||||
|
||||
Micro has a plugin manager which can automatically download plugins for you. To
|
||||
see the 'official' plugins, go to github.com/micro-editor/plugin-channel.
|
||||
|
||||
For example, if you'd like to install the snippets plugin (listed in that repo),
|
||||
just press `CtrlE` to execute a command, and type `plugin install snippets`.
|
||||
|
||||
For more information about the plugin manager, see the end of the `plugins` help
|
||||
topic.
|
||||
|
||||
### Settings
|
||||
|
||||
In micro, your settings are stored in `~/.config/micro/settings.json`, a file
|
||||
|
|
Loading…
Reference in a new issue