https://github.com/knsh14/vim-github-link
generate github link from selected lines in vim
https://github.com/knsh14/vim-github-link
git github vim vim-plugin
Last synced: 7 months ago
JSON representation
generate github link from selected lines in vim
- Host: GitHub
- URL: https://github.com/knsh14/vim-github-link
- Owner: knsh14
- License: mit
- Created: 2019-04-28T15:00:14.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-11-01T05:18:22.000Z (about 1 year ago)
- Last Synced: 2025-03-31T15:18:56.152Z (8 months ago)
- Topics: git, github, vim, vim-plugin
- Language: Vim Script
- Size: 25.4 KB
- Stars: 64
- Watchers: 1
- Forks: 15
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
vim-github-link
---
Copy github/gitlab link for current line(s) to clipboard.
Links have the format:
- GitHub - `https://GITHUB_REMOTE_DOMAIN/OWNER/REPO/blob/$REF/PATH/TO/FILE#L1-L10`.
- GitLab - `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 name
- `GetCurrentCommitLink`: most recent commit - URL will 404 if you haven't pushed it to the remote
# Usage
In normal mode
```
:1,3GetCurrentBranchLink
```
then link is copied to your clipboard.
In visual mode, same command after selected.
# Install
## dein.vim
add below line into .vimrc
```
call dein#add('knsh14/vim-github-link')
```
or add to toml file
```
[[plugins]]
repo = 'knsh14/vim-github-link'
```
## vim-plug
```
Plug 'knsh14/vim-github-link'
```