Repository: sxyazi/yazi (language: rust)

Issue:
F1 should open the help page
### Please describe the problem you're trying to solve

https://github.com/sxyazi/yazi/issues/736

### Would you be willing to contribute this feature?

- [ ] Yes, I'll give it a shot

### Describe the solution you'd like

F1 is the standard "Help" key, it should open a help page or some documentation menu

### Additional context

See also how ranger does it


Discussion / hints:
Hi, Yazi uses `~` instead of `F1` to open help because it's more universal. Some keyboards don't have function keys or require pressing them along with the `Fn` key, so I wanted to avoid using function keys as much as possible.

Closing as not in the plan.
What a strange decision.

- F1 is a standard key on PC keyboards, meaning, all PC software ought to assume it is a key that a user might press.
- Even if there are "minimal" keyboards which do not have some standard keys, Yazi could still recognize it as an alternative to ~.
- F1 is also the standard help key in a lot of software out there, that many people use every day.
- I don't know of any other program that uses ~ for a help key.
- Having the help key on a key that a user will never think of pressing defeats the point. As it stands, this feature is completely undiscoverable.
- If I have to look up an external resource just to discover what key to press to get help, you might as well just put all help text somewhere on the Internet too.

Well, it's your project.
What do you think about, any time the user presses an unbound key, showing a message such as "Press ~ for help"? This should make the keybind discoverable without explicitly binding it to a function key.
Ah I must've misunderstood you - I'm ok with adding a new `F1` as an alternative to `~`, as long as it's not replacing it. Do you want to raise a PR for it?

Fix patch:
diff --git a/yazi-config/preset/keymap.toml b/yazi-config/preset/keymap.toml
index 31d09d5df..9e3163ffc 100644
--- a/yazi-config/preset/keymap.toml
+++ b/yazi-config/preset/keymap.toml
@@ -151,7 +151,8 @@ keymap = [
 	{ on = [ "g", "<Space>" ], run = "cd --interactive", desc = "Go to a directory interactively" },
 
 	# Help
-	{ on = "~", run = "help", desc = "Open help" },
+	{ on = "~",    run = "help", desc = "Open help" },
+	{ on = "<F1>", run = "help", desc = "Open help" },
 ]
 
 [tasks]
@@ -171,7 +172,9 @@ keymap = [
 	{ on = "<Enter>", run = "inspect", desc = "Inspect the task" },
 	{ on = "x",       run = "cancel",  desc = "Cancel the task" },
 
-	{ on = "~", run = "help", desc = "Open help" }
+	# Help
+	{ on = "~",    run = "help", desc = "Open help" },
+	{ on = "<F1>", run = "help", desc = "Open help" },
 ]
 
 [select]
@@ -194,7 +197,9 @@ keymap = [
 	{ on = "<S-Up>",   run = "arrow -5", desc = "Move cursor up 5 lines" },
 	{ on = "<S-Down>", run = "arrow 5",  desc = "Move cursor down 5 lines" },
 
-	{ on = "~", run = "help", desc = "Open help" }
+	# Help
+	{ on = "~",    run = "help", desc = "Open help" },
+	{ on = "<F1>", run = "help", desc = "Open help" },
 ]
 
 [input]
@@ -263,7 +268,8 @@ keymap = [
 	{ on = "<C-r>", run = "redo", desc = "Redo the last operation" },
 
 	# Help
-	{ on = "~", run = "help", desc = "Open help" }
+	{ on = "~",    run = "help", desc = "Open help" },
+	{ on = "<F1>", run = "help", desc = "Open help" },
 ]
 
 [completion]
@@ -282,7 +288,9 @@ keymap = [
 	{ on = "<C-p>", run = "arrow -1", desc = "Move cursor up" },
 	{ on = "<C-n>", run = "arrow 1",  desc = "Move cursor down" },
 
-	{ on = "~", run = "help", desc = "Open help" }
+	# Help
+	{ on = "~",    run = "help", desc = "Open help" },
+	{ on = "<F1>", run = "help", desc = "Open help" },
 ]
 
 [help]


Test patch: