1
- ### Gist.vim
1
+ # Gist.vim
2
2
3
3
This is a vimscript for creating gists (http://gist.github.com ).
4
4
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 .
6
6
7
7
## Usage:
8
8
@@ -87,6 +87,10 @@ For the latest version please see https://github.com/mattn/gist-vim.
87
87
88
88
:Gist -l mattn
89
89
90
+ - Specify the number of gists listed:
91
+
92
+ :Gist -l -n 100
93
+
90
94
- List everyone's gists.
91
95
92
96
:Gist -la
@@ -99,6 +103,36 @@ For the latest version please see https://github.com/mattn/gist-vim.
99
103
100
104
:Gist -b
101
105
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
+
102
136
## Tips:
103
137
104
138
If 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:
158
192
159
193
$ git config --global github.user Username
160
194
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
+
161
199
## License:
162
200
163
201
Copyright 2010 by Yasuhiro Matsumoto
@@ -201,21 +239,21 @@ You need to install webapi-vim also:
201
239
If you want to use latest one:
202
240
203
241
https://github.com/mattn/webapi-vim
204
-
242
+
205
243
### Install with [ Vundle] ( https://github.com/gmarik/vundle )
206
244
207
245
Add the following lines to your ` .vimrc ` .
208
246
209
247
Bundle 'mattn/webapi-vim'
210
- Bundle 'mattn/gist- vim'
211
-
248
+ Bundle 'mattn/vim-gist '
249
+
212
250
Now restart Vim and run ` :BundleInstall ` .
213
251
214
252
### Install with [ NeoBundle] ( https://github.com/Shougo/neobundle.vim )
215
253
216
254
Add the following line to your ` .vimrc ` .
217
255
218
- NeoBundle 'mattn/gist- vim', {'depends': 'mattn/webapi-vim'}
256
+ NeoBundle 'mattn/vim-gist ', {'depends': 'mattn/webapi-vim'}
219
257
220
258
## Requirements:
221
259
@@ -232,12 +270,15 @@ First, you need to set your GitHub username in git's global configuration:
232
270
233
271
$ git config --global github.user <username>
234
272
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
237
275
prompt you to enter the two-factor key you receive.
238
276
277
+ NOTE:
278
+ If you want you can set it directly to ` g:github_user ` and ` g:gist_token ` .
279
+
239
280
Whichever 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
241
282
token is stored in ` ~/.gist-vim ` . If you stop using the plugin, you can
242
283
easily remove this file. To revoke the associated GitHub token, go to the
243
284
list of [ "Authorized applications" on GitHub's "Account Settings"
0 commit comments