creates a command with `name` which will call `function` when executed.
Use 0 for completions to get NoCompletion.
+* `MakeCompletion(function string)`:
+ creates a `Completion` to use with `MakeCommand`.
+
* `CurView()`: returns the current view
* `HandleCommand(cmd string)`: runs the given command
If you want a standard prompt, just use `messenger.Prompt(prompt, "", 0)`
+# Autocomplete command arguments
+
+See this example to learn how to use `MakeCompletion` and `MakeCommand`
+
+```lua
+local function StartsWith(String,Start)
+ String = String:upper()
+ Start = Start:upper()
+ return string.sub(String,1,string.len(Start))==Start
+end
+
+function complete(input)
+ local allCompletions = {"Hello", "World", "Foo", "Bar"}
+ local result = {}
+
+ for i,v in pairs(allCompletions) do
+ if StartsWith(v, input) then
+ table.insert(result, v)
+ end
+ end
+ return result
+end
+
+function foo(arg)
+ messenger:Message(arg)
+end
+
+MakeCommand("foo", "example.foo", MakeCompletion("example.complete"))
+```
+
# Default plugins
For examples of plugins, see the default plugins `linter`, `go`, and `autoclose`.