Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kristijanhusak/vim-create-pr
Open link to create PR directly from (neo)vim
https://github.com/kristijanhusak/vim-create-pr
bitbucket git github gitlab neovim plugin vim viml
Last synced: 22 days ago
JSON representation
Open link to create PR directly from (neo)vim
- Host: GitHub
- URL: https://github.com/kristijanhusak/vim-create-pr
- Owner: kristijanhusak
- License: mit
- Created: 2019-06-08T22:01:54.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-06-11T11:52:32.000Z (over 2 years ago)
- Last Synced: 2024-10-08T10:42:04.002Z (about 1 month ago)
- Topics: bitbucket, git, github, gitlab, neovim, plugin, vim, viml
- Language: Vim script
- Size: 6.84 KB
- Stars: 4
- Watchers: 4
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vim-create-pr
Open link to new pull request with provided/current branch directly from (neo)vim.
Works with `Github`, `Bitbucket` and `Gitlab` out of the box. Can be [extended](#customization).
## Installation
Using [vim-packager](https://github.com/kristijanhusak/vim-packager)
```vimL
function! PackagerInit() abort
packadd vim-packager
call packager#init()
call packager#add('kristijanhusak/vim-packager', { 'type': 'opt' })
call packager#add('kristijanhusak/vim-create-pr')"Optional packages, but highly recommended
call packager#add('sodapopcan/vim-twiggy')
call packager#add('tpope/vim-fugitive')
endfunction
```## Usage
Through command line (Can be autocompleted):
```
:PR branchname
```Or if you want to use current branch, just omit the branch name
```
:PR
```If you are using [vim-twiggy](https://github.com/sodapopcan/vim-twiggy),
select a branch from list and press `pr`.If you want to open only repository page in browser, run this:
```
:RepoPage
```## Customization
### Additional git services
To add your custom git service to the list, add `g:create_pr_git_services`
variable to your vimrc, using example below:```vimL
let g:create_pr_git_services = {
\ 'my.gitlab.com': 'https://my.gitlab.com/{{owner}}/{{repository}}/merge_requests/new?merge_request[source_branch]={{branch_name}}'
\ }
```Make sure key name (`my.gitlab.com` in example above) is part of the string returned from this command:
```
git config --get remote.origin.url
```### Custom browser
Default browser is used by default, when available (`xdg-open`, `open` on mac).
To use custom browser, add `g:create_pr_browser` to your vimrc with executable name.Example:
```vimL
let g:create_pr_browser = 'firefox'
```