History Report a problem
Article Edit this page Discussion

Preview file on localhost

From Vim Tips Wiki

(Redirected from VimTip1015)
Jump to: navigation, search
 

[edit] Duplicate tip

This tip is very similar to the following:

These tips need to be merged – see the merge guidelines.

Tip 1015Previous TipNext Tip

Created: October 8, 2005 Complexity: basic Author: JA Minimum version: 5.7 Karma: -2/7 Imported from: Tip#1015


Try this mapping in your vimrc to

  • Save the current file.
  • Preview it on localhost.

Edit the number of */ to fit your localhost installation, that is, how much of the path to strip from the left.

It also assumes the file you are editing is within your localhost installation. I have only tested it in bash.

map <F8> :w^M:!mozilla `echo http://localhost/${PWD\#*/*/*/*/}/%`^M

[edit] Comments


Rate this article:

Share this article:

Hubs Highlights International Sites Wikia messages
Entertainment
Gaming
Cartoons & Comics
Science Fiction
Hobbies
Sports
See all...
Grand Theft Auto
Terminator Wiki
Legend of Zelda Wiki
Flash Gordon
Everquest II Wiki
Yo-Yo Wiki
German
Spanish
Chinese
Japanese
More...
Wikia is hiring for several open positions
Send this article to a friend
"Preview file on localhost"
 
 
Hi!

I thought you'd like this page from Wikia!

http://vim.wikia.com

Come check it out!
Send confirmation