set background=dark set nu! syntax on set showmatch set nocompatible set backspace=indent,eol,start set showcmd set tabstop=4 set shiftwidth=4 set smarttab set expandtab set softtabstop=4 set autoindent set smartindent set mouse=a set backspace=indent,eol,start set backup set backupdir=~/vimfiles/backup set directory=~/vimfiles/temp set diffexpr=MyDiff() set guifont=ProggyCleanTT:h12:cANSI set helplang=En set history=50 set hlsearch set incsearch set keymodel=startsel,stopsel set ruler set selection=exclusive set selectmode=mouse,key set whichwrap=b,s,<,>,[,] set window=55 " vim: set ft=vim : noremap noremap - noremap w noremap W noremap :next noremap :prev noremap Y y$ nnoremap \hc :call InsertCloseTag() imap \hca nnoremap \hp :call RepeatTag(0) imap \hpa nnoremap \hn :call RepeatTag(1) imap \hna function! RepeatTag(Forward) " repeats a (non-closing) HTML tag from elsewhere in the document; call " repeatedly until the correct tag is inserted (like with insert mode +P " and +N completion), with Forward determining whether to copy forwards " or backwards through the file; used for the \hp and \hn operations defined " above; " requires preservation of marks i and j; " clobbers register z " " by Smylers http://www.stripey.com/vim/ " 2000 Apr 30 " if the cursor is where this function left it, then continue from there: if line('.') == line("'i") && col('.') == col("'i") " delete the tag inserted last time: if col('.') == strlen(getline('.')) normal dF].\\{-}>\mj\"zyf>`i\"zpmi" endfunction " RepeatTag() function! InsertCloseTag() " inserts the appropriate closing HTML tag; used for the \hc operation defined " above; " requires ignorecase to be set, or to type HTML tags in exactly the same case " that I do; " doesn't treat

as something that needs closing; " clobbers register z and mark z " " by Smylers http://www.stripey.com/vim/ " 2000 May 3 " list of tags which shouldn't be closed: let UnaryTags = ' Area Base Br DD DT HR Img Input LI Link Meta P Param ' " remember current position: normal mz " loop backwards looking for tags: let Found = 0 while Found == 0 " find the previous <, then go forwards one character and grab the first " character plus the entire word: execute "normal ?\\l" normal "zyl let Tag = expand('') " if this is a closing tag, skip back to its matching opening tag: if @z == '/' execute "normal ?\" . Tag . "\" " if this is a unary tag, then position the cursor for the next " iteration: elseif match(UnaryTags, ' ' . Tag . ' ') > 0 normal h " otherwise this is the tag that needs closing: else let Found = 1 endif endwhile " not yet found match " create the closing tag and insert it: let @z = '' normal `z"zp endfunction " InsertCloseTag()