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

Yank current page URI and/or currently highlighted URI #220

Closed
lostleonardo opened this issue Apr 10, 2021 · 2 comments
Closed

Yank current page URI and/or currently highlighted URI #220

lostleonardo opened this issue Apr 10, 2021 · 2 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@lostleonardo
Copy link
Contributor

The last time I proposed a UI change, it turned out that Amfora already did it. :-)

With that in mind, is it possible to yank the current URI and put it on the clipboard, without first going into edit mode and mousing over the selection (I would suggest 'yy')? Or, similarly, yank currently highlighted URI ('y')?

If you like the idea and can point me in the right direction, I could probably have a look at implementing this.

@makew0rld makew0rld added the enhancement New feature or request label Apr 11, 2021
@makew0rld
Copy link
Owner

This is not implemented right now. Happy to hear you're interested in adding it yourself.

Adding a new keybinding requires editing default-config.toml, config/keybindings.go, config/config.go, and display/help.go.

For yanking the current URI:

  • Adding a shortcut that requires timing, like "yy", will be hard if not impossible with the current setup. You should pick a different one.
  • To actually activate the keybinding, you'll want to add a case to this switch
  • Then in the case you can get the bottomBar text and put it into the clipboard with a cross-platform clipboard library. Ideally one that doesn't require CGo.

As for yanking the currently highlighted URI (good idea):

  • Create a func in display/tab.go that returns the currently selected URI, see these lines for how
  • Then add a case to the switch mentioned above that calls that func and uses the clipboard library

@makew0rld
Copy link
Owner

Added in #225

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants