" =================================================================== " HTML - HTML - HTML - HTML - HTML - HTML - HTML - HTML " =================================================================== " " File: $HOME/vim/src/html.vim " This file: " Purpose: Setup file for the editor Vim for Webpage/HTML editing " Author: Sven Guckes guckes@vim.org (guckes@math.fu-berlin.de) " " Comments: See also: " Please send comments to me - email preferred! " Last update: Sun Jan 14 04:36:15 MET 2001 " " HTML = HyperText Markup Language - the language of the World Wide Web " " =================================================================== " HTML - useful abbreviations " =================================================================== " Start a page: iab Yhtml

" " YWWW The start of a typical Web address: iab YWWW http://www. " " =================================================================== " HTML - working on files " =================================================================== " " Whenever I edit a web page I use ",e" to start the edit command. " And I use ",rn" to read in a web page template: " ,e = edit www file nmap ,e :e ~/.P/ " NOTE: The directory ~/.P is a link to the directory with my webpages. " the name is short so it will be short for the output of ":ls". " " I used ",e" for the command here before, but this was part of the " default string for "highlight", so while entering the default " string the ",e" it got expanded. Darn! " " ,rm = read mailto (standard html file for a mailto link to my address) " map ,rm :r ~/.P/txt/mailto.html " " ,rn = read new-page (standard html file for a new web page) " see http://www.math.fu-berlin.de/~guckes/txt/New.page.form.html map ,rn :0r ~/.P/txt/New.page.form.html " " ,p = make current file public readable nmap ,p :!chmod 644 % " " =================================================================== " wb - white body " include a body tage with white background iab Ywb " =================================================================== " " =================================================================== " HTML - Inserting "single" tags " =================================================================== " iab Ybr
iab Yhr
iab Yp

" " =================================================================== " HTML - making environments " =================================================================== " " HTML - make current word an HTML environment map ,me yiwi<ea>"> " " =================================================================== " HTML - inserting environments " =================================================================== " " Comment: iab Ycom FXs " vmap ,com ``>i--> " always comment *whole* lines blocks): vmap ,com ``>o--> " " =================================================================== " HTML - changing the appearance/font of text " =================================================================== " " BlockQuoted Text: iab Ybl

T>i " vmap ,bl "zdi
z
2F> " " Bold text: iab Yb T>i vmap ,b "zdiz2F> " " Center Inline Text: iab Ycen
T>i vmap ,cen "zdi
z
?> " " Center Text Blocks: iab YCen
O vmap ,Cen ''>o " " Code in Text: iab Ycod T>i vmap ,cod "zdiz2F> "ORIGINAL: vmap ,cod "zdizT>i " " Italic Text: iab Yi T>i vmap ,i "zdizT> " " Typewriter Type: iab Ytt T>i vmap ,tt "zdizT> " Added by okie " Angle brackets: iab Yang < >T;s vmap ,ang "zdi<z>T; " Added by okie " Superscript Type: iab Ysup T>s vmap ,sup "zdizT> " Added by okie " Subscript Type: iab Ysub T>s vmap ,sub "zdizT> " " =================================================================== " HTML - Preserving Text Structure " =================================================================== " " Preserve Text Formatting *with* interpretation of HTML: iab Ypre
T>i
" vmap ,pre "zdi
z
T> vmap ,pre mz:''>o`z " " Preserve Text Formatting without interpretation of HTML: " Insert environment iab Yxmp T>i " vmap ,xmp "zdi<C-M><C-R>z<C-M>T>i vmap ,xmp mz:''>o`z " " =================================================================== " HTML - Making Tables " =================================================================== " " Table Data iab Ytd T>i vmap ,td "zdizT> " Table Row iab Ytr T>i vmap ,tr "zdizT>i " " " =================================================================== " HTML - Making Header Lines (h1 to h6) " =================================================================== " iab Yh1

T>i vmap ,h1 "zdi

z

2F> iab Yh2

T>i vmap ,h2 "zdi

z

2F> iab Yh3

T>i vmap ,h3 "zdi

z

2F> iab Yh4

T>i vmap ,h4 "zdi

z

2F> iab Yh5
T>i vmap ,h5 "zdi
z
2F> iab Yh6
T>i vmap ,h6 "zdi
z
2F> " " =================================================================== " HTML - Making Lists and List Items " =================================================================== " " Insert "ordered list" with one list element " "Added by nokie iab Yol
kkA " iab Yol
k " OLD VERSION " Insert "unordered list" with one list element "Added by nokie iab Yul
kkA " iab Yul
k " OLD VERSION " Insert "decsription list" with one list element " iab Ydl

4kA iab Ydl

5kA " " Insert "list" item (for both ordered and unordered list) "Added by nokie " iab Yli
  • " Old version removed by nokie " iab Yli
  • kA " An old version: on separate lines iab Yli
  • T>i vmap ,li mz:''>o`z " Insert "description list" item iab Ydt

    kA iab Ydp

    kkkA " " =================================================================== " HTML - Making Links " =================================================================== " " " A HREF (HTML 2.0) " insert "generic link" iab Yhref ?""a vmap ,href "zdizF"i " " make current URL a link: vmap ,link "zdi>zF"i " " add link to current text: vmap ,text "zdizF"i " " A NAME (HTML-2.0) iab Yname ?""a vmap ,name "zdi>z2F> " " Insert/make link to image iab Yimg [] align= src="">?""a " " 000811 " Insert a link to an image with a thumbnail iab YIMG align=right src=""> " " Insert/make mailto link iab Ymail ?:a vmap ,mail "zdi>z2F> vmap ,Mail "zdiz2F> " " Insert/make link to newsgroup iab Ynews ?:a vmap ,news "zdiz2F> " " Ypage Insert page description with a possible link and text iab Ypage page:link:text:kkA " " " For adding descriptions and keywords to important pages: " " " " Colorizing Text " " ,Cblu = colorize the selection with color "blue" vmap ,Cblu "zdiz " ,Cgre = colorize the selection with color "green" vmap ,Cgre "zdiz " ,Cred = colorize the selection with color "red" vmap ,Cred "zdiz " " =================================================================== " HTML - handling special text " =================================================================== " " HTML - inserting special characters imap ;& & imap ;K © imap ;" " imap ;< < imap ;> > " " HTML - inserting umlauts [981110] imap \Ae Ä imap \Oe Ö imap \Ue Ü imap \ae ä imap \oe ö imap \ue ü imap \ss ß " " HTML - Converting umlauts to digraphs [960430] " " cnoremap ,ae %s/ae/228/gc " cnoremap ,oe %s/oe/246/gc " cnoremap ,ue %s/ue/252/gc " cnoremap ,Ae %s/Ae/196/gc " cnoremap ,Oe %s/Oe/124/gc " cnoremap ,Ue %s/Ue/220/gc " cnoremap ,ss %s/ss/223/gc " " ,= = turn "===" into headline of size 1 nmap ,= :%s/^===\(.*\)$/

    \1<\/h1>/c " Example: " before: === New section " after:

    New section

    " " =================================================================== " HTML 3.0 " =================================================================== " environments: " ABBREV ACRONYM AU BANNER BIG BQ CAPTION CREDIT DEL DFN DIR DIV FN " HTML INS NOTE OL P Q S SMALL SUB SUP TAB V " other: " FIG LANG OVERLAY RANGE SPOT STYLE " " =================================================================== " HTML - Misc " =================================================================== " " HTML - Add closing tags to name tag " (which I forgot when I started HTML): " map ,,,, :g/^$/s/$/<\/a>/ " Example: " before: " after: " " Insert/make reference link to overview list (short"cut") iab Ycut \| >F#a vmap ,cut "zdi>z2F> " end of file vim: tw=999