X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=runtime%2Fhelp%2Fplugins.md;h=1818b96bddd4d11f677f4b4439c6556f2d214830;hb=54c23cae72d7237bc898a59f79aad0acffdf0ffe;hp=3e651c0151096c15317ff4d7fecb269e27b28678;hpb=60846f549ccd02598dea5889992f1e4cddc8e86d;p=micro.git diff --git a/runtime/help/plugins.md b/runtime/help/plugins.md index 3e651c01..1818b96b 100644 --- a/runtime/help/plugins.md +++ b/runtime/help/plugins.md @@ -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. + 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. @@ -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. + - `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 @@ -352,6 +359,8 @@ strings regexp errors time +archive/zip +net/http ``` For documentation for each of these functions, see the Go standard @@ -364,8 +373,6 @@ The following functions are also available from the go-humanize package: The `humanize` package exposes: * `Bytes` * `Ordinal` -* `Ftoa` -* `FtoaWithDigits` ## Adding help files, syntax files, or colorschemes in your plugin @@ -414,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 ...`. -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