lang message en_US set nocompatible syntax on filetype plugin indent on set fileformat=unix fileformats=unix,dos,mac set fileencoding=utf-8 fileencodings=utf-8,sjis,euc-jp set ruler number set list listchars=tab:>.,trail:- set smarttab expandtab set tabstop=4 shiftwidth=4 set backspace=indent,eol,start set hidden autowrite set incsearch hlsearch set ignorecase smartcase set iminsert=0 imsearch=-1 nnoremap gk vnoremap gk nnoremap gj vnoremap gj nnoremap k nnoremap j nnoremap h nnoremap l nnoremap :bp nnoremap :bn autocmd filetype xml,html,xhtml call FileTypeXml() autocmd filetype css,php,perl,javascript call AssistCoding() if exists('+omnifunc') autocmd filetype html,xhtml setlocal omnifunc=htmlcomplete#CompleteTags endif let s:bdir = $HOME . '/.vim_backup' if filewritable(s:bdir) == 2 set backup swapfile let &backupdir = s:bdir let &directory = s:bdir autocmd BufWritePre * call s:SetBex() function s:SetBex() if exists('b:bexSet') let &backupext = '~' else let b:bexSet = 1 let &backupext = strftime('-%Y%m%dT%H%M%S.bak') endif endfunction endif function AssistCoding() inoremap ' '' inoremap " "" inoremap ( () inoremap [ [] inoremap { {} inoremap ; endfunction function FileTypeXml() inoremap =" ="" setlocal tabstop=2 shiftwidth=2 if !exists('*XmlAttribCallback') function XmlAttribCallback(tagName) setlocal iminsert=0 return 0 endfunction endif endfunction