Code Monkey home page Code Monkey logo

nvim-git-link's Introduction

nvim-git-link

Easily open remote repository links from your local buffer files

Roadmap

  • 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)

Disclaimer

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.

Installation

Requirements: Neovim >= 0.5.

For vim-plug:

Plug 'jltwheeler/nvim-git-link'

For packer:

use 'jltwheeler/nvim-git-link'

Usage

Get link to remote repo at current cursor line

: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 }

Development

If you are keen to contribute to the plugin, please follow these steps to get setup locally:

  1. cd ~ to your desired root project directory
  2. mkdir -r lua-plugins/lua
  3. cd lua-plugins/lua
  4. git clone [email protected]:jltwheeler/nvim-git-link.git
  5. 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.

nvim-git-link's People

Contributors

jltwheeler avatar cljoly avatar frdwhite24 avatar andeskrrrrrrrrrrr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.