-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgooglereader.vim
More file actions
590 lines (534 loc) · 18.3 KB
/
googlereader.vim
File metadata and controls
590 lines (534 loc) · 18.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
"=============================================================================
" File: googlereader.vim
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
" Last Change: 17-Jun-2009.
" Version: 1.5
" WebPage: http://github.com/mattn/googlereader-vim/tree/master
" Usage:
"
" :GoogleReader
"
" GetLatestVimScripts: 2678 1 :AutoInstall: googlereader.vim
let g:googlereader_vim_version = "1.5"
if &compatible
finish
endif
if !executable('curl')
echoerr "GoogleReader: require 'curl' command"
finish
endif
let s:LIST_BUFNAME = '==GoogleReader Entries=='
let s:CONTENT_BUFNAME = '==GoogleReader Content=='
function! s:wcwidth(ucs)
let ucs = a:ucs
if (ucs >= 0x1100
\ && (ucs <= 0x115f
\ || ucs == 0x2329
\ || ucs == 0x232a
\ || (ucs >= 0x2e80 && ucs <= 0xa4cf
\ && ucs != 0x303f)
\ || (ucs >= 0xac00 && ucs <= 0xd7a3)
\ || (ucs >= 0xf900 && ucs <= 0xfaff)
\ || (ucs >= 0xfe30 && ucs <= 0xfe6f)
\ || (ucs >= 0xff00 && ucs <= 0xff60)
\ || (ucs >= 0xffe0 && ucs <= 0xffe6)
\ || (ucs >= 0x20000 && ucs <= 0x2fffd)
\ || (ucs >= 0x30000 && ucs <= 0x3fffd)
\ ))
return 2
endif
return 1
endfunction
function! s:wcswidth(str)
let mx_first = '^\(.\)'
let str = a:str
let width = 0
while 1
let ucs = char2nr(substitute(str, mx_first, '\1', ''))
if ucs == 0
break
endif
let width = width + s:wcwidth(ucs)
let str = substitute(str, mx_first, '', '')
endwhile
return width
endfunction
function! s:truncate(str, num)
let mx_first = '^\(.\)\(.*\)$'
let str = a:str
let ret = ''
let width = 0
while 1
let char = substitute(str, mx_first, '\1', '')
let ucs = char2nr(char)
if ucs == 0
break
endif
let cells = s:wcwidth(ucs)
if width + cells > a:num
break
endif
let width = width + cells
let ret .= char
let str = substitute(str, mx_first, '\2', '')
endwhile
while width + 1 <= a:num
let ret .= " "
let width = width + 1
endwhile
return ret
endfunction
function! s:nr2byte(nr)
if a:nr < 0x80
return nr2char(a:nr)
elseif a:nr < 0x800
return nr2char(a:nr/64+192).nr2char(a:nr%64+128)
else
return nr2char(a:nr/4096%16+224).nr2char(a:nr/64%64+128).nr2char(a:nr%64+128)
endif
endfunction
function! s:nr2enc_char(charcode)
if &encoding == 'utf-8'
return nr2char(a:charcode)
endif
let char = s:nr2byte(a:charcode)
if has('iconv') && strlen(char) > 1
let char = strtrans(iconv(char, 'utf-8', &encoding))
endif
return char
endfunction
function! s:nr2hex(nr)
let n = a:nr
let r = ""
while n
let r = '0123456789ABCDEF'[n % 16] . r
let n = n / 16
endwhile
return r
endfunction
function! s:encodeURIComponent(instr)
let instr = iconv(a:instr, &enc, "utf-8")
let len = strlen(instr)
let i = 0
let outstr = ''
while i < len
let ch = instr[i]
if ch =~# '[0-9A-Za-z-._~!''()*]'
let outstr .= ch
elseif ch == ' '
let outstr .= '+'
else
let outstr .= '%' . substitute('0' . s:nr2hex(char2nr(ch)), '^.*\(..\)$', '\1', '')
endif
let i = i + 1
endwhile
return outstr
endfunction
function! s:decodeEntityReference(str)
let str = a:str
let str = substitute(str, '>', '>', 'g')
let str = substitute(str, '<', '<', 'g')
let str = substitute(str, '"', '"', 'g')
let str = substitute(str, ''', "'", 'g')
let str = substitute(str, ' ', ' ', 'g')
let str = substitute(str, '¥', '\¥', 'g')
let str = substitute(str, '&#\(\d\+\);', '\=s:nr2enc_char(submatch(1))', 'g')
let str = substitute(str, '&', '\&', 'g')
return str
endfunction
function! s:WebAccess(url, getdata, postdata, cookie, returnheader)
let url = a:url
let getdata = ''
for key in keys(a:getdata)
if len(getdata)
let getdata .= "&"
endif
let getdata .= key . "=" . s:encodeURIComponent(a:getdata[key])
endfor
let postdata = ''
for key in keys(a:postdata)
if len(postdata)
let postdata .= "&"
endif
let postdata .= key . "=" . s:encodeURIComponent(a:postdata[key])
endfor
let cookie = ''
for key in keys(a:cookie)
let cookie .= " -b " . key . "=" . s:encodeURIComponent(a:cookie[key])
endfor
if len(getdata)
let url .= "?" . getdata
endif
let command = "curl -s -k"
if a:returnheader
let command .= " -i"
endif
if len(postdata)
let file = tempname()
exec 'redir! > '.file
silent echo postdata
redir END
let quote = &shellxquote == '"' ? "'" : '"'
let res = system(command . " -d @" . quote.file.quote . cookie . " \"" . url . "\"")
call delete(file)
else
let res = system(command . " " . cookie . " \"" . url . "\"")
endif
return res
endfunction
function! s:FormatEntry(str)
let mx_id = '^.*<id[^>]*>\(.*\)</id>.*$'
let mx_source = '^\(.*\)<source[^>]*>\(.*\)</source>\(.*\)$'
let mx_url = '^.*<link rel="alternate" href="\([^"]\+\)".*$'
let mx_title = '^.*<title[^>]*>\(.*\)</title>.*$'
let mx_content = '^.*<content[^>]*>\(.*\)</content>.*$'
let mx_summary = '^.*<summary[^>]*>\(.*\)</summary>.*$'
let mx_author = '^.*<author[^>]*><name[^>]*>\([^<]*\)</name></author>.*$'
let mx_published = '^.*<published>\([^<]*\)</published>.*$'
let mx_readed = '^.*<category.\{-} label="read"/>.*$'
let mx_starred = '^.*<category.\{-} label="starred"/>.*$'
let str = substitute(a:str, mx_source, '\1\3', '')
let id = substitute(matchstr(str, mx_id), mx_id, '\1', '')
let id = s:decodeEntityReference(id)
let url = substitute(matchstr(str, mx_url), mx_url, '\1', '')
let url = s:decodeEntityReference(url)
let author = substitute(matchstr(str, mx_author), mx_author, '\1', '')
let author = s:decodeEntityReference(author)
let published = substitute(matchstr(str, mx_published), mx_published, '\1', '')
let title = substitute(matchstr(str, mx_title), mx_title, '\1', '')
let title = substitute(title, '^<!\[CDATA\[\(.*\)\]\]>$', '\1', 'g')
let title = s:decodeEntityReference(title)
let title = substitute(title, '<[^>]\+>', '', 'g')
let title = s:decodeEntityReference(title)
let source = substitute(a:str, mx_source, '\2', '')
let source = substitute(source, mx_title, '\1', '')
let source = substitute(source, '^<!\[CDATA\[\(.*\)\]\]>$', '\1', 'g')
let source = s:decodeEntityReference(source)
let source = substitute(source, '<[^>]\+>', '', 'g')
let source = s:decodeEntityReference(source)
let content = substitute(matchstr(str, mx_content), mx_content, '\1', '')
if len(content) == 0
let content = substitute(matchstr(str, mx_summary), mx_summary, '\1', '')
endif
let content = substitute(content, '^<!\[CDATA\[\(.*\)\]\]>$', '\1', 'g')
let content = s:decodeEntityReference(content)
let content = substitute(content, '\(<br[^>]*>\|<p[^>]*>\|</p[^>]*>\)', "\r", 'g')
let content = substitute(content, '<[^>]\+>', '', 'g')
let content = substitute(content, '^ *', '', '')
let content = s:decodeEntityReference(content)
let readed = len(matchstr(str, mx_readed)) > 0 ? 1 : 0
let starred = len(matchstr(str, mx_starred)) > 0 ? 1 : 0
return {"id": id, "title": title, "source": source, "url": url, "content": content, "author": author, "published": published, "readed": readed, "starred": starred}
endfunction
function! s:SetStarred(id, star)
if !exists("s:sid")
let s:sid = substitute(s:WebAccess("https://www.google.com/accounts/ClientLogin", {}, {"Email": a:email, "Passwd": a:passwd, "source": "googlereader.vim", "service": "reader"}, {}, 0), '^SID=\([^\x0a]*\).*', '\1', '')
endif
if !exists("s:token")
let s:token = s:WebAccess("http://www.google.com/reader/api/0/token", {}, {}, {"SID": s:sid}, 0)
endif
if a:star
let opt = {'a': 'user/-/state/com.google/starred', 'ac': 'edit-tags', 'i': a:id, 's': 'user/-/state/com.google/reading-list', 'T': s:token}
else
let opt = {'r': 'user/-/state/com.google/starred', 'ac': 'edit-tags', 'i': a:id, 's': 'user/-/state/com.google/reading-list', 'T': s:token}
endif
return s:WebAccess("http://www.google.com/reader/api/0/edit-tag", {}, opt, {"SID": s:sid}, 0)
endfunction
function! s:SetReaded(id, readed)
if !exists("s:sid")
let s:sid = substitute(s:WebAccess("https://www.google.com/accounts/ClientLogin", {}, {"Email": a:email, "Passwd": a:passwd, "source": "googlereader.vim", "service": "reader"}, {}, 0), '^SID=\([^\x0a]*\).*', '\1', '')
endif
if !exists("s:token")
let s:token = s:WebAccess("http://www.google.com/reader/api/0/token", {}, {}, {"SID": s:sid}, 0)
endif
if a:readed
let opt = {'a': 'user/-/state/com.google/read', 'ac': 'edit-tags', 'i': a:id, 's': 'user/-/state/com.google/reading-list', 'r': 'user/-/state/com.google/kept-unread', 'T': s:token}
else
let opt = {'a': 'user/-/state/com.google/kept-unread', 'ac': 'edit-tags', 'i': a:id, 's': 'user/-/state/com.google/reading-list', 'r': 'user/-/state/com.google/read', 'T': s:token}
endif
return s:WebAccess("http://www.google.com/reader/api/0/edit-tag", {}, opt, {"SID": s:sid}, 0)
endfunction
function! s:GetEntries(email, passwd, opt)
if !exists("s:sid")
let s:sid = substitute(s:WebAccess("https://www.google.com/accounts/ClientLogin", {}, {"Email": a:email, "Passwd": a:passwd, "source": "googlereader.vim", "service": "reader"}, {}, 0), '^SID=\([^\x0a]*\).*', '\1', '')
endif
if !exists("s:token")
let s:token = s:WebAccess("http://www.google.com/reader/api/0/token", {}, {}, {"SID": s:sid}, 0)
endif
if !has_key(a:opt, "n")
let a:opt["n"] = 50
endif
if !has_key(a:opt, "xt")
let a:opt["xt"] = "user/-/state/com.google/read"
endif
let a:opt["ck"] = localtime()*1000
let opt = copy(a:opt)
if len(opt["xt"]) == 0
call remove(opt, "xt")
endif
let feed = s:WebAccess("http://www.google.com/reader/atom/user/-/state/com.google/reading-list", opt, {}, {"SID": s:sid, "T": s:token}, 0)
let feed = iconv(feed, "utf-8", &encoding)
let feed = substitute(feed, '<', "\r<", 'g')
let feed = substitute(feed, '\(<entry[^>]*>.\{-}</entry>\)', '\=substitute(submatch(1), "[\r\n]", "", "g")', 'g')
let feed = substitute(feed, '>\s*<', '><', 'g')
return map(filter(split(feed, "\r"), 'v:val =~ "^<entry"'), 's:FormatEntry(v:val)')
endfunction
function! s:ShowEntry()
let bufname = s:LIST_BUFNAME
let winnr = bufwinnr(bufname)
if winnr > 0 && winnr != winnr()
execute winnr.'wincmd w'
endif
let str = getline('.')
let mx_row_mark = '^\(\d\+\)\(: \)\([\* ]\)\([U ]\)\( .*\)'
let row = str2nr(substitute(matchstr(str, mx_row_mark), mx_row_mark, '\1', '')) - 1
let starred = substitute(matchstr(str, mx_row_mark), mx_row_mark, '\3', '')
let readed = substitute(matchstr(str, mx_row_mark), mx_row_mark, '\4', '')
let bufname = s:CONTENT_BUFNAME
let winnr = bufwinnr(bufname)
if winnr < 1
if bufname('%').'X' ==# 'X' && &modified == 0
silent! edit `=bufname`
else
let height = winheight('.') * 7 / 10
silent! exec 'belowright '.height.'new `=bufname`'
endif
else
if winnr != winnr()
execute winnr.'wincmd w'
endif
endif
setlocal buftype=nofile bufhidden=hide noswapfile nowrap ft= nonumber modifiable
silent! %d _
redraw!
let entry = s:entries[row]
if readed == 'U'
call s:ToggleReaded()
endif
call setline(1, printf("Source: %s", entry['source']))
call setline(2, printf("Title: %s", entry['title']))
call setline(3, printf("URL: %s", entry['url']))
call setline(4, printf("Publish: %s", entry['published']))
call setline(5, printf("Author: %s", entry['author']))
call setline(6, "---------------------------------------------")
normal! G
call setline(7, entry['content'])
silent! %s/\r/\r/g
silent! normal! 7GVGgq
setlocal nomodifiable
syntax match SpecialKey /^\(Source\|Title\|URL\|Publish\|Author\):/he=e-1
nnoremap <silent> <buffer> <space> <c-d>
nnoremap <silent> <buffer> q :bw!<cr>
exec 'nnoremap <silent> <buffer> <c-p> :call <SID>ShowPrevEntry()<cr>'
exec 'nnoremap <silent> <buffer> <c-n> :call <SID>ShowNextEntry()<cr>'
exec 'nnoremap <silent> <buffer> <c-i> :call <SID>ShowEntryInBrowser()<cr>'
exec 'nnoremap <silent> <buffer> <c-t> :call <SID>ToggleReaded()<cr>'
exec 'nnoremap <silent> <buffer> <s-s> :call <SID>ToggleStarred()<cr>'
exec 'nnoremap <silent> <buffer> ? :call <SID>Help()<cr>'
let b:id = entry['id']
let b:url = entry['url']
let b:readed = entry['readed']
normal! gg
endfunction
function! s:ShowEntryInBrowser()
let bufname = s:CONTENT_BUFNAME
let winnr = bufwinnr(bufname)
if winnr < 1
return
endif
if winnr != winnr()
execute winnr.'wincmd w'
endif
if has('win32')
silent! exec "!start rundll32 url.dll,FileProtocolHandler ".escape(b:url ,'#')
elseif has('mac')
silent! exec "!open ".escape(b:url ,'#')
else
system("firefox '".b:url."' 2>&1 > /dev/null &")
endif
endfunction
function! s:ShowPrevEntry()
let bufname = s:CONTENT_BUFNAME
let winnr = bufwinnr(bufname)
if winnr < 1
return
endif
if winnr != winnr()
execute winnr.'wincmd w'
endif
let bufname = s:LIST_BUFNAME
let winnr = bufwinnr(bufname)
if winnr > 0 && winnr != winnr()
execute winnr.'wincmd w'
normal! k
call s:ShowEntry()
endif
endfunction
function! s:ShowNextEntry()
let bufname = s:CONTENT_BUFNAME
let winnr = bufwinnr(bufname)
if winnr < 1
return
endif
if winnr != winnr()
execute winnr.'wincmd w'
endif
let bufname = s:LIST_BUFNAME
let winnr = bufwinnr(bufname)
if winnr > 0 && winnr != winnr()
execute winnr.'wincmd w'
normal! j
call s:ShowEntry()
endif
endfunction
function! s:ToggleStarred()
let bufname = s:LIST_BUFNAME
let winnr = bufwinnr(bufname)
let oldwinnr = winnr()
if winnr > 0 && winnr != oldwinnr
execute winnr.'wincmd w'
endif
let str = getline('.')
let mx_row_mark = '^\(\d\+\)\(: \)\([\* ]\)\([U ]\)\( .*\)'
let row = str2nr(substitute(matchstr(str, mx_row_mark), mx_row_mark, '\1', '')) - 1
let starred = substitute(matchstr(str, mx_row_mark), mx_row_mark, '\3', '')
let readed = substitute(matchstr(str, mx_row_mark), mx_row_mark, '\4', '')
let entry = s:entries[row]
if s:SetStarred(entry['id'], (starred == '*' ? 0 : 1)) == "OK"
let str = substitute(matchstr(str, mx_row_mark), mx_row_mark, '\1\2'.(starred == '*' ? ' ' : '*').readed.'\5', '')
let oldmodifiable = &l:modifiable
setlocal modifiable
call setline(line('.'), str)
let &l:modifiable = oldmodifiable
else
echoerr "GoogleReader: failed to mark star or unstar"
endif
if winnr > 0 && winnr != oldwinnr
wincmd p
endif
endfunction
function! s:ToggleReaded()
let bufname = s:LIST_BUFNAME
let winnr = bufwinnr(bufname)
let oldwinnr = winnr()
if winnr > 0 && winnr != oldwinnr
execute winnr.'wincmd w'
endif
let str = getline('.')
let mx_row_mark = '^\(\d\+\)\(: \)\([\* ]\)\([U ]\)\( .*\)'
let row = str2nr(substitute(matchstr(str, mx_row_mark), mx_row_mark, '\1', '')) - 1
let starred = substitute(matchstr(str, mx_row_mark), mx_row_mark, '\3', '')
let readed = substitute(matchstr(str, mx_row_mark), mx_row_mark, '\4', '')
let entry = s:entries[row]
if s:SetReaded(entry['id'], (readed == 'U' ? 1 : 0)) == "OK"
let str = substitute(matchstr(str, mx_row_mark), mx_row_mark, '\1\2'.starred.(readed == 'U' ? ' ' : 'U').'\5', '')
let oldmodifiable = &l:modifiable
setlocal modifiable
call setline(line('.'), str)
let &l:modifiable = oldmodifiable
endif
if winnr > 0 && winnr != oldwinnr
wincmd p
endif
endfunction
function! s:ShowEntries(opt)
if exists("g:googlereader_email")
let email = g:googlereader_email
else
let email = input('GoogleReader email:')
endif
if exists("g:googlereader_passwd")
let passwd = g:googlereader_passwd
else
let passwd = inputsecret('GoogleReader password:')
endif
if len(email) == 0 || len(passwd) == 0
echohl WarningMsg
echo "authentication required for GoogleReader."
echohl None
return
end
let bufname = s:LIST_BUFNAME
let winnr = bufwinnr(bufname)
if winnr < 1
if &modified == 0
silent! edit `=bufname`
else
silent! belowright new `=bufname`
endif
else
if winnr != winnr()
execute winnr.'wincmd w'
endif
endif
setlocal buftype=nofile bufhidden=hide noswapfile nowrap ft= nonumber modifiable cursorline
silent! %d _
redraw!
if !exists('b:xt')
let b:xt = 'user/-/state/com.google/read'
endif
if !has_key(a:opt, 'xt')
let a:opt['xt'] = b:xt
endif
let b:xt = a:opt['xt']
if len(a:opt['xt'])
echo "reading unread entries..."
else
echo "reading full entries..."
endif
let s:entries = s:GetEntries(email, passwd, a:opt)
let cnt = 1
for l:entry in s:entries
let source = s:truncate(l:entry['source'], 20)
call setline(cnt, printf("%03d: %s%s %s %s", cnt, (l:entry['starred'] == 1 ? '*' : ' '), (l:entry['readed'] == 1 ? ' ' : 'U'), source, l:entry['title']))
let cnt = cnt + 1
endfor
setlocal nomodifiable
syntax match SpecialKey /^\d\+:/he=e-1
exec 'nnoremap <silent> <buffer> <cr> :call <SID>ShowEntry()<cr>'
exec 'nnoremap <silent> <buffer> r :call <SID>ShowEntries({})<cr>'
exec 'nnoremap <silent> <buffer> <s-a> :call <SID>ShowEntries({"xt": "user/-/state/com.google/read"})<cr>'
exec 'nnoremap <silent> <buffer> <c-a> :call <SID>ShowEntries({"xt": ""})<cr>'
exec 'nnoremap <silent> <buffer> <c-t> :call <SID>ToggleReaded()<cr>'
exec 'nnoremap <silent> <buffer> <s-s> :call <SID>ToggleStarred()<cr>'
exec 'nnoremap <silent> <buffer> ? :call <SID>Help()<cr>'
nnoremap <silent> <buffer> <c-n> j
nnoremap <silent> <buffer> <c-p> k
nnoremap <silent> <buffer> q :bw!<cr>
normal! gg
redraw!
echo ""
endfunction
function! s:Help()
echohl None
echo 'GoogleReader.vim version ' . g:googlereader_vim_version
echohl Title
echo '[LIST]'
echohl SpecialKey
echo '<c-n> : goto next and open entry'
echo '<c-p> : goto prev and open entry'
echo '<cr> : show the entry'
echo '<c-a> : show all list'
echo '<s-a> : show unread list'
echo '<c-t> : toggle read/unread mark'
echo '<s-s> : toggle star/unstar mark'
echo 'r : reload entries'
echo 'q : close window'
echohl Title
echo '[LIST]'
echohl SpecialKey
echo '<c-n> : show next entry'
echo '<c-p> : show prev entry'
echo '<c-i> : open URL with browser'
echo 'q : close window'
echohl MoreMsg
echo "[Hit any key]"
echohl None
call getchar()
redraw!
endfunction
function! s:GoogleReader()
call s:ShowEntries({"xt": ""})
endfunction
command! GoogleReader call s:GoogleReader()
" vim:set et