Ⅰ. 插件描述
Another github v3 api implemented in vim scriptⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'wsdjeg/github-api-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'wsdjeg/github-api-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'wsdjeg/github-api-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/wsdjeg/github-api.vim
Ⅳ. 文档说明
# GitHub.vim
Another github v3 api implemented in viml
Intro
This is a viml library to access the Github API v3. With it, you can manage
Github resources (repositories, user profiles, organizations, etc.) from viml
scripts.
It is WIP, it will covers the full API.
If you have any question, any remark, or if you find a bug, or if there is
something you can do with the API but not with Github-api.vim, please open an issue.
Install
It is easy to install the lib via dein:
call dein#add('wsdjeg/GitHub.vim')NOTE: For unauthenticated requests, the rate limit allows for up to 60 requests per hour. Unauthenticated requests are associated with the originating IP address, and not the user making requests.Increasing the unauthenticated rate limit, you need Create OAuth app, and set EVN: CLIENTID and CLIENTSECRET.
Usage
create issue:
function! CreateIssue(owner, repo) abort
let username = input('your github username:')
let password = input('your github password:')
let title = input('Issue title: ')
let issue = {
\ 'title': title,
\ 'body': s:body(),
\ }
let response = github#api#issues#Create(a:owner, a:repo,
\ username, password, issue)
if !empty(response)
echomsg 'Create successed! ' . response.url
else
echom 'Create failed!'
endif
endfunction
func! s:body()
return 'Testting Github.vim...'
endf