Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tyru/open-browser-github.vim
Open GitHub URL of current file, etc. from Vim editor (supported GitHub Enterprise)
https://github.com/tyru/open-browser-github.vim
browser github vim
Last synced: about 1 month ago
JSON representation
Open GitHub URL of current file, etc. from Vim editor (supported GitHub Enterprise)
- Host: GitHub
- URL: https://github.com/tyru/open-browser-github.vim
- Owner: tyru
- License: bsd-3-clause
- Created: 2013-01-19T20:49:19.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2022-12-02T14:08:17.000Z (almost 2 years ago)
- Last Synced: 2024-06-18T13:49:39.627Z (3 months ago)
- Topics: browser, github, vim
- Language: Vim script
- Size: 131 KB
- Stars: 173
- Watchers: 3
- Forks: 14
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# open-browser-github.vim
## About
Opens GitHub URL of current file, etc. from Vim.
Also supports GitHub Enterprise.## Install
This plugin requires:
* [open-browser.vim](https://github.com/tyru/open-browser.vim)
* `git` command in your PATH## Usage
There are 4 commands.
### `:OpenGithubFile`
Opens a specific file in github.com repository(it also opens in the current branch by default).
```vimL
" 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.
```vimL
" 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.
```vimL
" 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](https://github.com/github/hub) 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
```