sponsor Vim development Vim logo Vim Book Ad

Gist.vim : vimscript for gist

 script karma  Rating 245/88, Downloaded by 13563  Comments, bugs, improvements  Vim wiki

created by
Yasuhiro Matsumoto
 
script type
utility
 
description
This is vimscript for gist (http://gist.github.com)

Usage:

  :Gist
    post
whole text to gist.

  :'<,'>Gist
    post selected text to gist.

  :Gist -p
    post whole text to gist with private.
    if you got empty gist list, try :Gist --abandon

  :Gist -a
    post whole text to gist with anonymous.

  :Gist -m
    post multi buffer to gist.

  :Gist -e
    edit the gist. (shoud be work on gist buffer)
    you can update the gist with :w command on gist buffer.

  :Gist -e foo.js
    edit the gist with name 'foo.js'. (shoud be work on gist buffer)

  :Gist -d
    delete the gist. (should be work on gist buffer)
    password authentication is needed.

  :Gist -f
    fork the gist. (should be work on gist buffer)
    password authentication is needed.

  :Gist XXXXX
    get gist XXXXX.

  :Gist -c XXXXX.
    get gist XXXXX and put to clipboard.

  :Gist -l
    list gists from mine.

  :Gist -la
    list gists from all.

Tips:
  if set g:gist_clip_command, gist.vim will copy the gist code
    with option '-c'.

    # mac
    let g:gist_clip_command = 'pbcopy'

    # linux
    let g:gist_clip_command = 'xclip -selection clipboard'

    # others(cygwin?)
    let g:gist_clip_command = 'putclip'

  if you want to detect filetype from filename...

    let g:gist_detect_filetype = 1

  if you want to open browser after the post...

    let g:gist_open_browser_after_post = 1

  if you want to change the browser...

    let g:gist_browser_command = 'w3m %URL%'

      or

    let g:gist_browser_command = 'opera %URL% &'

    on windows, should work with original setting.

Require:
  curl command (http://curl.haxx.se/)
  and
if you want to use profile of git, it require git command.
 
install details
copy it to your plugin directory.

gist.vim leave cookie-jar file into runtimepath.

rtp:
  plugin/gist.vim
  cookies/github

if you want to uninstall gist.vim, you have better to remove 'cookies/github'.

for using gist.vim, you should install git. or set g:github_user and g:github_token into your vimrc.
note that g:github_token is NOT a your password.

how get your token.
  1. login to github.
  2. click "Account Settings"
  3. click "Account Admin"
  4. you'll see it at following of 'API Token'.

See also: https://github.com/mattn/gist-vim/blob/master/README.mkd>
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
gist-vim.zip 7.2 2014-10-19 7.0 Yasuhiro Matsumoto This is an upgrade for Gist.vim: fixed many bugs.
gist-vim.zip 7.1 2012-12-13 7.0 Yasuhiro Matsumoto This is an upgrade for Gist.vim: updated installation notes.
gist-vim.zip 7.0 2012-09-26 7.0 Yasuhiro Matsumoto This is an upgrade for Gist.vim: fixed few bugs.
gist-vim.zip 6.9 2012-09-07 7.0 Yasuhiro Matsumoto This is an upgrade for Gist.vim: fixed few bugs.
gist-vim.zip 6.8 2012-07-09 7.0 Yasuhiro Matsumoto This is an upgrade for Gist.vim: changed authentication. removed password authentication. if you want to keep using password authentication, let gist_use_password_in_gitconfig to 1.
gist-vim.zip 6.7 2012-05-28 7.0 Yasuhiro Matsumoto This is an upgrade for Gist.vim: fix behavior of g:gist_browser_command = ':OpenBrowser %URL%'.
gist-vim.zip 6.6 2012-05-02 7.0 Yasuhiro Matsumoto This is an upgrade for Gist.vim: fixed detecting filetype.
gist-vim.zip 6.5 2012-04-15 7.0 Yasuhiro Matsumoto This is an upgrade for Gist.vim: use webapi namespace. NOTE: please upgrade webapi-vim also.
gist-vim.zip 6.4 2012-04-07 7.0 Yasuhiro Matsumoto This is an upgrade for Gist.vim: fixed updating with description.
gist-vim.zip 6.3 2012-04-03 7.0 Yasuhiro Matsumoto This is an upgrade for Gist.vim: fixed typos.
gist-vim.zip 6.2 2012-04-02 7.0 Yasuhiro Matsumoto This is an upgrade for Gist.vim: fixed some bugs.
gist-vim.zip 6.1 2012-03-31 7.0 Yasuhiro Matsumoto This is an upgrade for Gist.vim: fixed opening browser.
gist-vim.zip 6.0 2012-03-31 7.0 Yasuhiro Matsumoto This is an upgrade for Gist.vim: changed to use github APIs. Note to remove cookies directory if you used.
gist-vim.zip 5.9 2012-01-31 7.0 Yasuhiro Matsumoto This is an upgrade for Gist.vim: add support anonymous post. fixed many bugs.
gist-vim.zip 5.8 2011-12-05 7.0 Yasuhiro Matsumoto This is an upgrade for Gist.vim: add support for description. you can post description using -s option.
gist-vim.zip 5.7 2011-11-22 7.0 Yasuhiro Matsumoto This is an upgrade for Gist.vim: post with filetype more cleverly.
gist-vim.zip 5.6 2011-11-21 7.0 Yasuhiro Matsumoto This is an upgrade for Gist.vim: fix '--abandon'.
gist-vim.zip 5.5 2011-10-18 7.0 Yasuhiro Matsumoto This is an upgrade for Gist.vim: fix: forgot to upload autoload/gist.vim.
gist.vim 5.4 2011-10-14 7.0 Yasuhiro Matsumoto This is an upgrade for Gist.vim: fix: does not work correctly with blockwize selection.
gist.vim 5.3 2011-10-13 7.0 Yasuhiro Matsumoto This is an upgrade for Gist.vim: upd: support autoload.
gist.vim 5.2 2011-10-13 7.0 Yasuhiro Matsumoto This is an upgrade for Gist.vim: add: support block-wise selection.
gist.vim 5.1 2011-09-16 7.0 Yasuhiro Matsumoto This is an upgrade for Gist.vim: fixed: can't update privates.
gist.vim 5.0 2011-06-15 7.0 Yasuhiro Matsumoto This is an upgrade for Gist.vim: follow update of gist.github.com
gist.vim 4.9 2011-04-15 7.0 Yasuhiro Matsumoto fix: don't add new line after "Done: xxx".
fix: show WHY FAILED' when failed to post.
add: support for :OpenBrowser.
add: new option 'gist_curl_options'.
ip used for rating: 142.132.191.50

Questions about Vim should go to the maillist. Help Uganda.     Vim at Github