add return alt1

This commit is contained in:
wakaka6 2022-12-11 14:18:29 +08:00
parent d69b2fef9a
commit 6386a03805
3 changed files with 8 additions and 0 deletions

View file

@ -113,6 +113,7 @@ keybinding:
quit: 'q'
quit-alt1: '<c-c>' # alternative/alias of quit
return: '<esc>' # return to previous menu, will quit if there's nowhere to return
return-alt1: ';' # Can be set as a single character key to return to the previous menu level
quitWithoutChangingDirectory: 'Q'
togglePanel: '<tab>' # goto the next panel
prevItem: '<up>' # go one line up

View file

@ -136,6 +136,7 @@ type KeybindingUniversalConfig struct {
Quit string `yaml:"quit"`
QuitAlt1 string `yaml:"quit-alt1"`
Return string `yaml:"return"`
ReturnAlt1 string `yaml:"return-alt1"`
QuitWithoutChangingDirectory string `yaml:"quitWithoutChangingDirectory"`
TogglePanel string `yaml:"togglePanel"`
PrevItem string `yaml:"prevItem"`

View file

@ -74,6 +74,12 @@ func (self *Gui) GetInitialKeybindings() ([]*types.Binding, []*gocui.ViewMouseBi
Modifier: gocui.ModNone,
Handler: self.handleTopLevelReturn,
},
{
ViewName: "",
Key: opts.GetKey(opts.Config.Universal.ReturnAlt1),
Modifier: gocui.ModNone,
Handler: self.handleTopLevelReturn,
},
{
ViewName: "",
Key: opts.GetKey(opts.Config.Universal.OpenRecentRepos),