mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 04:00:03 +08:00
.. | ||
autoload | ||
doc | ||
plugin | ||
test | ||
_config.yml | ||
.gitignore | ||
.travis.yml | ||
.vintrc.yaml | ||
addon-info.json | ||
LICENSE | ||
Makefile | ||
README.md |
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.
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