]> git.lizzy.rs Git - micro.git/blobdiff - runtime/help/plugins.md
Add new plugin runtime function
[micro.git] / runtime / help / plugins.md
index 7feb3c5b687263a753c69261f0c4464621a5f59b..555ef1803ae05c242f39ca3a246b3cf006ff83e4 100644 (file)
@@ -43,12 +43,20 @@ for functions are given using Go's type system):
 * `OS`: variable which gives the OS micro is currently running on (this is the same
 as Go's GOOS variable, so `darwin`, `windows`, `linux`, `freebsd`...)
 
+* `configDir`: contains the path to the micro configuration files
+
 * `tabs`: a list of all the tabs currently in use
 
 * `curTab`: the index of the current tabs in the tabs list
 
 * `messenger`: lets you send messages to the user or create prompts
 
+* `RuneStr(r rune) string`: returns a string containing the given rune
+
+* `Loc(x, y int) Loc`: returns a new `Loc` struct
+
+* `JoinPaths(dir... string) string` combines multiple directories to a full path
+
 * `GetOption(name string)`: returns the value of the requested option
 
 * `AddOption(name string, value interface{})`: sets the given option with the given
@@ -119,6 +127,9 @@ called `test`, you would create the `test.md` file for example, and runt the fun
 AddRuntimeFile("test", "help", "test.md")
 ```
 
+Use `AddRuntimeFilesFromDirectory(name, type, dir, pattern)` to add a number of files
+to the runtime.
+
 # Autocomplete command arguments
 
 See this example to learn how to use `MakeCompletion` and `MakeCommand`