Skip to content

Commit

Permalink
add hotkeys to respective conf files
Browse files Browse the repository at this point in the history
  • Loading branch information
wassup05 committed Nov 30, 2024
1 parent 9d55b15 commit a14d091
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/internal/config_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ type HotkeysType struct {
// movement
ListUp []string `toml:"list_up" comment:"movement"`
ListDown []string `toml:"list_down"`
PageUp []string `toml:"page_up"`
PageDown []string `toml:"page_down"`

CloseFilePanel []string `toml:"close_file_panel" comment:"file panel control"`
CreateNewFilePanel []string `toml:"create_new_file_panel"`
Expand Down
4 changes: 2 additions & 2 deletions src/internal/key_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ func (m *model) mainKey(msg string, cmd tea.Cmd) ( tea.Cmd) {
}()
}

case tea.KeyPgUp.String():
case containsKey(msg, hotkeys.PageUp):
m.controlFilePanelPgUp()

case tea.KeyPgDown.String():
case containsKey(msg, hotkeys.PageDown):
m.controlFilePanelPgDown()

case containsKey(msg, hotkeys.ChangePanelMode):
Expand Down
2 changes: 2 additions & 0 deletions src/superfile_config/hotkeys.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ quit = ['q', 'esc']
# movement
list_up = ['up', 'k']
list_down = ['down', 'j']
page_up = ['pgup','']
page_down = ['pgdown','']
# file panel control
create_new_file_panel = ['n', '']
close_file_panel = ['w', '']
Expand Down
4 changes: 3 additions & 1 deletion src/superfile_config/vimHotkeys.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ quit = ['ctrl+c', ''] # also know as, theprimeagen troller
# movement
list_up = ['k', '']
list_down = ['j', '']
page_up = ['pgup','']
page_down = ['pgdown','']
# file panel control
create_new_file_panel = ['n', '']
close_file_panel = ['q', '']
Expand Down Expand Up @@ -53,4 +55,4 @@ search_bar = ['/', '']
# Select mode hotkeys (can conflict with other modes, cannot conflict with global hotkeys)
file_panel_select_mode_items_select_down = ['J', '']
file_panel_select_mode_items_select_up = ['K', '']
file_panel_select_all_items = ['A', '']
file_panel_select_all_items = ['A', '']

0 comments on commit a14d091

Please sign in to comment.