main script which is run at startup which should be placed in
`~/.config/micro/plugins/pluginName/pluginName.lua`.
-If you want to add a help page for your plugin, place a markdown file in `~/.config/micro/plugins/pluginName/help.md`.
-
There are a number of callback functions which you can create in your
plugin to run code at times other than startup. The naming scheme is
`onAction(view)`. For example a function which is run every time the user saves
* `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
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`