Skip to content

Commit 340638a

Browse files
committed
Merge branch 'master' of github.com:mattn/gist-vim
2 parents 7e6c54a + aa16142 commit 340638a

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

autoload/gist.vim

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ function! s:GistPostBuffers(private, desc, anonymous) abort
690690
return loc
691691
endfunction
692692

693-
function! gist#Gist(count, line1, line2, ...) abort
693+
function! gist#Gist(count, bang, line1, line2, ...) abort
694694
redraw
695695
let bufname = bufname('%')
696696
" find GistID: in content , then we should just update
@@ -711,7 +711,9 @@ function! gist#Gist(count, line1, line2, ...) abort
711711
echohl ErrorMsg | echomsg 'You don''t have github account. read '':help gist-vim-setup''.' | echohl None
712712
return
713713
endif
714-
if bufname =~# bufnamemx
714+
if a:bang == '!'
715+
let gistidbuf = ''
716+
elseif bufname =~# bufnamemx
715717
let gistidbuf = matchstr(bufname, bufnamemx)
716718
elseif exists('b:gist') && has_key(b:gist, 'id')
717719
let gistidbuf = b:gist['id']

doc/gist-vim.txt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ USAGE *:Gist* *gist-vim-usage*
110110
>
111111
:Gist -b
112112
<
113+
- Post as new gist after editing on the buffer.
114+
>
115+
:Gist!
116+
<
113117
==============================================================================
114118
TIPS *gist-vim-tips*
115119

@@ -159,11 +163,21 @@ If you want to edit all files for gists containing more than one: >
159163
160164
let g:gist_get_multiplefile = 1
161165
<
162-
163166
If you want to use on GitHub Enterprise: >
164167
165168
let g:gist_api_url = 'http://your-github-enterprise-domain/api/v3'
166169
<
170+
If you want to open gist with current editing buffers: >
171+
172+
let g:gist_edit_with_buffers = 1
173+
174+
If you want to open gist with current editing buffers: >
175+
176+
let g:gist_edit_with_buffers = 1
177+
178+
If you want to open gist list/buffer as vertical split: >
179+
180+
let g:gist_list_vsplit = 1
167181
168182
If you want to update a gist, embed >
169183

plugin/gist.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ function! s:CompleteArgs(arg_lead,cmdline,cursor_pos)
1818
\ ]
1919
endfunction
2020

21-
command! -nargs=? -range=% -complete=customlist,s:CompleteArgs Gist :call gist#Gist(<count>, <line1>, <line2>, <f-args>)
21+
command! -nargs=? -range=% -bang -complete=customlist,s:CompleteArgs Gist :call gist#Gist(<count>, "<bang>", <line1>, <line2>, <f-args>)
2222

2323
" vim:set et:

0 commit comments

Comments
 (0)