" use cygwin shell set shell=c:/cygwin/bin/sh " don't need to be only vi set nocompatible " source $VIMRUNTIME/vimrc_example.vim behave xterm set selectmode=mouse " Option settings ================================================================== " auto indent set autoindent " words to indent after: set cinwords =then,else,while,do,for,switch " don't resize all my buffers when I split set noequalalways " disallow use of function keys in insert mode. (don't have to wait " for esc to be recognized.) set noesckeys " use spaces instead of tabs -- I don't think so set expandtab " enable reading exrc in current directory set exrc " do autoformatting " c - comments " r - auto comment leader on return " o - auto comment leader on open " q - allow reformatting of comments " 2 - take indent from second line for following set formatoptions =tcroq2 " don't mess with the icon text set noicon " searches case insesitive set ignorecase " how deep to look into file for vi commands set modelines =5 " don't support the mouse even if you can " the whole reason I use vi is so I don't have to touch the damn mouse! set mouse = " set path for looking up files to edit " who thought drive letters were a good idea? set path =/,.,f:,g:,h:,i:,j:,k:,l:,m:,n:,o:,p:,q:,r:,s:,t:,u:,v:,w:,x:,y:,z: " keep the cursor 2 lines above the bottom of the screen set scrolloff =2 " make exrc more secure set secure " round indent with >> << to shiftwidth set shiftround " indent 4 spaces when shifting lines and using ^D set shiftwidth =4 " make messages very short set shortmess =aIWto " jump to matching bracket in insert mode set showmatch " I know when I'm in insert dammit set noshowmode " scroll sideways one char at a time set sidescroll =1 " override ic when I type caps in a search set smartcase " do smart indenting set smartindent " open new windows below current set splitbelow " maintain column when paging set nostartofline " suffixes to ignore in wildcards set suffixes =.bak.o.swp " tabs on 4 space bounds set tabstop =4 " tag files to search set tags =./tags,tags,/tool/nightly/buildSymbols/CTAGS " where to wrap when we're wrapping set textwidth =75 " make ~ work right^Wwrong set notildeop " window titles are actually useful, fool set title " stop xterms from jumping set ttyfast " autoscript so can recover if we get killed set updatecount =100 set updatetime =3000 " use visual bell set visualbell " shut up about files not being saved. I know. set nowarn " don't do linewrap. set nowrap " don't wrap on searches set nowrapscan " edit mode mappings ================================================================= " used to use these all the time when I wrote C++ for a living " jump to implementation file from header map #i :e %:r.cc " jump to header file from implementation map #h :e %:r.hh " jump to previous file map ==  " sign it with an X map #X :r ~/News/SIG " or a Y map #Y :r ~/News/SIG2 " put in a timestamp " mydate is long gone, could probably implement all in vim XXX map #T !!mydate " comment out a C++ line with //XXX// map #CL 0i//XXX// " maximize the current window map M 100+ " insert mode mappings =============================================================== " override deindenting # with smartindent inoremap # X# " command line mappings ============================================================== " allow those pesky emacs keys to work on the command line cnoremap cnoremap cnoremap cnoremap b cnoremap f cnoremap " allow the useful cursor keys to work map map " automatic commands ================================================================= " turn on 60 column wrapping when editing email drafts autocmd BufReadPre *Mail/drafts/* set wrap formatoptions =tcroq2 nosmartindent " or when editing html autocmd BufReadPre *.html set noai wrap formatoptions =tcroq2 nosmartindent " magically map &s to & in html files autocmd BufNewFile,BufRead *.html ia & & " turn off expandtabs when editing cpt files autocmd BufReadPre *cpt/* set noexpandtab " ===================================================================================== "EXPERIMENTAL ========================================================================= "chuck's tricky gid mappings " source $VIM/_vimrc.gid " map #su :source $HOME/.vim/such.vim " map #nn :nn " STUFF FROM UNIX .gvimrc ============================================================= " guioptions: " a - own X selection " r - right scrollbar (mostly just for positional reference) " m - menu bar " T - icon bar set guioptions =armT " " always show a status line for each buffer even if there's only one. set laststatus=2 " " set ruler since we've got status lines anyway set ruler " disable the blinking blinking cursor and make it " be some civilized color like red. highlight Cursor NONE highlight Cursor guifg =Sys_Window guibg =red set guicursor =a:blinkon0 " Switch on syntax highlighting. highlight Normal guibg=midnightblue guifg=gold set background =dark syntax on highlight Search NONE highlight Search guifg =Sys_Window guibg =Sys_WindowText " I like highlighting strings inside C comments "let c_comment_strings =1 " set up autocommand for using Mail syntax mode " on mail files autocmd BufNewFile,BufRead *Mail/drafts/* source $VIM/syntax/mail.vim autocmd BufNewFile,BufRead *Mail/drafts/* set nowrap " " turn off autowrap on .bats autocmd BufNewFile,BufRead *.bat set nowrap formatoptions= noai " Switch on search pattern highlighting. "set hlsearch " and be able to switch it off again "map  :set hls! " Hide the mouse pointer while typing " don't need this in unix land since I use unclutter, but for win32 set mousehide " avoid annoying hit enter messages set cmdheight=2 " Quit on F10 just like I do in xterms. map :q " Extra syntax highlighting... au BufNewFile,BufRead *.en_us so $VIM/syntax/xdefaults.vim au BufNewFile,BufRead *.ms,*.ds so $VIM/syntax/csh.vim au BufNewFile,BufRead *.spc so $VIM/syntax/cpp.vim " set geometry 80x29