XIncludes, was: Re: [Petal] Petal 0.80 released

William McKee william at knowmad.com
Wed Jan 22 15:18:02 GMT 2003


On Wed, Jan 22, 2003 at 06:17:47PM +0000, Chris Croome wrote:
> :!xmllint filename.html
> 
> (If I actually knew what I was doing with vim i'd no doubt have a
> key binding...)

nmap <f5> :cd %:p:h \| !xmllint %:t<cr>
imap <f5> :cd %:p:h \| !xmllint %:t<cr>

Those will map the F5 function key to cd to the current directory of the
open file then run xmllint on that file in both insert mode (imap) and
normal mode (nmap). You may also want to only enable these when you
enter a buffer with a *.html file like so:

autocmd BufEnter *.html,*.htm,*.tmpl nmap <f5> .....
autocmd BufEnter *.html,*.htm,*.tmpl imap <f5> .....

See ':h map-overview' for more details. Check out vim.sf.net for lots of
helpful tips and scripts from people far smarter than me!

Happy Vimming!
William

-- 
Knowmad Services Inc.
http://www.knowmad.com



More information about the Petal mailing list