set shiftround set shiftwidth=2 set showcmd " Helps avoid command-mode typos. set showmatch set tildeop " I always thought '~' should work this way... set textwidth=75 set wrapmargin=8 set nomodeline set ruler " I like to know where I am. set cpoptions=aABceF " The default setting for this includes the " 's' option; I disable that so that " certain buffer settings (like the ones " below) don't have to be set and reset " every time we enter or leave a buffer. " Set various options according to the type of file we're editing. augroup settings autocmd BufNewFile,BufReadPost *.c,*.h,*.cc,*.inl set cindent cinoptions=(0,g0 autocmd BufNewFile,BufReadPost *.*vimrc,*.vim,.exrc,_*vimrc,_exrc set comments=b:\" autocmd BufNewFile,BufReadPost *.tex,*.sty set comments=:% autocmd BufNewFile,BufReadPost *.pl,*.pm,*.PL set cindent cinoptions=(0 autocmd BufNewFile,BufReadPost *.gene set autoindent comments=n:# augroup END " These two mappings switch between my preferred indent style (on ) and " the company-standard indent style (on ). nmap :set cindent shiftwidth=2 cinoptions={0,(0,g0 nmap :set cindent shiftwidth=4 cinoptions={s,(0,g0 " When I edit a new file, there's no "#!" line at the top by which to set " syntax highlighting and other file-specific options; this mapping lets me " recheck those after adding the "#!" line. nmap :doau syntax BufReadPost doau settings BufReadPost if version >= 500 " I've gotten too used to the reformat command living on the 'Q' key. nmap Q gq omap Q gq if !has("gui_running") set background=dark endif " These scripts, which are picked up by the system syntax.vim, set up " autocmds for all my personal and modified syntax files. let mysyntaxfile = "~abby/vim/mysyntax.vim" let myscriptsfile = "~abby/vim/myscripts.vim" " Activate optional features of the Perl syntax file. let perl_extended_vars = 1 let perl_highlight_matches = 1 let perl_embedded_pod = 1 let perl_want_scope_in_variables = 1 " These settings allow me to use color highlighting in rxvt without " having to manually reset TERM from "xterm" to "rxvt". set t_Co=8 set t_Sb=[4%p1%dm set t_Sf=[3%p1%dm if has("syntax") " Enable syntax highlighting. syntax on endif