Easily open remote repository links from your local buffer files
- Add support for GitLab and Bitbucket
- Add flag to specify if url should open with blame
- Add function to open url of commit history of a given file
- Add function top open url of all PR's for a given file
- Add ability to open url of dependency files e.g. a
node_modules
file (not tracked in git)
I'm not a lua developer, so feel free to open a PR to improve / extend the plugin code 😅. See the Development section for further info.
Requirements: Neovim >= 0.5.
For vim-plug:
Plug 'jltwheeler/nvim-git-link'
For packer:
use 'jltwheeler/nvim-git-link'
:lua require"nvim-git-link".get_remote_link()
This is equivalent to
:lua require"nvim-git-link".get_remote_link{ open_browser = true }
You can also copy the URL to the clipboard, on top of opening the browser, with:
:lua require"nvim-git-link".get_remote_link{ open_browser = true, copy = true }
and to avoid opening the browser at all:
:lua require"nvim-git-link".get_remote_link{ copy = true }
If you are keen to contribute to the plugin, please follow these steps to get setup locally:
cd ~
to your desired root project directorymkdir -r lua-plugins/lua
cd lua-plugins/lua
git clone git@github.com:jltwheeler/nvim-git-link.git
- To test this, go to any other project directory and open vim with the following command:
vim --cmd "set rtp+=./path/to/lua-plugin/"
This will load the nvim-git-link
plugin into the nvim run time path, and
load the locally cloned plugin.
6. Start adding your code and testing in the other vim session.
NB: every time you save new code to the plugin, you will need to re-load
nvim
with the command in step 5.