" $Id$ " Custom vim configuration " Turn on plugins and indent based on type filetype indent on filetype plugin on " I like these colors highlight Normal guibg=darkslategrey ctermbg=black ctermfg=green term=bold colorscheme elflord " Standard usability stuff set nocompatible " Use Vim Defaults set backspace=indent,eol,start " backspace over everything set autoindent " set autoindent on set backup " keep a backup file set background=dark " I like black background set backupdir=$HOME/.vim/tmp,/tmp " backup file path set directory=$HOME/.vim/tmp,/tmp " swap file path set viminfo='20,\"50 " 50 lines in .viminfo set history=50 " 50 lines in command history set ruler " show cursor position set grepprg=grep\ -nH\ $* " set :grep alias set tabstop=8 " is 8 spaces set shiftwidth=4 " each auto-indent is 4 spaces set softtabstop=4 " looks like 4 spaces set expandtab " don't convert tabs to spaces set showmatch " Show matching Braces/Tag set nomodeline " Prevent arbitrary code execution " Set autocmd stuff if has("autocmd") " Jump to the last known cursor position autocmd BufReadPost * \ if line("'\"") > 0 && line("'\"") <= line("$") | \ exe "normal g'\"" | \ endif endif " Switch syntax highlighting on, when the terminal has colors " Also switch on highlighting the last used search pattern. if &t_Co > 2 || has("gui_running") syntax on set hlsearch endif " Set file encoding to utf-8 if v:lang =~ "utf8$" || v:lang =~ "UTF-8$" set fileencodings=utf-8 endif " Dictionary based tab completion need sys-apps/cracklib-words set dictionary-=/usr/share/dict/cracklib-words dictionary+=/usr/share/dict/cracklib-words set complete-=k complete+=k " Keyboard mappings map :silent let &background = ( &background == "dark" ? "light" : "dark" ) nnoremap :Tlist " Stuff I will rarely use for languages I don't speak if v:lang =~ "^ko" set fileencodings=euc-kr set guifontset=-*-*-medium-r-normal--16-*-*-*-*-*-*-* elseif v:lang =~ "^ja_JP" set fileencodings=euc-jp set guifontset=-misc-fixed-medium-r-normal--14-*-*-*-*-*-*-* elseif v:lang =~ "^zh_TW" set fileencodings=big5 set guifontset=-sony-fixed-medium-r-normal--16-150-75-75-c-80-iso8859-1,-taipei-fixed-medium-r-normal--16-150-75-75-c-160-big5-0 elseif v:lang =~ "^zh_CN" set fileencodings=gb2312 set guifontset=*-r-* endif " .vimrc " vim:syntax=vim: " vim:sw=4:softtabstop=4:expandtab