Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm currently editing some websites. What I usually do is edit the html/css files in vim (from the command line) and then preview them in Safari (and intermittently in firefox an chrome to see if that also works).

Yet I was updating my website to use the SSI capabilities my new web host offers. Eg. I'm SSI-ing my menu code, instead of loading it in an iframe. This however requires every link in the menu to be an absolute path /style/menu.css instead of ../style/menu.css (where the path was modified depending on the location).

This however breaks my offline viewing capabilities: ignoring the fact that I cannot view anything that uses SSI when previewing the files, I cannot view anything using the absolute paths. This means that nothing on my website is formatted as should be (the css files can't be found). This is because my browser goes looking in the local directory / instead of the location where the file is actually stored.

Is there a method that allows me to still preview changes offline? I would prefer something that still allows me to use vim, since vim is awesome.

I'm on mac.

share|improve this question
up vote 2 down vote accepted

Honestly, nothing beats having a local apache instance... and editing files in VIM. Once installed, it takes only a minute to setup additional "sites" so you can have dozens of private websites running on your machine that only you have access to... until you upload it to a production server.

share|improve this answer
how would I go about doing this? Would this support SSI (which would be awesome!)? – romeovs Jan 25 '12 at 18:02
Download and install apache. Configure to taste... and yes... it would support SSI, as it is a full-blown apache server. – TheCompWiz Jan 25 '12 at 18:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .