Skip navigation

Charlie Harvey

| Back to navigation

Pages

Index / Geekery / Vim tip - Preview webpage source

Permalink

Vim tip - Preview webpage source

Here's a neat little trick for people who have a *nix setup, vim and lynx browser. I've remapped my F8 Key to use lynx to dump the nicely formatted source of a web page in a new window. Useful for testing if your site is working. In my .vimrc I added the following lines:

" split at the bottom of the screen
set sb
" map F9 to open the new window, and type the lynx command for you
noremap <F8> :10sp /dev/null<CR>:r! lynx -prettysrc -source http://
" well, you have to be able to refresh!
noremap <F5> :%s/.//<CR>:r! lynx -pretty<UP><CR>gg0"

Comments

RSS   All comments on Vim tip - Preview webpage source

Leave your comment?

  • You can use strong, em, code, pre, q and a HTML tags.
  • Fields in bold are compulsory
  • Be respectful. You may want to read the comment guidelines before posting.






Privacy note: This form will forward your IP address, user agent and referrer to the Akismet, StopForumSpam and Botscout spam filtering services. I don't log these details. Those services will. I do log everything you type into the form. Full privacy statement.

Reactions

Tweet it: 43 | Digg it: 43




Author: Charlie Harvey

Updated: 2009-06-14T12:23:45