GithubHelp home page GithubHelp logo

dgronskij / gitlink-vim Goto Github PK

View Code? Open in Web Editor NEW

This project forked from iautom8things/gitlink-vim

0.0 0.0 0.0 338 KB

Generate a link to the exact commit, file and line.

License: MIT License

Vim Script 100.00%

gitlink-vim's Introduction

gitlink-vim

Generate a link to the exact commit, file and line.

When collaborating with your team, you may often want to reference a line of code. Copy-and-pasting the line just doesn't work when context matters, plus you know the formating isn't going to be right, anyways!

Example

screenshot

screenshot

screenshot

Known Issues

As written, it only works for Github and Gitlab. Bitbucket is not supported.

Installation

Using Vundle

Add the following line to your .vimrc file.

Bundle 'https://github.com/mazubieta/gitlink-vim.git'

Optional

You can add the following lines to your .vimrc file.

  • If you want to execute via command:

    command GitLink :echo gitlink#GitLink()
    
  • If you want to execute via leader command:

    nmap <leader>gl :echo gitlink#GitLink()<CR>
    vmap <leader>gl :echo gitlink#GitLink(1)<CR>
    
  • If you want to copy to the clipboard automatically:

    function! CopyGitLink(...) range
      redir @+
      silent echo gitlink#GitLink(get(a:, 1, 0))
      redir END
    endfunction
    nmap <leader>gl :call CopyGitLink()<CR>
    vmap <leader>gl :call CopyGitLink(1)<CR>
    

Usage

  • If you just autoload the script

    :echo gitlink#GitLink()
    
  • If you added the optional .vimrc lines

    :GitLink
    

    Or...

    \gl
    

gitlink-vim's People

Contributors

mazubieta avatar fmoralesc avatar dubistkomisch 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.