1- ### Gist.vim
1+ # Gist.vim
22
33This is a vimscript for creating gists (http://gist.github.com ).
44
5- For the latest version please see https://github.com/mattn/gist- vim .
5+ For the latest version please see https://github.com/mattn/vim-gist .
66
77## Usage:
88
@@ -87,6 +87,10 @@ For the latest version please see https://github.com/mattn/gist-vim.
8787
8888 :Gist -l mattn
8989
90+ - Specify the number of gists listed:
91+
92+ :Gist -l -n 100
93+
9094- List everyone's gists.
9195
9296 :Gist -la
@@ -99,6 +103,36 @@ For the latest version please see https://github.com/mattn/gist-vim.
99103
100104 :Gist -b
101105
106+ ## List Feature
107+
108+ - Useful mappings on the gist-listing buffer:
109+ - Both ` o ` or ` Enter ` open the gist file in a new buffer, and close the
110+ vim-gist listing one.
111+ - ` b ` opens the gist file in a browser; this is necessary because
112+ ` Shift-Enter ` (as was originally) only works for GUI vim.
113+ - ` y ` copies the contents of the selected gist to the clipboard, and
114+ closes the vim-gist buffer.
115+ - ` p ` pastes the contents of the selected gist to the buffer from where
116+ vim-gist was called, and closes the vim-gist buffer.
117+ - Hitting ` Escape ` or ` Tab ` at the vim-gist buffer closes it.
118+
119+ - Gist listing has fixed-length columns now, more amenable to eye inspection.
120+ Every line on the gist-listing buffer contains the gist id, name and
121+ description, in that order. Columns are now padded and truncated to offer a
122+ faster browsing, in the following way:
123+ - The gist id string is fixed at 32 characters.
124+ - The length (in characters) of the name of the gist is fixed and
125+ can be set by the user using, for example:
126+
127+ ` let g:gistvim_namelength = 20 `
128+
129+ The default value for ` gistvim_namelength ` is 30. If the gist (file)name
130+ exceeds that length, it is truncated to the specified length.
131+ - Finally, the gist description is truncated in length to fit the remaining
132+ of the line, avoiding wrapped lines that mess up the table layout.
133+ - Note that the gist listing buffer now does not show the field 'code'
134+ (not sure what that did in the first place).
135+
102136## Tips:
103137
104138If you set g: gist_clip_command , gist.vim will copy the gist code with option
@@ -158,6 +192,10 @@ You need to either set global git config:
158192
159193 $ git config --global github.user Username
160194
195+ If you want to list more than 30 gists per page (maximum is 100):
196+
197+ let g:gist_per_page_limit = 100
198+
161199## License:
162200
163201 Copyright 2010 by Yasuhiro Matsumoto
@@ -201,21 +239,21 @@ You need to install webapi-vim also:
201239If you want to use latest one:
202240
203241 https://github.com/mattn/webapi-vim
204-
242+
205243### Install with [ Vundle] ( https://github.com/gmarik/vundle )
206244
207245Add the following lines to your ` .vimrc ` .
208246
209247 Bundle 'mattn/webapi-vim'
210- Bundle 'mattn/gist- vim'
211-
248+ Bundle 'mattn/vim-gist '
249+
212250Now restart Vim and run ` :BundleInstall ` .
213251
214252### Install with [ NeoBundle] ( https://github.com/Shougo/neobundle.vim )
215253
216254Add the following line to your ` .vimrc ` .
217255
218- NeoBundle 'mattn/gist- vim', {'depends': 'mattn/webapi-vim'}
256+ NeoBundle 'mattn/vim-gist ', {'depends': 'mattn/webapi-vim'}
219257
220258## Requirements:
221259
@@ -232,12 +270,15 @@ First, you need to set your GitHub username in git's global configuration:
232270
233271 $ git config --global github.user <username>
234272
235- Then gist- vim will ask for your password in order to create an access
236- token. If you have two-factor authentication enabled, gist- vim will also
273+ Then vim-gist will ask for your password in order to create an access
274+ token. If you have two-factor authentication enabled, vim-gist will also
237275prompt you to enter the two-factor key you receive.
238276
277+ NOTE:
278+ If you want you can set it directly to ` g:github_user ` and ` g:gist_token ` .
279+
239280Whichever type of authentication you use, your GitHub password will not be
240- stored, only a OAuth access token produced specifically for gist- vim. The
281+ stored, only a OAuth access token produced specifically for vim-gist . The
241282token is stored in ` ~/.gist-vim ` . If you stop using the plugin, you can
242283easily remove this file. To revoke the associated GitHub token, go to the
243284list of [ "Authorized applications" on GitHub's "Account Settings"
0 commit comments