GitHub-userscripts
GitHub-userscripts copied to clipboard
Page Increment and Decrement Hotkey
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!
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}" }
]
}
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!