root/lang/vim/misc/quicklook.vim @ 12270

Revision 12270, 356 bytes (checked in by ujihisa, 6 years ago)

lang/vim/misc/quicklook.vim: first import

Line 
1command Quicklook :call <SID>QuicklookStart()
2
3function! s:QuicklookStart()
4  ruby quicklook_run
5endfunction
6
7ruby << EOF
8def quicklook_run
9  fork {
10    filename = VIM::Buffer.current.line
11    pid = fork {
12      STDERR.reopen(File.open('/dev/null', 'w'))
13      exec ['qlmanage']*2, '-p', filename
14    }
15    sleep 2
16    Process.kill(:TERM, pid)
17  }
18end
19EOF
Note: See TracBrowser for help on using the browser.