]> git.lizzy.rs Git - micro.git/blobdiff - runtime/help/plugins.md
Merge pull request #384 from boombuler/logview
[micro.git] / runtime / help / plugins.md
index e4142b179eb0105eb023224a600393fc7d02fad7..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
@@ -109,6 +117,19 @@ The possible methods which you can call using the `messenger` variable are:
 
 If you want a standard prompt, just use `messenger.Prompt(prompt, "", 0)`
 
+# Adding help files, syntax files, or colorschemes in your plugin
+
+You can use the `AddRuntimeFile(name, type, path string)` function to add various kinds of
+files to your plugin. For example, if you'd like to add a help topic and to your plugin
+called `test`, you would create the `test.md` file for example, and runt the function:
+
+```lua
+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`