language C syntax enable filetype plugin indent on " encoding and linefeed settings set encoding=utf-8 set fileformat=unix fileformats=unix,dos,mac set fileencoding=utf-8 fileencodings=ucs-bom,utf-8,cp932,euc-jp,latin1 " tab and backspace settings set smarttab expandtab set tabstop=4 shiftwidth=4 set backspace+=indent,eol,start " search settings set iminsert=0 imsearch=-1 set incsearch hlsearch ignorecase smartcase " backup settings (enabling ddbackup.vim) set backup backupdir^=~/.vim_backup directory^=~/.vim_backup// " misc. settings set hidden set visualbell set ruler number set display+=lastline set scrolloff=2 sidescrolloff=4 sidescroll=1 set list listchars=tab:/.,trail:-,extends:>,precedes:< " windows-like motions noremap gk noremap gj noremap g0 noremap g$ " buffer walking shortcuts nnoremap :bp nnoremap :bn " neocomplcache.vim settings let g:NeoComplCache_EnableAtStartup = 1 let g:NeoComplCache_SmartCase = 1 let g:NeoComplCache_EnableAutoSelect = 1 let g:NeoComplCache_EnableQuickMatch = 0 autocmd FileType css,php,perl,python,javascript call AssistCoding() function AssistCoding() inoremap ' '' inoremap " "" inoremap ( () inoremap [ [] inoremap { {} inoremap ' ' inoremap " " inoremap ( ( inoremap [ [ inoremap { { inoremap ; ; inoremap , , inoremap endfunction autocmd FileType xml,html,xhtml,xslt call s:FileTypeXml() function s:FileTypeXml() runtime ftplugin/xml.vim inoremap =" ="" setlocal tabstop=2 shiftwidth=2 vnoremap e "xx:call EscapeXml('x')"xP if !exists('*XmlAttribCallback') function XmlAttribCallback(tagName) setlocal iminsert=0 return 0 endfunction endif if !exists('*s:EscapeXml(') function s:EscapeXml(regname) let x = getreg(a:regname) let x = substitute(x, '&', '\&', 'g') let x = substitute(x, '<', '\<', 'g') let x = substitute(x, '>', '\>', 'g') let x = substitute(x, "'", '\'', 'g') let x = substitute(x, '"', '\"', 'g') call setreg(a:regname, x) endfunction endif endfunction " vim: tabstop=2 shiftwidth=2