views:

146

answers:

3

I've been using VIM for a few weeks now while messing with various web languages and I'm really enjoying it.

I find it cumbersome having to tab or click into my browser and refresh the page to see the effect of a code change. It's even more annoying as I'm using Virtual Box and I tend to be working from PDF files on the host system so I have limited window space.

Do you gurus have any fancy ways of doing this? I was wondering if it's possible to split the VIM workspace and have links/lynx in a window of its own or something to that effect?

edit:

out of curiosity, if anyone is still glancing at this:-

is it possible to execute a browser from vim and load a URL based on a variable of sorts?

:! firefox http://localhost/bla/$CURRENTWORKINGFILE

sort of thing?

+5  A: 

If you are developing locally where no one cares, how about setting some JS to refresh the page?

<script>
setTimeout(function() { location.reload() }, 60000 );
</script>

That way you can keep working in vim and take a glance at the web page every min or so to see it refresh. This should work for most web pages.

I do this on dual monitors by leaving VIM open on one monitor and the browser on the other.

meder
+2  A: 

I don't know how to do this in specific, but I know of two plugins which let you communicate with a shell from within VIM:

Joshua
+2  A: 

Use an app called XRefresh.

Somebody still uses you MS-DOS
This looks excellent, although it appears to be for windows only?I shall make use of it non-the-less as I'm switching between different environments and trying to find a comfort zone. :)
aLostMonkey
I've found this extension for Chrome as well, using Ruby. It shall work in Linux. Search for "XRefresh" on github.
Somebody still uses you MS-DOS