From f5e1f93ee5f04c8ecfd4d7794848b2c29e028ccb Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Thu, 6 Feb 2020 19:26:27 -0500 Subject: [PATCH] Update docs --- runtime/help/colors.md | 2 +- runtime/help/commands.md | 23 +++++++++++++------ runtime/help/help.md | 8 +++---- runtime/help/plugins.md | 49 ++++++++++++++++++++++++++++++++-------- 4 files changed, 61 insertions(+), 21 deletions(-) diff --git a/runtime/help/colors.md b/runtime/help/colors.md index 81cbc194..e17107d0 100644 --- a/runtime/help/colors.md +++ b/runtime/help/colors.md @@ -7,7 +7,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 CtrlE in micro to bring up the command prompt, and type: ``` diff --git a/runtime/help/commands.md b/runtime/help/commands.md index ee0eb31d..d77e98f5 100644 --- a/runtime/help/commands.md +++ b/runtime/help/commands.md @@ -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 CtrlE. It is a single-line buffer, meaning that all keybindings from a normal buffer are supported (as well as mouse and selection). @@ -13,7 +13,7 @@ does not look up environment variables. # Commands Micro provides the following commands that can be executed at the command-bar by -pressing `Ctrl-e` and entering the command. Arguments are placed in single +pressing `CtrlE` and entering the command. Arguments are placed in single quotes here but these are not necessary when entering the command in micro. * `bind 'key' 'action'`: creates a keybinding from key to action. See the @@ -69,14 +69,21 @@ quotes here but these are not necessary when entering the command in micro. as standard input and replaces the selection with the stdout of the shell command. For example, to sort a list of numbers, first select them, and then execute `> textfilter sort -n`. - + * `log`: opens a log of all messages and debug statements. -* `plugin 'list'`: lists all installed plugins. +* `plugin list`: lists all installed plugins. -* `plugin version 'pl'`: shows version for specified plugin. +* `plugin install 'pl'`: install a plugin. -* `plugin info 'pl'`: shows additional info for specified plugin. +* `plugin remove 'pl'`: remove a plugin. + +* `plugin update 'pl'`: update a plugin (if no arguments are provided + updates all plugins). + +* `plugin search 'pl'`: search available plugins for a keyword. + +* `plugin available`: show available plugins that can be installed. * `reload`: reloads all runtime files. @@ -99,10 +106,12 @@ quotes here but these are not necessary when entering the command in micro. * `showkey`: Show the action(s) bound to a given key. For example running `> showkey CtrlC` will display `Copy`. +* `term exec?`: Open a terminal emulator running the given executable. If no + executable is given, this will open the default shell in the terminal emulator. + --- 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. diff --git a/runtime/help/help.md b/runtime/help/help.md index eb9b0a1a..d284e019 100644 --- a/runtime/help/help.md +++ b/runtime/help/help.md @@ -3,9 +3,9 @@ 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 Ctrl-e. This enables a `>` prompt for typing +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 Ctrl-e and type `help` (and press enter to execute +`> help`, this means press CtrlE and type `help` (and press enter to execute the command). For a list of the default keybindings run `> help defaultkeys`. @@ -13,7 +13,7 @@ For more information on keybindings see `> help keybindings`. ## Quick-start -Press Ctrl-q to quit, and Ctrl-s to save. Press Ctrl-e to start typing commands and +Press Ctrl-q to quit, and Ctrl-s 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`. @@ -32,7 +32,7 @@ Press Ctrl-w to move between splits, and type `> vsplit filename` or Micro has a built-in help system which can be accessed with the `help` command. -To use it, press Ctrl-e to access command mode and type in `help` followed by a +To use it, press CtrlE to access command mode and type in `help` followed by a topic. Typing `help` followed by nothing will open this page. Here are the possible help topics that you can read: diff --git a/runtime/help/plugins.md b/runtime/help/plugins.md index 6c431068..1224ce47 100644 --- a/runtime/help/plugins.md +++ b/runtime/help/plugins.md @@ -300,12 +300,43 @@ your own plugins. ## Plugin Manager -Micro's plugin manager is you! Ultimately the plugins that are created -for micro are quite simple and don't require a complex automated tool -to manage them. They should be "git cloned" or somehow placed in the -`~/.config/micro/plug` directory, and that is all that's necessary -for installation. In the rare case that a more complex installation -process is needed (such as dependencies, or additional setup) the -plugin creator should provide the additional instructions on their -website and point to the link using the `install` field in the `info.json` -file. +Micro also has a built in plugin manager which you can invoke with the +`> plugin ...` command, or in the shell with `micro -plugin ...`. + +For the valid commands you can use, see the `command` help topic. + +The manager fetches plugins from the channels (which is simply a list of plugin +metadata) which it knows about. By default, micro only knows about the official +channel which is located at github.com/micro-editor/plugin-channel but you can +add your own third-party channels using the `pluginchannels` option and you can +directly link third-party plugins to allow installation through the plugin +manager with the `pluginrepos` option. + +If you'd like to publish a plugin you've made as an official plugin, you should +upload your plugin online (to Github preferably) and add a `repo.json` file. +This file will contain the metadata for your plugin. Here is an example: + +```json +[{ + "Name": "pluginname", + "Description": "Here is a nice concise description of my plugin", + "Website": "https://github.com/user/plugin" + "Tags": ["python", "linting"], + "Versions": [ + { + "Version": "1.0.0", + "Url": "https://github.com/user/plugin/archive/v1.0.0.zip", + "Require": { + "micro": ">=1.0.3" + } + } + ] +}] +``` + +Then open a pull request at github.com/micro-editor/plugin-channel adding a link +to the raw `repo.json` that is in your plugin repository. + +To make updating the plugin work, the first line of your plugins lua code +should contain the version of the plugin. (Like this: `VERSION = "1.0.0"`) +Please make sure to use [semver](http://semver.org/) for versioning.