]> git.lizzy.rs Git - micro.git/blobdiff - runtime/help/plugins.md
Merge branch 'python-highlight-zero' of https://github.com/a11ce/micro into a11ce...
[micro.git] / runtime / help / plugins.md
index b94adcd1b632e2107fb5d659923330b1ff495268..1818b96bddd4d11f677f4b4439c6556f2d214830 100644 (file)
@@ -43,6 +43,12 @@ are called when certain events happen. Here is the list of callbacks
 which micro defines:
 
 * `init()`: this function should be used for your plugin initialization.
 which micro defines:
 
 * `init()`: this function should be used for your plugin initialization.
+   This function is called after buffers have been initialized.
+
+* `preinit()`: initialization function called before buffers have been
+   initialized.
+
+* `postinit()`: initialization function called after `init()`.
 
 * `onBufferOpen(buf)`: runs when a buffer is opened. The input contains
    the buffer object.
 
 * `onBufferOpen(buf)`: runs when a buffer is opened. The input contains
    the buffer object.
@@ -279,6 +285,7 @@ The packages and functions are listed below (in Go type signatures):
        string is a word character.
     - `String(b []byte) string`: converts a byte array to a string.
     - `RuneStr(r rune) string`: converts a rune to a string.
        string is a word character.
     - `String(b []byte) string`: converts a byte array to a string.
     - `RuneStr(r rune) string`: converts a rune to a string.
+    - `Unzip(src, dest string) error`: unzips a file to given folder.
 
 This may seem like a small list of available functions but some of the objects
 returned by the functions have many methods. The Lua plugin may access any
 
 This may seem like a small list of available functions but some of the objects
 returned by the functions have many methods. The Lua plugin may access any
@@ -352,6 +359,8 @@ strings
 regexp
 errors
 time
 regexp
 errors
 time
+archive/zip
+net/http
 ```
 
 For documentation for each of these functions, see the Go standard
 ```
 
 For documentation for each of these functions, see the Go standard
@@ -359,6 +368,12 @@ library documentation at https://golang.org/pkg/ (for the packages
 exposed to micro plugins). The Lua standard library is also available
 to plugins though it is rather small.
 
 exposed to micro plugins). The Lua standard library is also available
 to plugins though it is rather small.
 
+The following functions are also available from the go-humanize package:
+
+The `humanize` package exposes:
+* `Bytes`
+* `Ordinal`
+
 ## Adding help files, syntax files, or colorschemes in your plugin
 
 You can use the `AddRuntimeFile(name string, type config.RTFiletype,
 ## Adding help files, syntax files, or colorschemes in your plugin
 
 You can use the `AddRuntimeFile(name string, type config.RTFiletype,
@@ -391,6 +406,9 @@ There are 6 default plugins that come pre-installed with micro. These are
    programming tool.
 * `status`: provides some extensions to the status line (integration with
    Git and more).
    programming tool.
 * `status`: provides some extensions to the status line (integration with
    Git and more).
+* `diff`: integrates the `diffgutter` option with Git. If you are in a Git
+   directory, the diff gutter will show changes with respect to the most
+   recent Git commit rather than the diff since opening the file.
 
 See `> help linter`, `> help comment`, and `> help status` for additional
 documentation specific to those plugins.
 
 See `> help linter`, `> help comment`, and `> help status` for additional
 documentation specific to those plugins.
@@ -403,7 +421,7 @@ your own plugins.
 Micro also has a built in plugin manager which you can invoke with the
 `> plugin ...` command, or in the shell with `micro -plugin ...`.
 
 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.
+For the valid commands you can use, see the `commands` 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
 
 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