open-browser-github.vim


Ⅰ. 插件描述

Open GitHub URL of current file, etc. from Vim editor (supported GitHub Enterprise)

Ⅱ. 基本信息

创建日期:  2013-01-19
使用用户:  66
Github星:  91
插件作者:  Fujiwara Takuya

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# open-browser-github.vim

About

Opens GitHub URL of current file, etc. from Vim.
Also supports GitHub Enterprise.

Install

This plugin requires:

Usage

There are 4 commands.

:OpenGithubFile

Opens a specific file in github.com repository(it also opens in the current branch by default).

" Opens current files URL in github.com
:OpenGithubFile
" Opens current files highlighted place in github.com 
:'<,'>OpenGithubFile
" Opens a specific file in github.com
:OpenGithubFile PATH/TO/FILE

:OpenGithubIssue

Opens a specific Issue.

" Opens current repositories Issue #1
:OpenGithubIssue 1
" Opens a specific repositories Issue #1
:OpenGithubIssue 1 tyru/open-browser.vim
" Opens current repositories Issue List
:OpenGithubIssue
" Opens a specific repositories Issue list
:OpenGithubIssue tyru/open-browser.vim

:OpenGithubPullReq

This command opens /pulls page when it has no argument. Otherwise, it does entirely the same thing as :OpenGithubIssue since GitHub redirects /issues/1 to /pull/1 if #1 is a Pull Request.

:OpenGithubProject

Opens a project page.

" Opens current opening file's repository.
" ex) https://{hostname}/{user}/{name}
:OpenGithubProject

" Opens current opening file's repository.
" ex) https://{hostname}/tyru/open-browser.vim
:OpenGithubProject tyru/open-browser.vim

GitHub Enterprise setting

If you have hub command

If you have hub command in your PATH,
openbrowser-github executes the following command:

hub browse -u -- {path}

And it will open the returned (output) URL.

If you don't have hub command

If you don't have hub command in your PATH, openbrowser-github tries to
get each part of URL from the following gitconfig key:

  • hub.host

You can specify GitHub Enterprise repository URL by setting above keys in
gitconfig.

For example, you can set hub.host by executing the following command in your
git repository which you want to specify GitHub Enterprise repository URL.

git config --local hub.host my.git.org

添加新评论