1
0
mirror of https://github.com/amix/vimrc synced 2025-07-04 15:04:59 +08:00

Update vim-gist.

This commit is contained in:
Kurtis Moxley
2022-05-19 22:00:33 +08:00
parent 7747765240
commit f219991e20
10 changed files with 303 additions and 547 deletions

View File

@ -1,19 +1,19 @@
*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|
Usage |vim-gist-usage|
Tips |vim-gist-tips|
License |vim-gist-license|
Install |vim-gist-install|
Requirements |vim-gist-requirements|
Setup |vim-gist-setup|
FAQ |vim-gist-faq|
This is a vimscript for creating gists (http://gist.github.com)
For the latest version please see https://github.com/mattn/gist-vim.
For the latest version please see https://github.com/mattn/vim-gist.
==============================================================================
USAGE *:Gist* *gist-vim-usage*
USAGE *:Gist* *vim-gist-usage*
- Post current buffer to gist, using default privacy option. >
@ -102,6 +102,8 @@ USAGE *:Gist* *gist-vim-usage*
:Gist -l
:Gist --list
:Gist -l -n 100
:Gist --list --per-page 100
<
- List gists from user "mattn". >
@ -120,15 +122,15 @@ USAGE *:Gist* *gist-vim-usage*
- 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.
and close the vim-gist 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.
and close the vim-gist 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
buffer from which vim-gist was called, and close the vim-gist
listing split.
- 'Esc' will close the gist-vim listing split without performing any
- 'Esc' will close the vim-gist listing split without performing any
further action.
- Open the gist on browser after you post or update it.
@ -141,7 +143,7 @@ USAGE *:Gist* *gist-vim-usage*
:Gist!
<
==============================================================================
TIPS *gist-vim-tips*
TIPS *vim-gist-tips*
If you set "g:gist_clip_command", gist.vim will copy the gist code with option
"-c".
@ -201,6 +203,10 @@ If you want to open gist list/buffer as vertical split: >
let g:gist_list_vsplit = 1
If you want to list more than 30 gists per page (maximum is 100):
let g:gist_per_page_limit = 100
If you want to modify filetype for the file on github, or add mapping of
filetype/file-extension: >
@ -216,13 +222,13 @@ in your local file, then call >
:Gist
The gist-vim listing split lists gists ids, names (filenames) as well as
The vim-gist 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
for each column. For offering quick browsing, vim-gist 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:
the vim-gist listing. This can be done by the following declaration:
let g:gist_namelength = 20
@ -241,7 +247,7 @@ All other values are treated as 1.
This variable's value is 1 by default.
==============================================================================
LICENSE *gist-vim-license*
LICENSE *vim-gist-license*
Copyright 2010 by Yasuhiro Matsumoto
@ -267,7 +273,7 @@ LICENSE *gist-vim-license*
OF THE POSSIBILITY OF SUCH DAMAGE.
==============================================================================
INSTALL *gist-vim-install*
INSTALL *vim-gist-install*
Copy following files into your plugin directory.
@ -275,7 +281,7 @@ rtp:
- autoload/gist.vim
- plugin/gist.vim
If you want to uninstall gist.vim, remember to also remove `~/.gist-vim`.
If you want to uninstall gist.vim, remember to also remove `~/.vim-gist`.
You need to install webapi-vim also:
@ -286,17 +292,17 @@ If you want to use latest one:
https://github.com/mattn/webapi-vim
==============================================================================
REQUIREMENTS *gist-vim-requirements*
REQUIREMENTS *vim-gist-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*
SETUP *vim-gist-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.
This plugin uses GitHub API v3. The authentication value is stored in `~/.vim-gist`.
vim-gist provides two ways to authenticate against the GitHub APIs.
First, you need to set your GitHub username in global git config:
>
@ -312,7 +318,7 @@ 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:
named ~/.vim-gist like this:
>
token xxxxx
<
@ -331,13 +337,13 @@ This is not secure at all, so strongly discouraged.
NOTE: the username is optional if you only send anonymous gists.
==============================================================================
FAQ *gist-vim-faq*
FAQ *vim-gist-faq*
Q. :Gist returns a Forbidden error
A. Try deleting ~/.gist-vim and authenticating again.
A. Try deleting ~/.vim-gist and authenticating again.
==============================================================================
THANKS *gist-vim-thanks*
THANKS *vim-gist-thanks*
AD7six
Bruno Bigras