generate github link from selected lines in vim
Vim Script
67
42 commits
updated Aug 17, 2026
Copy github/gitlab link for current line(s) to clipboard.
Links have the format:
https://GITHUB_REMOTE_DOMAIN/OWNER/REPO/blob/$REF/PATH/TO/FILE#L1-L10.https://GITLAB_REMOTE_DOMAIN/OWNER/REPO/blob/$REF/PATH/TO/FILE#L1-10.The plugin defines the following functions which returns different $REF references:
GetCommitLink: commit which most recently modified the current file (permalink)GetCurrentBranchLink: active branch nameGetCurrentCommitLink: most recent commit - URL will 404 if you haven't pushed it to the remoteIn normal mode
:1,3GetCurrentBranchLink
then link is copied to your clipboard.
In visual mode, same command after selected.
add below line into .vimrc
call dein#add('knsh14/vim-github-link')
or add to toml file
[[plugins]]
repo = 'knsh14/vim-github-link'
Plug 'knsh14/vim-github-link'
Vim Script
100.0%
generate github link from selected lines in vim
Vim Script
67
42 commits
updated Aug 17, 2026
Copy github/gitlab link for current line(s) to clipboard.
Links have the format:
https://GITHUB_REMOTE_DOMAIN/OWNER/REPO/blob/$REF/PATH/TO/FILE#L1-L10.https://GITLAB_REMOTE_DOMAIN/OWNER/REPO/blob/$REF/PATH/TO/FILE#L1-10.The plugin defines the following functions which returns different $REF references:
GetCommitLink: commit which most recently modified the current file (permalink)GetCurrentBranchLink: active branch nameGetCurrentCommitLink: most recent commit - URL will 404 if you haven't pushed it to the remoteIn normal mode
:1,3GetCurrentBranchLink
then link is copied to your clipboard.
In visual mode, same command after selected.
add below line into .vimrc
call dein#add('knsh14/vim-github-link')
or add to toml file
[[plugins]]
repo = 'knsh14/vim-github-link'
Plug 'knsh14/vim-github-link'
Vim Script
100.0%