add GoLeft and GoRight keybinds
@@ -8,6 +8,7 @@ import (
"sort"
"strings"
+ "github.com/c-bata/go-prompt"
goprompt "github.com/c-bata/go-prompt"
"github.com/c-bata/go-prompt/completer"
homedir "github.com/mitchellh/go-homedir"
@@ -476,8 +477,20 @@ func ExecutePrompt() {
goprompt.OptionSelectedDescriptionBGColor(goprompt.White),
goprompt.OptionScrollbarBGColor(goprompt.DarkGray),
goprompt.OptionScrollbarThumbColor(goprompt.Blue),
- goprompt.OptionAddASCIICodeBind(goprompt.ASCIICodeBind{
- ASCIICode: []byte{0x3f}, Fn: showCommandArguments}),
+ goprompt.OptionAddASCIICodeBind(
+ goprompt.ASCIICodeBind{
+ ASCIICode: []byte{0x3f},
+ Fn: showCommandArguments,
+ },
+ goprompt.ASCIICodeBind{
+ ASCIICode: []byte{0x1b, 0x62},
+ Fn: goprompt.GoLeftWord,
+ },
+ prompt.ASCIICodeBind{
+ ASCIICode: []byte{0x1b, 0x66},
+ Fn: goprompt.GoRightWord,
+ },
+ ),
goprompt.OptionCompletionWordSeparator(completer.FilePathCompletionSeparator),
goprompt.OptionCompletionOnDown(),
goprompt.OptionShowCompletionAtStart(),
