Skip to content

Generates git permalink, no need to manually adjust line numbers before sharing!

Notifications You must be signed in to change notification settings

badeggg/git-link.vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

Generates git permalink, no need to manually adjust line numbers before sharing!

Commands

  • :Link
    • Generate perm link of current line, if you are not visually selecting any line.
    • Generate perm link of selected lines, if you are visually selecting few lines.
  • :LinkFile
    • Generate perm link of current file, no line is specified.

Use which commit hash

This vim plugin will try to find a recent remote commit to use:

Edge cases

There are few edge cases when translate current line number to remote commit line number.

  • Start line of your selection is inside a block of new code(hunk), start line is translated to the start of old code of the hunk.
  • End line of your selection is inside a block of new code(hunk), end line is translated to the end of old code of the hunk.
  • Your selecting lines are all new lines, the line just at the top of the selection are used, if the line just at the top is line 0, line 1 is used.
  • Current file is a new file, you will be prompted a message and no content will be sent to clipboard

About

Generates git permalink, no need to manually adjust line numbers before sharing!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published