1
0
Fork 0
mirror of synced 2024-10-09 05:29:01 -04:00

Added gist-vim

This commit is contained in:
Amir Salihefendic 2019-11-16 18:40:53 +01:00
parent f33d38b90c
commit 01890d8b5d
9 changed files with 2153 additions and 5 deletions

View file

@ -105,6 +105,7 @@ I recommend reading the docs of these plugins to understand them better. Each pl
* [vim-multiple-cursors](https://github.com/terryma/vim-multiple-cursors): Sublime Text style multiple selections for Vim, CTRL+N is remapped to CTRL+S (due to YankRing)
* [vim-yankstack](https://github.com/maxbrunsfeld/vim-yankstack): Maintains a history of previous yanks, changes and deletes
* [vim-zenroom2](https://github.com/amix/vim-zenroom2) Remove all clutter and focus only on the essential. Similar to iA Writer or Write Room
* [gist-vim](https://github.com/mattn/gist-vim) Easily create gists from Vim using the `:Gist` command
## Included color schemes

View file

@ -0,0 +1,12 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: mattn # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

View file

@ -0,0 +1,11 @@
all : gist-vim.zip
remove-zip:
-rm -f doc/tags
-rm -f gist-vim.zip
gist-vim.zip: remove-zip
zip -r gist-vim.zip autoload plugin doc README.mkd
release: gist-vim.zip
vimup update-script gist.vim

View file

@ -0,0 +1,278 @@
# Gist.vim
This is a vimscript for creating gists (http://gist.github.com).
For the latest version please see https://github.com/mattn/gist-vim.
## Usage:
- Post current buffer to gist, using default privacy option.
:Gist
- Post selected text to gist, using default privacy option.
This applies to all permutations listed below (except multi).
:'<,'>Gist
- Create a private gist.
:Gist -p
- Create a public gist.
(Only relevant if you've set gists to be private by default.)
:Gist -P
> This is only relevant if you've set gists to be private by default;
> if you get an empty gist list, try ":Gist --abandon".
- Create a gist anonymously.
:Gist -a
- Create a gist with all open buffers.
:Gist -m
- Edit the gist (you need to have opened the gist buffer first).
You can update the gist with the ":w" command within the gist buffer.
:Gist -e
- Edit the gist with name 'foo.js' (you need to have opened the gist buffer
first).
:Gist -e foo.js
- Post/Edit with the description " (you need to have opened the gist buffer
first). >
:Gist -s something
:Gist -e -s something
- Delete the gist (you need to have opened the gist buffer first).
Password authentication is needed.
:Gist -d
- Fork the gist (you need to have opened the gist buffer first).
Password authentication is needed.
:Gist -f
- Star the gist (you need to have opened the gist buffer first).
Password authentication is needed.
:Gist +1
- Unstar the gist (you need to have opened the gist buffer first).
Password authentication is needed.
:Gist -1
- Get gist XXXXX.
:Gist XXXXX
- Get gist XXXXX and add to clipboard.
:Gist -c XXXXX
- List your public gists.
:Gist -l
- List gists from user "mattn".
:Gist -l mattn
- List everyone's gists.
:Gist -la
- List gists from your starred gists.
:Gist -ls
- Open the gist on browser after you post or update it.
:Gist -b
## List Feature
- Useful mappings on the gist-listing buffer:
- Both `o` or `Enter` open the gist file in a new buffer, and close the
gist-vim listing one.
- `b` opens the gist file in a browser; this is necessary because
`Shift-Enter` (as was originally) only works for GUI vim.
- `y` copies the contents of the selected gist to the clipboard, and
closes the gist-vim buffer.
- `p` pastes the contents of the selected gist to the buffer from where
gist-vim was called, and closes the gist-vim buffer.
- Hitting `Escape` or `Tab` at the gist-vim buffer closes it.
- Gist listing has fixed-length columns now, more amenable to eye inspection.
Every line on the gist-listing buffer contains the gist id, name and
description, in that order. Columns are now padded and truncated to offer a
faster browsing, in the following way:
- The gist id string is fixed at 32 characters.
- The length (in characters) of the name of the gist is fixed and
can be set by the user using, for example:
`let g:gistvim_namelength = 20`
The default value for `gistvim_namelength` is 30. If the gist (file)name
exceeds that length, it is truncated to the specified length.
- Finally, the gist description is truncated in length to fit the remaining
of the line, avoiding wrapped lines that mess up the table layout.
- Note that the gist listing buffer now does not show the field 'code'
(not sure what that did in the first place).
## Tips:
If you 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 the 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, this should work with your user settings.
If you want to show your private gists with ":Gist -l":
let g:gist_show_privates = 1
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
If you want to use on GitHub Enterprise:
let g:gist_api_url = 'http://your-github-enterprise-domain/api/v3'
You need to either set global git config:
$ git config --global github.user Username
## License:
Copyright 2010 by Yasuhiro Matsumoto
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
## Install:
Copy it to your plugin directory.
gist.vim will create a curl cookie-jar file in your runtimepath.
- rtp:
- autoload/gist.vim
- plugin/gist.vim
If you want to uninstall gist.vim, remember to also remove `~/.gist-vim`.
You need to install webapi-vim also:
http://www.vim.org/scripts/script.php?script_id=4019
If you want to use latest one:
https://github.com/mattn/webapi-vim
### Install with [Vundle](https://github.com/gmarik/vundle)
Add the following lines to your `.vimrc`.
Bundle 'mattn/webapi-vim'
Bundle 'mattn/gist-vim'
Now restart Vim and run `:BundleInstall`.
### Install with [NeoBundle](https://github.com/Shougo/neobundle.vim)
Add the following line to your `.vimrc`.
NeoBundle 'mattn/gist-vim', {'depends': 'mattn/webapi-vim'}
## Requirements:
- curl command (http://curl.haxx.se/)
- webapi-vim (https://github.com/mattn/webapi-vim)
- and if you want to use your git profile, the git command-line client.
## Setup:
This plugin supports both basic and two-factor authentication using GitHub
API v3. The plugin stores its credentials in `~/.gist-vim`.
First, you need to set your GitHub username in git's global configuration:
$ git config --global github.user <username>
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.
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
easily remove this file. To revoke the associated GitHub token, go to the
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.

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,358 @@
*Gist.vim* Vimscript for creating gists (http://gist.github.com)
Usage |gist-vim-usage|
Tips |gist-vim-tips|
License |gist-vim-license|
Install |gist-vim-install|
Requirements |gist-vim-requirements|
Setup |gist-vim-setup|
FAQ |gist-vim-faq|
This is a vimscript for creating gists (http://gist.github.com)
For the latest version please see https://github.com/mattn/gist-vim.
==============================================================================
USAGE *:Gist* *gist-vim-usage*
- Post current buffer to gist, using default privacy option. >
:Gist
<
- Post selected text to gist, using default privacy option.
This applies to all permutations listed below (except multi). >
:'<,'>Gist
<
- Create a private gist. >
:Gist -p
:Gist --private
<
- Create a public gist.
(Only relevant if you've set gists to be private by default.) >
:Gist -P
:Gist --public
<
- Post whole text to gist as public.
This is only relevant if you've set gists to be private by default.
>
:Gist -P
<
- Create a gist anonymously. >
:Gist -a
:Gist --anonymous
<
- Create a gist with all open buffers. >
:Gist -m
:Gist --multibuffer
<
- Edit the gist (you need to have opened the gist buffer first).
You can update the gist with the {:w} command within the gist buffer. >
:Gist -e
:Gist --edit
<
- Edit the gist with name "foo.js" (you need to have opened the gist buffer
first). >
:Gist -e foo.js
<
- Post/Edit with the description " (you need to have opened the gist buffer
first). >
:Gist -s something
:Gist --description something
:Gist -e -s something
<
- Delete the gist (you need to have opened the gist buffer first).
Password authentication is needed. >
:Gist -d
:Gist --delete
<
- Fork the gist (you need to have opened the gist buffer first).
Password authentication is needed. >
:Gist -f
:Gist --fork
<
- Star the gist (you need to have opened the gist buffer first).
Password authentication is needed.
>
:Gist +1
<
- Unstar the gist (you need to have opened the gist buffer first).
Password authentication is needed.
>
:Gist -1
<
- Get gist XXXXX. >
:Gist XXXXX
<
- Get gist XXXXX and add to clipboard. >
:Gist -c XXXXX
<
- List your public gists. >
:Gist -l
:Gist --list
<
- List gists from user "mattn". >
:Gist -l mattn
<
- List everyone's gists. >
:Gist -la
:Gist --listall
<
- List gists from your starred gists.
>
:Gist -ls
:Gist --liststar
- While the gist list is visible, the following mappings apply:
- 'o' or 'Enter' will open the selected gist file in a new buffer
and close the gist-vim listing split.
- 'b' will open the selected gist file in a browser. If you are in
GUI vim you can also achieve this by pressing 'Shift-Enter'.
- 'y' will copy the contents of the selected gist to the clipboard,
and close the gist-vim listing split.
- 'p' will (copy and) paste the contents of the selected gist to the
buffer from which gist-vim was called, and close the gist-vim
listing split.
- 'Esc' will close the gist-vim listing split without performing any
further action.
- Open the gist on browser after you post or update it.
>
:Gist -b
:Gist --browser
<
- Post as new gist after editing on the buffer.
>
:Gist!
<
==============================================================================
TIPS *gist-vim-tips*
If you 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 the filename: >
let g:gist_detect_filetype = 1
<
If you want to open the 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, this should work with your user settings.
If you want to show your private gists with ":Gist -l": >
let g:gist_show_privates = 1
<
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: >
let g:gist_get_multiplefile = 1
<
If you want to use on GitHub Enterprise: >
let g:gist_api_url = 'http://your-github-enterprise-domain/api/v3'
<
If you want to open gist with current editing buffers: >
let g:gist_edit_with_buffers = 1
If you want to open gist list/buffer as vertical split: >
let g:gist_list_vsplit = 1
If you want to modify filetype for the file on github, or add mapping of
filetype/file-extension: >
let g:gist_extmap = { ".swift": "swift" }
<
key is file-extension, value is filetype.
If you want to update a gist, embed >
GistID: xxxxx
>
in your local file, then call >
:Gist
The gist-vim listing split lists gists ids, names (filenames) as well as
their description. This is done following a table layout, with fixed space
for each column. For offering quick browsing, gist-vim will truncate all
output exceeding the available horizontal space, assuring that every gist
listed only takes one line on the table. Although the gist id field width is
fixed internally, the user can define the length of the (file)name field on
the gist-vim listing. This can be done by the following declaration:
let g:gist_namelength = 20
Note that the default value for gist_namelength is 30. Again, if the gist
(file)name exceeds the specified number of characters, it will be truncated.
If you want to update a gist when only |:w!|: >
" :w and :w! update a gist.
let g:gist_update_on_write = 1
" Only :w! updates a gist.
let g:gist_update_on_write = 2
>
All other values are treated as 1.
This variable's value is 1 by default.
==============================================================================
LICENSE *gist-vim-license*
Copyright 2010 by Yasuhiro Matsumoto
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
==============================================================================
INSTALL *gist-vim-install*
Copy following files into your plugin directory.
rtp:
- autoload/gist.vim
- plugin/gist.vim
If you want to uninstall gist.vim, remember to also remove `~/.gist-vim`.
You need to install webapi-vim also:
http://www.vim.org/scripts/script.php?script_id=4019
If you want to use latest one:
https://github.com/mattn/webapi-vim
==============================================================================
REQUIREMENTS *gist-vim-requirements*
- curl command (http://curl.haxx.se/)
- webapi-vim (https://github.com/mattn/webapi-vim)
- and, if you want to use your git profile, the git command-line client.
==============================================================================
SETUP *gist-vim-setup*
This plugin uses GitHub API v3. The authentication value is stored in `~/.gist-vim`.
gist-vim provides two ways to authenticate against the GitHub APIs.
First, you need to set your GitHub username in global git config:
>
$ git config --global github.user Username
<
Then, gist.vim will ask for your password to create an authorization when you
first use it. The password is not stored and only the OAuth access token will
be kept for later use. You can revoke the token at any time from the list of
"Authorized applications" on GitHub's "Account Settings" page.
(https://github.com/settings/applications)
If you have two-factor authentication enabled on GitHub, you'll see the message
"Must specify two-factor authentication OTP code." In this case, you need to
create a "Personal Access Token" on GitHub's "Account Settings" page
(https://github.com/settings/applications) and place it in a file
named ~/.gist-vim like this:
>
token xxxxx
<
If you happen to have your password already written in ~/.gitconfig like
below:
>
[github]
password = xxxxx
<
Then, add following into your ~/.vimrc
>
let g:gist_use_password_in_gitconfig = 1
<
This is not secure at all, so strongly discouraged.
NOTE: the username is optional if you only send anonymous gists.
==============================================================================
FAQ *gist-vim-faq*
Q. :Gist returns a Forbidden error
A. Try deleting ~/.gist-vim and authenticating again.
==============================================================================
THANKS *gist-vim-thanks*
AD7six
Bruno Bigras
c9s
Daniel Bretoi
Jeremy Michael Cantrell
Kien N
kongo2002
MATSUU Takuto
Matthew Weier O'Phinney
ornicar
Roland Schilter
steve
tyru
Will Gray
netj
vim:tw=78:ts=8:ft=help:norl:

View file

@ -0,0 +1,303 @@
script_name: Gist.vim
script_id: '2423'
script_type: utility
script_package: gist-vim.zip
script_version: '7.3'
required_vim_version: '7.0'
summary: vimscript for gist
detailed_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. (should 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'. (should be work on gist buffer)
:Gist -d
delete the gist. (should be work on gist buffer)
authentication required.
:Gist -f
fork the gist. (should be work on gist buffer)
authentication required.
: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
See also: https://github.com/mattn/gist-vim/blob/master/README.mkd
versions:
- '7.3': |
This is an upgrade for Gist.vim: fixed many bugs. Added few list actions: yank, paste, open in browser.
- '7.2': |
This is an upgrade for Gist.vim: fixed many bugs.
- '7.1': |
This is an upgrade for Gist.vim: updated installation notes.
- '7.0': |
This is an upgrade for Gist.vim: fixed few bugs.
- '6.9': |
This is an upgrade for Gist.vim: fixed few bugs.
- '6.8': |
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.
- '6.7': |
This is an upgrade for Gist.vim: fix behavior of g:gist_browser_command = ':OpenBrowser %URL%'.
- '6.6': |
This is an upgrade for Gist.vim: fixed detecting filetype.
- '6.5': |
This is an upgrade for Gist.vim: use webapi namespace. NOTE: please upgrade webapi-vim also.
- '6.4': |
This is an upgrade for Gist.vim: fixed updating with description.
- '6.3': |
This is an upgrade for Gist.vim: fixed typos.
- '6.2': |
This is an upgrade for Gist.vim: fixed some bugs.
- '6.1': |
This is an upgrade for Gist.vim: fixed opening browser.
- '6.0': |
This is an upgrade for Gist.vim: changed to use github APIs. Note to remove cookies directory if you used.
- '5.9': |
This is an upgrade for Gist.vim: add support anonymous post. fixed many bugs.
- '5.8': |
This is an upgrade for Gist.vim: add support for description. you can post description using -s option.
- '5.7': |
This is an upgrade for Gist.vim: post with filetype more cleverly.
- '5.6': |
This is an upgrade for Gist.vim: fix '--abandon'.
- '5.5': |
This is an upgrade for Gist.vim: fix: forgot to upload autoload/gist.vim.
- '5.4': |
This is an upgrade for Gist.vim: fix: does not work correctly with blockwize selection.
- '5.3': |
This is an upgrade for Gist.vim: upd: support autoload.
- '5.2': |
This is an upgrade for Gist.vim: add: support block-wise selection.
- '5.1': |
This is an upgrade for Gist.vim: fix: can't update privates.
- '5.0': |
This is an upgrade for Gist.vim: follow update of gist.github.com
- '4.9': |
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'.
- '4.8': |
This is an upgrade for Gist.vim: fix: can't open private gist with ":Gist XXXXX".
- '4.7': |
This is an upgrade for Gist.vim: fix: filetype detection.
- '4.6': |
This is an upgrade for Gist.vim: fix: strange cookies folder.
- '4.5': |
This is an upgrade for Gist.vim: fix: use gist_clip_command for copying URL to clipboard. this fix strange behavior on Mac OSX.
- '4.4': |
This is an upgrade for Gist.vim: fix: gist is now only using https.
- '4.3': |
This is an upgrade for Gist.vim: add new option '-f' for fork.
- '4.2': |
This is an upgrade for Gist.vim: fixed code for login.
- '4.1': |
This is an upgrade for Gist.vim: fixed code cleanup.
- '4.0': |
This is an upgrade for Gist.vim: fixed deleting gist, listing privates.
- '3.9': |
This is an upgrade for Gist.vim: fixed :w handler in gist buffer.
- '3.8': |
This is an upgrade for Gist.vim: 'more...' on gist list.
- '3.7': |
This is an upgrade for Gist.vim: fix problem that break "gist list" window at twice.
- '3.6': |
This is an upgrade for Gist.vim: fix filetype detection for 'vimscript'.
- '3.5': |
This is an upgrade for Gist.vim: fix filetype detection.
- '3.4': |
This is an upgrade for Gist.vim: use '+' register on unix only if built with 'xterm_clipboard'. and some bug fixes.
- '3.3': |
This is an upgrade for Gist.vim: fix problem that append empty line when getting gist.
- '3.2': |
This is an upgrade for Gist.vim: added Gist header to recognize the gist. added script type header for Vimana.
- '3.1': |
This is an upgrade for Gist.vim: fix checking redirect url.
- '3.0': |
This is an upgrade for Gist.vim: fix for official changes(private button name was changed).
- '2.9': |
This is an upgrade for Gist.vim: fix for official changes(private button name was changed).
- '2.8': |
This is an upgrade for Gist.vim: be able to post multi buffer. currently updating or showing not supported. and ':Gist -d' delete the gist.
- '2.7': |
This is an upgrade for Gist.vim: be able to write the gist to local file with ':w foo.txt'.
- '2.6': |
This is an upgrade for Gist.vim: fixed problem that does not work 'Gist XXXX'.
- '2.5': |
This is an upgrade for Gist.vim: use existing buffer when open the list or gist.
- '2.4': |
This is an upgrade for Gist.vim: show error message when no any github settings.
- '2.3': |
This is an upgrade for Gist.vim: added :w BufWriteCmd for GistUpdate.
- '2.2': |
This is an upgrade for Gist.vim: fixed a bug for anonymous post. and new option '-a' for anonymous post.
- '2.1': |
This is an upgrade for Gist.vim: support changing gist filename.
- '2.0': |
This is an upgrade for Gist.vim: bugfix for listing gists in specified user.
- '1.9': |
This is an upgrade for Gist.vim: added support editing the gist. and bits bug fix.
- '1.8': |
This is an upgrade for Gist.vim: added new option g:gist_open_browser_after_post/g:gist_browser_command to open posted gist.
- '1.7': |
This is an upgrade for Gist.vim: now changed argument for putting clipboard as ':Gist -c XXXXX'.
- '1.6': |
This is an upgrade for Gist.vim: add gist's author in gist list.
- '1.5': |
This is an upgrade for Gist.vim: oops. bugfix for auto-detection.
- '1.4': |
This is an upgrade for Gist.vim: bugfix for auto-detection.
- '1.3': |
This is an upgrade for Gist.vim: more auto-detection for filetype.
- '1.2': |
This is an upgrade for Gist.vim: added new option for detect filetype from filename.
- '1.1': |
This is an upgrade for Gist.vim: calling StdinReadPost.
- '1.0': |
This is an upgrade for Gist.vim: treat literal "-" as part of username.
- '0.9': |
This is an upgrade for Gist.vim: added new option 'g:gist_clip_command' that copy the gist code.
# __END__
# vim: filetype=yaml

View file

@ -0,0 +1,23 @@
"=============================================================================
" File: gist.vim
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
" WebPage: http://github.com/mattn/gist-vim
" License: BSD
" GetLatestVimScripts: 2423 1 :AutoInstall: gist.vim
" script type: plugin
if &compatible || (exists('g:loaded_gist_vim') && g:loaded_gist_vim)
finish
endif
let g:loaded_gist_vim = 1
function! s:CompleteArgs(arg_lead,cmdline,cursor_pos)
return filter(copy(["-p", "-P", "-a", "-m", "-e", "-s", "-d", "+1", "-1", "-f", "-c", "-l", "-la", "-ls", "-b",
\ "--listall", "--liststar", "--list", "--multibuffer", "--private", "--public", "--anonymous", "--description", "--clipboard",
\ "--rawurl", "--delete", "--edit", "--star", "--unstar", "--fork", "--browser"
\ ]), 'stridx(v:val, a:arg_lead)==0')
endfunction
command! -nargs=? -range=% -bang -complete=customlist,s:CompleteArgs Gist :call gist#Gist(<count>, "<bang>", <line1>, <line2>, <f-args>)
" vim:set et:

View file

@ -13,7 +13,6 @@ import requests
from os import path
#--- Globals ----------------------------------------------
PLUGINS = """
auto-pairs https://github.com/jiangmiao/auto-pairs
@ -57,6 +56,7 @@ vim-abolish https://github.com/tpope/tpope-vim-abolish
mru.vim https://github.com/vim-scripts/mru.vim
vim-markdown https://github.com/plasticboy/vim-markdown
comfortable-motion.vim https://github.com/yuttie/comfortable-motion.vim
gist-vim https://github.com/mattn/gist-vim
""".strip()
GITHUB_ZIP = '%s/archive/master.zip'
@ -74,8 +74,8 @@ def download_extract_replace(plugin_name, zip_path, temp_dir, source_dir):
zip_f = zipfile.ZipFile(temp_zip_path)
zip_f.extractall(temp_dir)
plugin_temp_path = path.join(temp_dir,
path.join(temp_dir, '%s-master' % plugin_name))
plugin_temp_path = path.join(
temp_dir, path.join(temp_dir, '%s-master' % plugin_name))
# Remove the current plugin and replace it with the extracted
plugin_dest_path = path.join(source_dir, plugin_name)
@ -92,8 +92,7 @@ def download_extract_replace(plugin_name, zip_path, temp_dir, source_dir):
def update(plugin):
name, github_url = plugin.split(' ')
zip_path = GITHUB_ZIP % github_url
download_extract_replace(name, zip_path,
temp_directory, SOURCE_DIR)
download_extract_replace(name, zip_path, temp_directory, SOURCE_DIR)
if __name__ == '__main__':