" This is a modified example vimrc set tabstop=4 set shiftwidth=2 set expandtab set enc=utf-8 set nocompatible set backspace=indent,eol,start set nobackup set history=100 set ruler set showcmd set incsearch if version>=700 set cursorline if has("gui_running") set tabpagemax=200 endif endif " sessions should restore gui window position and size as well set sessionoptions+=resize,winpos " Display last line even if it doesn't fit onto the screen completely set display+=lastline set path+=/System/Library/Frameworks/GLUT.framework/Headers/ " Don't use Ex mode, use Q for formatting map Q gq if &t_Co > 2 || has("gui_running") syntax on set hlsearch endif if has("autocmd") au BufNewFile,BufRead *.tri set syntax=triangle filetype plugin indent on " Put these in an autocmd group, so that we can delete them easily. augroup vimrcEx au! autocmd FileType text setlocal textwidth=78 autocmd BufNewFile,BufRead *.som setf st " When editing a file, always jump to the last known cursor position. " Don't do it when the position is invalid or when inside an event handler " (happens when dropping a file on gvim). autocmd BufReadPost * \ if line("'\"") > 0 && line("'\"") <= line("$") | \ exe "normal g`\"" | \ endif augroup END else set autoindent " always set autoindenting on endif " has("autocmd") if has("cscope") set csto=0 set cst " Bind C-] to cscope set nocsverb " add any database in current directory if filereadable("cscope.out") cs add cscope.out " else add database pointed to by environment elseif $CSCOPE_DB != "" cs add $CSCOPE_DB endif set csverb nmap s :cs find s =expand("") nmap g :cs find g =expand("") nmap c :cs find c =expand("") nmap t :cs find t =expand("") nmap e :cs find e =expand("") nmap f :cs find f =expand("") nmap i :cs find i ^=expand("")$ nmap d :cs find d =expand("") " Using 'CTRL-spacebar' then a search type makes the vim window " split horizontally, with search result displayed in " the new window. nmap s :scs find s =expand("") nmap g :scs find g =expand("") nmap c :scs find c =expand("") nmap t :scs find t =expand("") nmap e :scs find e =expand("") nmap f :scs find f =expand("") nmap i :scs find i ^=expand("")$ nmap d :scs find d =expand("") " Hitting CTRL-space *twice* before the search type does a vertical " split instead of a horizontal one nmap s \:vert scs find s =expand("") nmap g \:vert scs find g =expand("") nmap c \:vert scs find c =expand("") nmap t \:vert scs find t =expand("") nmap e \:vert scs find e =expand("") nmap i \:vert scs find i ^=expand("")$ nmap d \:vert scs find d =expand("") endif