1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 04:00:03 +08:00
SpaceVim/bundle/github.vim
2023-04-01 22:55:09 +08:00
..
autoload feat(github.vim): update issue_edit function 2023-03-31 22:10:19 +08:00
doc fix(githubapi): fix githubapi_token 2023-04-01 22:55:09 +08:00
plugin fix(githubapi): fix githubapi_token 2023-04-01 22:55:09 +08:00
test chore(github): use bundle github.vim 2022-04-28 21:46:05 +08:00
_config.yml chore(github): use bundle github.vim 2022-04-28 21:46:05 +08:00
.gitignore chore(github): use bundle github.vim 2022-04-28 21:46:05 +08:00
.travis.yml chore(github): use bundle github.vim 2022-04-28 21:46:05 +08:00
.vintrc.yaml chore(github): use bundle github.vim 2022-04-28 21:46:05 +08:00
addon-info.json chore(github): use bundle github.vim 2022-04-28 21:46:05 +08:00
LICENSE chore(github): use bundle github.vim 2022-04-28 21:46:05 +08:00
Makefile chore(github): use bundle github.vim 2022-04-28 21:46:05 +08:00
README.md docs(github): update readme of github.vim 2022-04-28 21:47:42 +08:00

GitHub.vim

Another github v3 api implemented in viml

Build Status codecov Gitter Version 0.1.2 Support Vim 7.4 or above MIT License Doc

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