Skip to content

How to copy user/repo out of a GitHub URL? #1071

Closed Answered by gdh1995
limaceous-bushwhacker asked this question in Q&A
Discussion options

You must be logged in to vote

You may use env in key mappings:

env github host="https://github.com/"
run ya blank expect="github:copyCurrentUrl#sed=1"

And add such a text substitution rule:

1@^https://github.com/([^/]+/[^/]+)@$1@,matched

Then ya will do nothing on other sites.

Please note that ya will always be hooked by Vimium C, and there's no way to exclude a multi-key key binding on some websites.

If you assign a single key to this mapping, then you may use Exclusion rules to make most websites ignore a key, like

See https://github.com/gdh1995/vimium-c/wiki/Map-a-key-to-different-commands-on-different-websites

Replies: 3 comments 10 replies

Comment options

You must be logged in to vote
8 replies
@gdh1995
Comment options

@limaceous-bushwhacker
Comment options

@gdh1995
Comment options

@limaceous-bushwhacker
Comment options

@gdh1995
Comment options

Comment options

You must be logged in to vote
1 reply
@gdh1995
Comment options

Comment options

You must be logged in to vote
1 reply
@limaceous-bushwhacker
Comment options

Answer selected by limaceous-bushwhacker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants