>$ cat ~/.vim/ftplugin/html.vim " first let's be sure that % is not a valid comment string for this filetype setlocal comments-=:% " make sure there's no spaces after these, hmm? :imap ;; /%%%3s :nmap ;; /%%%3s "" buffer silent added to limit these mappings to those buffers for which they "" are called as html/php ftplugins "------insert mode mappings imap dv mz
%%%
%%%'z;; imap dc mz
%%%
%%%'z;; imap p mz

%%%

%%%'z;; imap sp mz%%%%%%'z;; imap h1 mz

%%%

%%%'z;; imap h2 mz

%%%

%%%'z;; imap h3 mz

%%%

%%%'z;; imap h4 mz

%%%

%%%'z;; imap h5 mz
%%%
%%%'z;; imap h6 mz
%%%
%%%'z;; imap an mz%%%%%%'z;; imap ah mz%%%%%%'z;; imap bo mz%%% %%%'z;; imap it mz%%% %%%'z;; imap st mz%%% %%%'z;; imap em mz%%% %%%'z;; imap ul mz
    %%%
%%%'z;;li imap ol mz
    %%%
%%%'z;;li imap li mz
  • %%%
  • %%%'z;; imap dl mz
    %%%
    %%%'z;;dt imap dd mz
    %%%
    %%%'z;; imap dt mz
    %%%
    %%%'z;; imap tabl mz%%%
    %%%'z;; imap td mz%%%%%%'z;; imap tr mz%%%%%%'z;; imap th mz%%%%%%'z;; imap cap mz%%%%%%'z;; imap form
    kko imap fs mz
    %%%%%%
    %%%'z;; imap lb mz%%%'z;; imap ipte 12F"a imap ipta 8F"a imap op F>a imap add
    F>a imap ac F"i imap ab F"i imap bl mz
    %%%
    %%%'z;; imap q F>a imap tt mz%%%%%%'z;; imap pre
    ?>a imap sup mz%%% %%%'z;; imap sub mz%%% %%%'z;; imap del 3F"i imap ins 3F"i imap scr mz%%%'z;; imap nos F>a imap sty ?FIXMEve imap lsty ?FIXMEve imap ob mz'zf"a imap prm 3F"i " NOTE: border="0" is not allowed for HTML 4.01 Strict -- use CSS class instead: " .noBorder {border: 0;} " or use: " a img {border: 0;} " to mark all link images borderless imap img mz%%%'z;; imap imi mz%%%'z;; imap imc mz%%%'z;; " ampersands are a pain imap & & imap - – imap -- — imap deg ° imap rsq ’ imap lsq ‘ imap rdq ” imap ldq “ imap " " "------normal mode mappings nmap ,mp ^i

    A

    ^ nmap ,hp a

    bba nmap ,hx wbFf nmap ,ht wbieabb nmap ,hs wbieabb nmap ,hu wbieabb nmap ,hi wbieabb nmap ,he wbieabb nmap ,hb wbieabb nmap ,h6 _i
    A
    ^ nmap ,h5 _i
    A
    ^ nmap ,h4 _i

    A

    ^ nmap ,h3 _i

    A

    ^ nmap ,h2 _i

    A

    ^ nmap ,h1 _i

    A

    ^ nmap ,mh wbgueyei<ea>pa>bba nmap ,li ^i
  • A
  • ^4l nmap ,dt _i
    A
    nmap ,dd _i
    A
    nmap ,op ^i nmap ,lb I nmap ,ah _iA nmap ,td _iAj nmap ,th _iAj nmap ,tr _Oj==o "------visual mode mappings vmap ;dc `>a` vmap ;dv `>a` vmap ;ul `>a` vmap ;ol `>a` vmap ;dl `>a` vmap ;li `>a` vmap ;al y`>a/">`F" vmap ;at `>a`3F" vmap ;ao `>a`3F" vmap ;ap `>a

    `F/i vmap ;inp `>a">

    `hi vmap ;op `>a` vmap ;bo `>a` vmap ;st `>a` vmap ;it `>a` vmap ;em `>a` vmap ;qw `>a"` vmap ;sup `>a` vmap ;sub `>a` vmap ;del `>a` vmap ;ins `>a` " 'inner paragraph' such as when you need to wrap text already inside a
    ...
    with

    ...

    vmap ;ip `>a

    ` vmap q `>a` vmap ;tr `>a`gvj== vmap ;td `>a` vmap ;th `>a` "------abbreviations ab dt4s ab dt4t ab dt4f ab dt32 " be sure you know what you're doing before using xhtml -- neither IE6 nor IE7 support application/xhtml+xml content-type -at all- ab dtxh ab dtxt ab dtxf ab mctlat1 ab mctutf ab mgen ab lmade ab tpcs type="text/css" ab tpjs type="text/javascript" "------- personalization -- put your own frequently typed company info here ab MHG MAD House Graphics ab mhgc madhousegraphics.com ab mhgw http://www.madhousegraphics.com/ " set this for the :TOhtml command for exporting files with the current syntax-highlighting colorscheme for viewing on the web let html_use_css = 1 let html_ignore_folding = 1 " fix high utf-8 chars to html entities like “ " big thanks to jamessan in the #vim freenode channel for help figuring this out. sheesh. " with dcraven and tpope for the assist on vim variable interpolation below, so I only have " to change this in one place to get both the nmap and vmap consistent :D I realize the variable " isn't all that, yet, but I've only filled it with what I run into regularly. the more problems " I encounter, the bigger it'll get, but only as needed. Adjust accordingly. YMMV let myentity = "–—“”‘’«»…ãáçêé¼½¾¿°" nmap utf :.!perl -MHTML::Entities -Mutf8 -lne 'utf8::decode($_); print encode_entities($_, qq{=g:myentity} );' vmap utf :!perl -MHTML::Entities -Mutf8 -lne 'utf8::decode($_); print encode_entities($_, qq{=g:myentity});' "------END------ " vim600: set filetype=vim tw=0 : " vim700: set nospell : and then we have : >$ cat ~/.vim/ftplugin/php.vim " NOTE: switched to localleader since this will be an ftplugin. :help maplocalleader " load my html shortcuts too because we'll probably use a lot of those :runtime ftplugin/html.vim :set wrap " make sure there's no spaces after these, hmm? :imap ;; /%%%3s :nmap ;; /%%%3s " Automatic close char mapping imap {{ {}o imap [[ [] imap (( () " let's make php a tad easier, shall we? :imap ??p mz'z;; :imap get mz$_GET['%%%']'z;; :imap post mz$_POST['%%%']'z;; :imap serv mz$_SERVER['%%%']'z;; :imap for mzfor ( %%%; %%%; %%% ){%%%;}'z;; :imap fore mzforeach ( $%%% as $%%% => $%%% ){%%%;}'z;; :imap whil mzwhile ( %%% ){%%%;}'z;; :imap if mzif ( %%% ){%%%;}'z;; :imap swit mzswitch ( %%% ){case %%%;%%%;break;case %%%;%%%;break;default;%%%;break;}'z;;