Ⅰ. 插件描述
An extension to fugitive.vim for gitlab supportⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'shumphrey/fugitive-gitlab-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'shumphrey/fugitive-gitlab-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'shumphrey/fugitive-gitlab-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/shumphrey/fugitive-gitlab.vim
Ⅳ. 文档说明
# fugitive-gitlab.vim
[fugitive.vim][] is undoubtedly the best Git wrapper of all time.
This plugin allows you to use it with https://gitlab.com or your own
private gitlab instance.
- Enables
:Gbrowsefrom fugitive.vim to open GitLab URLs - In commit messages, GitLab issues can be omni-completed
(<C-X><C-O>, see:help compl-omni).
Installation
Install it as you would install [fugitive.vim][]
(you will also need [fugitive.vim][] installed)
To use private gitlab repositories add the following to your .vimrc
let g:fugitive_gitlab_domains = ['https://my.gitlab.com']
fugitive command :Gbrowse will now work with gitlab URLs.
Curl is required for features
that use the GitLab API (i.e., :Gbrowse doesn't need it).
Generate a personal access token
with api permissions and add it to your vimrc
let g:gitlab_api_keys = {'gitlab.com': 'myaccesstoken'}
To use omnicompletion with a private gitlab repository
let g:gitlab_api_keys = {'gitlab.com': 'mytoken1', 'my.gitlab.private': 'mytoken2' }
Omnicompletion functionality is subject to change.
Requirements
fugitive-gitlab.vim requires a modern [fugitive.vim][].
API features require a gitlab instance with v4 of the API.
FAQ
How do I turn off that preview window that shows the issue body?
set completeopt-=preview
Why doesn't this plugin have a pun name?
I couldn't think of one.
License
Copyright (c) Steven Humphrey. Distributed under the same terms as Vim itself.
See :help license.