function WriteTemporary(fileName) execute "w! ~\\Documents\\vimtmp\\".a:fileName endfunction function SetUpDiff(ftyp) execute "Wt before.".a:ftyp execute "normal! \\" execute "enew" execute "Wt after.".a:ftyp endfunction function AutoFormat(ftyp) execute "set syn=".a:ftyp execute "set filetype=".a:ftyp execute "set smartindent" if a:ftyp=="Xml" execute "%s/>[ \t\r\n]*\r)' " Map F1 thru F8 to buffers map :b 1 map :b 2 map :b 3 map :b 4 map :b 5 map :b 6 map :b 7 map :b 8 " Set up two files for a comparison nmap j v:call SetUpDiff("java") nmap s v:call SetUpDiff("js") nmap h v:call SetUpDiff("html") nmap c v:call SetUpDiff("css") " Set the colors & indentation for a file type map j :call AutoFormat("Java") map s :call AutoFormat("Javascript") map h :call AutoFormat("Html") map c :call AutoFormat("Css") map x :call AutoFormat("Xml") map :qa!