Preview file on localhost
From Vim Tips Wiki
(Redirected from VimTip1015)
[edit] Duplicate tip
This tip is very similar to the following:
These tips need to be merged – see the merge guidelines.
Tip 1015 • Previous Tip • Next 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
Categories: Duplicate | Review | VimTip
