Support home and end as alternatives to '<' and '>'

This commit is contained in:
Stefan Haller 2025-03-15 09:21:00 +01:00
parent 71c5fa9688
commit 95c5d51e64
15 changed files with 49 additions and 23 deletions

View file

@ -487,6 +487,8 @@ keybinding:
scrollRight: L
gotoTop: <
gotoBottom: '>'
gotoTop-alt: <home>
gotoBottom-alt: <end>
toggleRangeSelect: v
rangeSelectDown: <s-down>
rangeSelectUp: <s-up>

View file

@ -40,8 +40,8 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
|-----|--------|-------------|
| `` , `` | Previous page | |
| `` . `` | Next page | |
| `` < `` | Scroll to top | |
| `` > `` | Scroll to bottom | |
| `` < (<home>) `` | Scroll to top | |
| `` > (<end>) `` | Scroll to bottom | |
| `` v `` | Toggle range select | |
| `` <s-down> `` | Range select down | |
| `` <s-up> `` | Range select up | |

View file

@ -40,8 +40,8 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
|-----|--------|-------------|
| `` , `` | 前のページ | |
| `` . `` | 次のページ | |
| `` < `` | 最上部までスクロール | |
| `` > `` | 最下部までスクロール | |
| `` < (<home>) `` | 最上部までスクロール | |
| `` > (<end>) `` | 最下部までスクロール | |
| `` v `` | 範囲選択を切り替え | |
| `` <s-down> `` | Range select down | |
| `` <s-up> `` | Range select up | |

View file

@ -40,8 +40,8 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
|-----|--------|-------------|
| `` , `` | 이전 페이지 | |
| `` . `` | 다음 페이지 | |
| `` < `` | 맨 위로 스크롤 | |
| `` > `` | 맨 아래로 스크롤 | |
| `` < (<home>) `` | 맨 위로 스크롤 | |
| `` > (<end>) `` | 맨 아래로 스크롤 | |
| `` v `` | 드래그 선택 전환 | |
| `` <s-down> `` | Range select down | |
| `` <s-up> `` | Range select up | |

View file

@ -40,8 +40,8 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
|-----|--------|-------------|
| `` , `` | Vorige pagina | |
| `` . `` | Volgende pagina | |
| `` < `` | Scroll naar boven | |
| `` > `` | Scroll naar beneden | |
| `` < (<home>) `` | Scroll naar boven | |
| `` > (<end>) `` | Scroll naar beneden | |
| `` v `` | Toggle drag selecteer | |
| `` <s-down> `` | Range select down | |
| `` <s-up> `` | Range select up | |

View file

@ -40,8 +40,8 @@ _Legenda: `<c-b>` oznacza ctrl+b, `<a-b>` oznacza alt+b, `B` oznacza shift+b_
|-----|--------|-------------|
| `` , `` | Poprzednia strona | |
| `` . `` | Następna strona | |
| `` < `` | Przewiń do góry | |
| `` > `` | Przewiń do dołu | |
| `` < (<home>) `` | Przewiń do góry | |
| `` > (<end>) `` | Przewiń do dołu | |
| `` v `` | Przełącz zaznaczenie zakresu | |
| `` <s-down> `` | Zaznacz zakres w dół | |
| `` <s-up> `` | Zaznacz zakres w górę | |

View file

@ -40,8 +40,8 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
|-----|--------|-------------|
| `` , `` | Previous page | |
| `` . `` | Next page | |
| `` < `` | Scroll to top | |
| `` > `` | Scroll to bottom | |
| `` < (<home>) `` | Scroll to top | |
| `` > (<end>) `` | Scroll to bottom | |
| `` v `` | Toggle range select | |
| `` <s-down> `` | Range select down | |
| `` <s-up> `` | Range select up | |

View file

@ -40,8 +40,8 @@ _Связки клавиш_
|-----|--------|-------------|
| `` , `` | Предыдущая страница | |
| `` . `` | Следующая страница | |
| `` < `` | Пролистать наверх | |
| `` > `` | Прокрутить вниз | |
| `` < (<home>) `` | Пролистать наверх | |
| `` > (<end>) `` | Прокрутить вниз | |
| `` v `` | Переключить выборку перетаскивания | |
| `` <s-down> `` | Range select down | |
| `` <s-up> `` | Range select up | |

View file

@ -40,8 +40,8 @@ _图例`<c-b>` 意味着ctrl+b, `<a-b>意味着Alt+b, `B` 意味着shift+b_
|-----|--------|-------------|
| `` , `` | 上一页 | |
| `` . `` | 下一页 | |
| `` < `` | 滚动到顶部 | |
| `` > `` | 滚动到底部 | |
| `` < (<home>) `` | 滚动到顶部 | |
| `` > (<end>) `` | 滚动到底部 | |
| `` v `` | 切换拖动选择 | |
| `` <s-down> `` | 向下扩展选择范围 | |
| `` <s-up> `` | 向上扩展选择范围 | |

View file

@ -40,8 +40,8 @@ _說明`<c-b>` 表示 CtrlB、`<a-b>` 表示 AltB`B`表示 ShiftB
|-----|--------|-------------|
| `` , `` | 上一頁 | |
| `` . `` | 下一頁 | |
| `` < `` | 捲動到頂部 | |
| `` > `` | 捲動到底部 | |
| `` < (<home>) `` | 捲動到頂部 | |
| `` > (<end>) `` | 捲動到底部 | |
| `` v `` | 切換拖曳選擇 | |
| `` <s-down> `` | Range select down | |
| `` <s-up> `` | Range select up | |

View file

@ -379,6 +379,8 @@ type KeybindingUniversalConfig struct {
ScrollRight string `yaml:"scrollRight"`
GotoTop string `yaml:"gotoTop"`
GotoBottom string `yaml:"gotoBottom"`
GotoTopAlt string `yaml:"gotoTop-alt"`
GotoBottomAlt string `yaml:"gotoBottom-alt"`
ToggleRangeSelect string `yaml:"toggleRangeSelect"`
RangeSelectDown string `yaml:"rangeSelectDown"`
RangeSelectUp string `yaml:"rangeSelectUp"`
@ -841,6 +843,8 @@ func GetDefaultConfig() *UserConfig {
ScrollRight: "L",
GotoTop: "<",
GotoBottom: ">",
GotoTopAlt: "<home>",
GotoBottomAlt: "<end>",
ToggleRangeSelect: "v",
RangeSelectDown: "<s-down>",
RangeSelectUp: "<s-up>",

View file

@ -141,9 +141,9 @@ func (gui *Gui) getRandomTip() string {
formattedKey(config.Universal.NextPage),
),
fmt.Sprintf(
"You can jump to the top/bottom of a panel using '%s' and '%s'",
formattedKey(config.Universal.GotoTop),
formattedKey(config.Universal.GotoBottom),
"You can jump to the top/bottom of a panel using '%s (or %s)' and '%s (or %s)'",
formattedKey(config.Universal.GotoTop), formattedKey(config.Universal.GotoTopAlt),
formattedKey(config.Universal.GotoBottom), formattedKey(config.Universal.GotoBottomAlt),
),
fmt.Sprintf(
"To collapse/expand a directory, press '%s'",

View file

@ -197,10 +197,12 @@ func (self *ListController) GetKeybindings(opts types.KeybindingsOpts) []*types.
{Tag: "navigation", Key: opts.GetKey(opts.Config.Universal.NextItem), Handler: self.HandleNextLine},
{Tag: "navigation", Key: opts.GetKey(opts.Config.Universal.PrevPage), Handler: self.HandlePrevPage, Description: self.c.Tr.PrevPage},
{Tag: "navigation", Key: opts.GetKey(opts.Config.Universal.NextPage), Handler: self.HandleNextPage, Description: self.c.Tr.NextPage},
{Tag: "navigation", Key: opts.GetKey(opts.Config.Universal.GotoTop), Handler: self.HandleGotoTop, Description: self.c.Tr.GotoTop},
{Tag: "navigation", Key: opts.GetKey(opts.Config.Universal.GotoTop), Handler: self.HandleGotoTop, Description: self.c.Tr.GotoTop, Alternative: "<home>"},
{Tag: "navigation", Key: opts.GetKey(opts.Config.Universal.GotoBottom), Handler: self.HandleGotoBottom, Description: self.c.Tr.GotoBottom, Alternative: "<end>"},
{Tag: "navigation", Key: opts.GetKey(opts.Config.Universal.GotoTopAlt), Handler: self.HandleGotoTop},
{Tag: "navigation", Key: opts.GetKey(opts.Config.Universal.GotoBottomAlt), Handler: self.HandleGotoBottom},
{Tag: "navigation", Key: opts.GetKey(opts.Config.Universal.ScrollLeft), Handler: self.HandleScrollLeft},
{Tag: "navigation", Key: opts.GetKey(opts.Config.Universal.ScrollRight), Handler: self.HandleScrollRight},
{Tag: "navigation", Key: opts.GetKey(opts.Config.Universal.GotoBottom), Handler: self.HandleGotoBottom, Description: self.c.Tr.GotoBottom},
}
if self.context.RangeSelectEnabled() {

View file

@ -122,6 +122,16 @@ func (self *PatchExplorerController) GetKeybindings(opts types.KeybindingsOpts)
Description: self.c.Tr.GotoBottom,
Handler: self.withRenderAndFocus(self.HandleGotoBottom),
},
{
Tag: "navigation",
Key: opts.GetKey(opts.Config.Universal.GotoTopAlt),
Handler: self.withRenderAndFocus(self.HandleGotoTop),
},
{
Tag: "navigation",
Key: opts.GetKey(opts.Config.Universal.GotoBottomAlt),
Handler: self.withRenderAndFocus(self.HandleGotoBottom),
},
{
Tag: "navigation",
Key: opts.GetKey(opts.Config.Universal.ScrollLeft),

View file

@ -1161,6 +1161,14 @@
"type": "string",
"default": "\u003e"
},
"gotoTop-alt": {
"type": "string",
"default": "\u003chome\u003e"
},
"gotoBottom-alt": {
"type": "string",
"default": "\u003cend\u003e"
},
"toggleRangeSelect": {
"type": "string",
"default": "v"