vim-github-url


Ⅰ. 插件描述

Vim plugin to show GitHub URLs in source files

Ⅱ. 基本信息

创建日期:  2018-02-01
使用用户:  4
Github星:  11
插件作者:  Paul Gross

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'pgr0ss/vim-github-url'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'pgr0ss/vim-github-url'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'pgr0ss/vim-github-url'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/pgr0ss/vim-github-url

Ⅳ. 文档说明

Vim plugin to show GitHub (and now GitLab) URLs in source files.

The generated URLs reference the current commit and not the current branch, so it will not be affected by later commits (e.g. you send someone the URL for a branch and by the time they click the link it's pointing to the wrong line in the file).

Usage

In Vim, run:

  • :GitHubURLRepo to view the repo on GitHub
  • :GitHubURLBlob to view the file under cursor on GitHub
  • :GitHubURLBlame to view the file under cursor in a git blame on GitHub

And it will use echomsg to print the URL to the screen, such as:

https://github.com/pgr0ss/vim-github-url/blob/b8607965090cbbfafcdfc9df25be8a975b330504/plugin/github-url.vim#L6-L6

You can also visually select several lines and the URL will include the range.

If you want to see previous URLs, you can use :messages.

The URL will also be stored to the clipboard if it is available.

Setup

Using vim-plug:

Plug 'pgr0ss/vim-github-url'

添加新评论