See https://github.com/mharju/vim-fiddle for a similar project (but I believe Mac only).
- Selenium
- Vim with python 2 support (check with :python print "hello")
- The selenium Python driver (included)
- For jslint integration, a working jslint command (on my system, I use node.js + npm install jslint -g)
- A web server to host the fiddles (for instance apache)
- A "fiddle" consists of a
index.html
file and acode.js
file - When either file is saved, vimfiddler refreshes the browser (via selenium)
- jslint integration, hit F4 to jslint the current file.
- Unpack vimfiddler in ~/public_html (or use a symbolic link)
- You need Selenium Server from http://seleniumhq/download/
- On my system, the command
selenium
starts the selenium server. If your system is different, editfiddler.vim
- On my system, the command
jslint
starts jslint, if your system is different, editfiddler.vim
. - Edit
fiddler.vim
to use a different browser. The default is*firefox
. Use*googlechrome
to use Chrome.
Video: http://vimeo.com/32148952
Start vim
In Vim:
:source fiddler.vim :StartSeleniumServer :StartSeleniumClient :OpenFiddle example or :NewFiddle Name: <enter fiddle name> Use template: default
When either
code.js
orindex.html
is saved, Vim will tell selenium to refresh the page.