+func DefaultCommands() map[string]StrCommand {
+ return map[string]StrCommand{
+ "set": StrCommand{"Set", []Completion{OptionCompletion, NoCompletion}},
+ "bind": StrCommand{"Bind", []Completion{NoCompletion}},
+ "run": StrCommand{"Run", []Completion{NoCompletion}},
+ "quit": StrCommand{"Quit", []Completion{NoCompletion}},
+ "save": StrCommand{"Save", []Completion{NoCompletion}},
+ "replace": StrCommand{"Replace", []Completion{NoCompletion}},
+ "vsplit": StrCommand{"VSplit", []Completion{FileCompletion, NoCompletion}},
+ "hsplit": StrCommand{"HSplit", []Completion{FileCompletion, NoCompletion}},
+ "tab": StrCommand{"Tab", []Completion{FileCompletion, NoCompletion}},
+ "help": StrCommand{"Help", []Completion{HelpCompletion, NoCompletion}},
+ }
+}
+
+// Help tries to open the given help page in a horizontal split
+func Help(args []string) {
+ if len(args) < 1 {
+ // Open the default help if the user just typed "> help"
+ CurView().openHelp("help")
+ } else {
+ helpPage := args[0]
+ if _, ok := helpPages[helpPage]; ok {
+ CurView().openHelp(helpPage)
+ } else {
+ messenger.Error("Sorry, no help for ", helpPage)
+ }