Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hints (the non-font kind) #815

Open
raphamorim opened this issue Nov 24, 2024 Discussed in #813 · 0 comments
Open

Hints (the non-font kind) #815

raphamorim opened this issue Nov 24, 2024 Discussed in #813 · 0 comments

Comments

@raphamorim
Copy link
Owner

Discussed in #813

Originally posted by xxxserxxx November 24, 2024
rio has support for opening hyperlinks via the mouse. I'd like this function to be available without having to use the mouse.

This feature exists in Alacritty "hints." When a hot-key is pressed, the terminal searches in the viewable frame for URLs and enters a hints mode, where the matches are highlighted each with a key sequence. The user can then type a sequence to select one of the matches to trigger an action on the match. Hint mode is common in keyboard-diven applications: in addition to Alacritty, Kitty, surf, luakit, and vimb (the latter three keyboard-driven web browsers) all have hint modes that function similarly. It'd be a valuable addition to Rio.

The Hints section in the documentation for Alacritty describes this. As in Alacritty, this feature would allow configurable hint characters, configurable regexp, and configurable command. It'd be nice if a different hotkey could be bound to different regexps and commands; hhis would allow the user to configure matching URLs, email addresses, filesystem paths, or whatever, with custom actions for each type. However, commonly in programs providing hints only a single pattern/command can be configured.

Following the Rio configuration pattern, I would imagine a new function called Hints similar to SearchForward that could be bound to a key. This would use a [hints] configuration section, with hints.alphabet, hints.regexp, and hints.command attributes. When invoked, the command would: perform the buffer search (in the visible view); highlight the matches and assign a unique key sequence built from the hints.alphabet characters to each; and enter an input mode where keystrokes incrementally matching hints.alphabet when uniquely matching a sequence triggers the hints.command with the match as the argument. The global user-defined escape key would exit hints mode. Users would bind this by configuring one (or more) binding.keys with Hints as the action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant