"=====================================================================
" cream-filetype-html.vim
"
" Cream -- An easy-to-use configuration of the famous Vim text editor
" [ http://cream.sourceforge.net ] Copyright (C) 2001-2006 Steve Hall
"
" License:
" This program is free software; you can redistribute it and/or modify
" it under the terms of the GNU General Public License as published by
" the Free Software Foundation; either version 2 of the License, or
" (at your option) any later version.
" [ http://www.gnu.org/licenses/gpl.html ]
"
" This program is distributed in the hope that it will be useful, but
" WITHOUT ANY WARRANTY; without even the implied warranty of
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
" General Public License for more details.
"
" You should have received a copy of the GNU General Public License
" along with this program; if not, write to the Free Software
" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
" 02111-1307, USA.
"
" Notes:
" * We've reserved Alt+[letter] combinations for language specific functions.
" * This stuff belongs in other (individual?) files, perhaps loadable from the menu.
setlocal commentstring=
setlocal comments+=s1:\
" we do not like Vim's autoindent in HTML!
setlocal indentexpr=""
setlocal noautoindent
"" Insert HTML
item
"imap
" Insert HTML structure
"*** BROKEN: is the mapping for single command mode!! ***
"imap
"" Insert HTML structure
"" * Note: "" doesn't work.
"imap
"" Insert HTML pair
"imap :call Cream_html_bold()
"function! Cream_html_bold()
" normal i
" normal hhh
"endfunction
" Insert HTML pair, pasting selection within
vmap :call Cream_html_bold_select("v")
function! Cream_html_bold_select(mode)
if a:mode == "v"
normal gv
else
return
endif
" cut
normal "xx
let @x = "\" . @x . "\"
normal "xP
" re-select
normal gv
" adjust for added chars inserted
normal o
execute "normal lll"
normal o
execute "normal lll"
normal o
endfunction
"" Insert HTML pair
""*** Broken *** (interfering with [Tab])
""imap :call Cream_html_italicize()
"function! Cream_html_italicize()
" normal i
" normal hhh
"endfunction
" Insert HTML pair, pasting selection within
"*** Broken *** (interfering with [Tab])
"vmap "xxh:call Cream_html_italicize_select()
function! Cream_html_italicize_select()
let mystr = @x
let mystr = "\" . mystr . "\"
let @x = mystr
normal "xp
" now re-select, and adjust for added chars inserted
normal gv
normal o
execute "normal lll"
normal O
execute "normal lll"
normal o
endfunction
"*** BROKEN: Conflicts with other :call... stuff
""" Insert HTML pair
""imap :call Cream_html_underline()
""function! Cream_html_underline()
"" normal i
"" normal hhh
""endfunction
"" Insert HTML pair, pasting selection within
"vmap "xxh:call Cream_html_underline_select()
"function! Cream_html_underline_select()
" let mystr = @x
" let mystr = "\" . mystr . "\"
" let @x = mystr
" normal "xp
" " now re-select, and adjust for added chars inserted
" normal gv
" normal o
" execute "normal lll"
" normal O
" execute "normal lll"
" normal o
"endfunction
"***
"" Insert " "
""nmap i
"imap
"" Insert header ()
"imap
"imap
"imap
"imap
"imap
"imap
"" Insert HTML
""nmap i
"imap
""vmap i
" HTML Character Equivalences
"" ">" to ">" (remember, this is [Alt]+[Shift]+[.] ;)
"imap <
"" "<" to "<" (remember, this is [Alt]+[Shift]+[,] ;)
"imap > >
"" "&" to "&"
"imap &
"" """ to """
"imap "