" 'OH MY GOD I HATE PEOPLE' fixes. " Why some of these are ever on enabled are beyond me. set nocompatible " Why would I use vim if I wanted it to act like vi? set noincsearch " incsearch pisses me off. set nohlsearch " hlsearch pisses me off. set foldclose= " Automatic foldclosing is irritating too set noshowmode " I know what mode I'm in, thanks. " Beeping makes me want to stab you in the face... with a bullet. set noerrorbells " I seriously hate bells. All of them must die. set visualbell " But saying noerrorbells doesn't do it all autocmd VimEnter * set vb t_vb= " Make the visual bell zero time, so it doesn't blink. """ Whew... now that I don't want to kill anyone anymore, let's move on. " Indentation. Do it my way. set shiftwidth=2 " 3 spaces for shifting set expandtab set tabstop=2 " Tabs are 3 spaces wide. set autoindent "set cindent " Use c-style indentation "set cinkeys=0{,0},0),:,!^F,o,O " Default cinkeys contains 0#, that's annoying "set cinoptions=(0t0c1 " :help cinoptions-values " Keep state about my editing, thanks. set viminfo='50,\"1000,:100,n~/.vim/viminfo " Make backups, just in case? "set backup " Vim 7 Features map gt map gT " Interface goodness set ruler " Give me a ruler, tell me where I am in the file. set showcmd " Show me the vi command in the ruler set showmatch " Show me matching close braces set ignorecase " Case insensitive searching set smartcase " Unless I really mean case sensitive set notitle " My shell will set the title, thanks. set list " Show me whitespace where I care "set number " Sometimes I like line numbers? Meh. Rarely. " Some useful miscellaneous options set listchars=tab:>-,trail:- " In case I want to use the 'list' option set matchpairs+=<:> " match < > with the % command, too set complete=.,w,b,i,t,u " For great completion justice... set backspace=indent,eol " allow rational backspacing in insert mode set formatoptions=tcrqn set comments=b:# " Most of my files use # for comments " Some plugins like to contain documentation, hurray! if isdirectory("~/.vim/doc") helptags ~/.vim/doc endif " Allow filetype plugins (ft_plugin stuff) filetype plugin on " Text folding set foldmethod=marker " I have a dark background... set background=dark " Auto-detect file type filetype on " Mappings to jump me to the beginning of functions map [[ ?{w99[{ map ][ /}b99]} map ]] j0[[%/{ map [] k$][%?} " Miscellaneous auto commands augroup filetype " Set the filetype to 'mail' when I'm writing email autocmd BufNewFile,BufRead */Mail/drafts/* setf mail augroup END autocmd Filetype mail set tw=72 autocmd Filetype mail set nocindent autocmd Filetype mail set noautoindent autocmd Filetype mail set nosmartindent autocmd FileType perl set commentstring=#\ %s autocmd FileType perl set comments=f:# autocmd FileType c,cpp set comments=s1:/*,mb:*,ex:*/,f:// autocmd FileType java set comments=s1:/*,mb:*,ex:*/,f:// "autocmd FileType java syn on autocmd FileType cvs set tw=72 " gVim specific settings set guioptions-=T " Remove the toolbar and menubar set guioptions-=m set guioptions-=r " Remove right- and left-hand scrollbars set guioptions-=L set guioptions+=c " Console-based dialogs for simple queries set guifont=suxus " Yay fonts! " Let us toggle the menu let g:menubar=0 map :if g:menubar == 1:set guioptions-=m:let g:menubar = 0:else:set guioptions+=m:let g:menubar = 1:endif " Toggle paste mode "set pt=gp set guicursor=a:block-blinkoff1 " Use color, but only for what I want. function Fixcolors() syn on " Don't color these, jerk. hi Normal NONE hi NonText NONE hi Constant NONE hi Identifier NONE hi Statement NONE hi PreProc NONE hi Type NONE hi Special NONE " Search colors sucks by default (yellow on black?) hi search ctermfg=green ctermbg=black cterm=bold " Now override some things " Colors if our term does 256 colors if &t_Co == 256 hi Comment ctermfg=189 "hi SpecialKey ctermfg=150 hi SpecialKey ctermfg=150 hi Todo ctermfg=184 ctermbg=black hi Folded ctermfg=180 ctermbg=black else hi Todo ctermfg=green ctermbg=black hi Comment ctermfg=grey hi SpecialKey ctermfg=darkyellow hi Folded ctermfg=darkyellow ctermbg=black endif hi LineNr ctermfg=grey ctermbg=black endfunction function Freebsdstyle() set cinoptions=:0+4c1(4u4 set tabstop=8 set shiftwith=8 endfunction autocmd VimEnter * call Fixcolors() autocmd BufEnter * call Fixcolors() " SQLUtilities.vim vmap sf SQLU_Formatter " Stuff for the TagList vim script let Tlist_Ctags_Cmd="exctags" map ta :Tlist " Just in case the host termcap on this machine sucks, give me color. if &term =~ "xterm" || &term =~ "screen" "set t_Co=256 if has("terminfo") set t_Sf=[3%p1%dm set t_Sb=[4%p1%dm else set t_Sf=[3%dm set t_Sb=[4%dm endif endif " PyBloxsom stuff augroup pybloxsom autocmd BufReadPost /users/u9/psionic/public_html/semicomplete.live/semicomplete/*/*.txt call Pybloxsom_checkdate() autocmd BufNewFile /users/u9/psionic/public_html/semicomplete.live/semicomplete/*/*.txt call Pybloxsom_putdate() autocmd BufWritePost /users/u9/psionic/public_html/semicomplete.live/semicomplete/*/*.txt call Pybloxsom_fudgedate() augroup end function Pybloxsom_checkdate() " Look in the file for '#mdate foo' metadata normal 1G let dateline = search("^#mdate") " If not found, append the mdate of the file to line 2 if dateline < 1 let date = system("stat -f '#mdate %Sm' " . expand("%")) " Add the date to the file on line 1 1put=date endif endfunction function Pybloxsom_putdate() let date=strftime("#mdate %b %e %H:%M:%S %Y") 1put=date goto 1 endfunction function Pybloxsom_fudgedate() " Mark our position normal mZ " Find mdate let l=search("^#mdate") let l=strpart(getline(l), 7) let cmd="date -j -f '%b %e %H:%M:%S %Y' '" . l . "' +%y%m%d%H%M" let touchtime=system(cmd) let touchcmd="touch -t '" . strpart(touchtime,0,strlen(touchtime)-1) . "' '" . expand("%") . "'" call system(touchcmd) " Reload the file (make vim notice the date change) e " Jump back to our old position normal `Z echo "Fudged date" endfunction " Things I don't want you to see! Neener neener neener. if filereadable("~/.vimrc-private") source ~/.vimrc-private endif