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
6 changes: 6 additions & 0 deletions README.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ If you want your gist to be private by default:

let g:gist_post_private = 1

If you want your gist to be anonymous by default:

let g:gist_post_anonymous = 1

If you want to manipulate multiple files in a gist:

let g:gist_get_multiplefile = 1
Expand Down Expand Up @@ -240,3 +244,5 @@ list of ["Authorized applications" on GitHub's "Account Settings"
page][uas].

[uas]: https://github.com/settings/applications

**Note:** the username is optional if you only send anonymous gists.
10 changes: 5 additions & 5 deletions autoload/gist.vim
Original file line number Diff line number Diff line change
Expand Up @@ -660,10 +660,6 @@ endfunction

function! gist#Gist(count, line1, line2, ...) abort
redraw
if strlen(g:github_user) == 0
echohl ErrorMsg | echomsg "You don't have github account. read ':help gist-vim-setup'." | echohl None
return
endif
let bufname = bufname("%")
" find GistID: in content , then we should just update
let gistid = ''
Expand All @@ -675,10 +671,14 @@ function! gist#Gist(count, line1, line2, ...) abort
let clipboard = 0
let deletepost = 0
let editpost = 0
let anonymous = 0
let anonymous = get(g:, 'gist_post_anonymous', 0)
let openbrowser = 0
let listmx = '^\%(-l\|--list\)\s*\([^\s]\+\)\?$'
let bufnamemx = '^' . s:bufprefix .'\(\zs[0-9a-f]\+\ze\|\zs[0-9a-f]\+\ze[/\\].*\)$'
if strlen(g:github_user) == 0 && anonymous == 0
echohl ErrorMsg | echomsg "You don't have github account. read ':help gist-vim-setup'." | echohl None
return
endif
if bufname =~ bufnamemx
let gistidbuf = matchstr(bufname, bufnamemx)
elseif exists('b:gist') && has_key(b:gist, 'id')
Expand Down
5 changes: 5 additions & 0 deletions doc/gist-vim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ If you want to show your private gists with ":Gist -l": >
If you want your gist to be private by default: >

let g:gist_post_private = 1
<
If you want your gist to be anonymous by default: >

let g:gist_post_anonymous = 1
<
If you want to edit all files for gists containing more than one: >

Expand Down Expand Up @@ -270,6 +273,8 @@ Then, add following into your ~/.vimrc
<
This is not secure at all, so strongly discouraged.

NOTE: the username is optional if you only send anonymous gists.

==============================================================================
FAQ *gist-vim-faq*

Expand Down