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

Page Increment and Decrement Hotkey #138

Open
evanricard opened this issue Feb 22, 2021 · 2 comments
Open

Page Increment and Decrement Hotkey #138

evanricard opened this issue Feb 22, 2021 · 2 comments

Comments

@evanricard
Copy link

Hey @Mottie, can you explain what {page-1} and {page+1} could, should, and would be used for in your custom hotkeys script? I can see this being useful if a person isn't using vim-emulation already to go to "next" and "previous" links like I am doing myself already but am I missing something intrinsic in navigation on Github? I don't particularly use every section of Github but I'm wondering if I could use the page-1 or page+1 to go between files either with file finder or just by way of navigating the repo tree.

Thanks!

@Mottie
Copy link
Owner

Mottie commented Feb 23, 2021

Hi @evanricard!

My initial intension was to allow assigning a hotkey to navigate through issues or paginated results (see the custom hotkey docs).

I discovered that GitHub's hotkey library now uses Key Values, so the wiki docs for the custom hotkey userscript need to be updated - g right should be g ArrowRight and g left should be g ArrowLeft.

I think the userscript needs to be updated as well since the arrow navigation for {repo}/pull doesn't seem to work as expected

{
  "all": [
    { "f1": "#hotkey-settings" },
    { "g g": "{repo}/graphs/code-frequency" },
    { "g p": "{repo}/pulse" },
    { "g u": [ "{user}", true ] },
    { "g s": "{upstream}" },
    { "c m": "{repo}/compare/{branch}...master" },
    { "c m": "{repo}/compare/{commit}...master" }
  ],
  "{repo}/issues": [
    { "g ArrowRight": "{issue+1}" },
    { "g ArrowLeft": "{issue-1}" }
  ],
  "{repo}/pull": [
    { "g ArrowRight": "{issue+1}" },
    { "g ArrowLeft": "{issue-1}" }
  ],
  "{root}/search": [
    { "g ArrowRight": "{page+1}" },
    { "g ArrowLeft": "{page-1}" }
  ]
}

@evanricard
Copy link
Author

Good morning @Mottie thanks for getting back to me! I figured the docs need updating but I wasn't going to fret over that for ya I just wanted to be sure I was attempting the increment and decrement operations in an intended way or if maybe you had a special use case for. I do like the idea of navigating through issues and maybe I will try to use it to go through a discussions section if I find one. Thanks!

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

No branches or pull requests

2 participants