Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ Then gist-vim will ask for your password in order to create an access
token. If you have two-factor authentication enabled, gist-vim will also
prompt you to enter the two-factor key you receive.

NOTE:
If you want you can set it directly to `g:github_user` and `g:gist_token`.

Whichever type of authentication you use, your GitHub password will not be
stored, only a OAuth access token produced specifically for gist-vim. The
token is stored in `~/.gist-vim`. If you stop using the plugin, you can
Expand Down
4 changes: 3 additions & 1 deletion autoload/gist.vim
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,9 @@ function! s:GistGetAuthHeader() abort
return printf('basic %s', webapi#base64#b64encode(g:github_user.':'.password))
endif
let auth = ''
if filereadable(s:gist_token_file)
if !empty(get(g:, 'gist_token', $GITHUB_TOKEN))
let auth = 'token ' . get(g:, 'gist_token', $GITHUB_TOKEN)
elseif filereadable(s:gist_token_file)
let str = join(readfile(s:gist_token_file), '')
if type(str) == 1
let auth = str
Expand Down