Add support for user-created commands

Plugins can now create their own commands using the `MakeCommand`
function. Plugins can also now create their own keybindings with the
`BindKey` function. See the go plugin for an example of `MakeCommand`.
This commit is contained in:
Zachary Yedidia
2016-05-30 13:38:50 -04:00
parent 68189fd406
commit 7adcb13c08
8 changed files with 439 additions and 350 deletions

View File

@@ -203,6 +203,7 @@ func main() {
InitConfigDir()
// Load the user's settings
InitSettings()
InitCommands()
InitBindings()
// Load the syntax files, including the colorscheme
LoadSyntaxFiles()
@@ -237,6 +238,8 @@ func main() {
L.SetGlobal("messenger", luar.New(L, messenger))
L.SetGlobal("GetOption", luar.New(L, GetOption))
L.SetGlobal("AddOption", luar.New(L, AddOption))
L.SetGlobal("BindKey", luar.New(L, BindKey))
L.SetGlobal("MakeCommand", luar.New(L, MakeCommand))
LoadPlugins()