" Use Vim settings, rather then Vi settings (much better!). " This must be first, because it changes other options as a side effect. set nocompatible set backup " keep a backup file set viminfo='20,\"50 " read/write a .viminfo file, don't store more " than 50 lines of registers set history=50 " keep 50 lines of command line history set ruler " show the cursor position all the time set bs=2 " always backspace set fo=cqrt " smart formatting of comments map Q gq " Don't use Ex mode, use Q for formatting set hlsearch " Highlihting the last used search pattern " set mouse=a " Use the mouse in all modes set mousemodel=popup " Turn on the popup menu set mousefocus " Use the mouse to focus windows set mousehide " Hide the mouse cursor when the user types " set selectmode=mouse,key,cmd " Use both mouse and shift keys to select set pastetoggle= " Turn on the mouse wheel " TODO: This doesn't work? " map [62~ " map! [62~ " map [63~ " map! [63~ " map [64~ " map! [64~ " map [65~ " map! [65~ " map [M# :let k=getchar() :let k=getchar() " map! [M# :let k=getchar() :let k=getchar() a " map [M$ :let k=getchar() :let k=getchar() " map! [M$ :let k=getchar() :let k=getchar() a " map [M " map! [M " map [M3 " map! [M3 " map [M4 " map! [M4 " map [M0 " map! [M0 " Set misc. gvim options set guifont=grvga " Make p in Visual mode replace the selected text with the "" register. vnoremap p :let current_reg = @"gvdi=current_reg if has("autocmd") " In text files, always limit the width of text to 78 characters au BufRead *.txt set tw=78 " Do some extra syntax stuff for .cpp files au! Syntax cpp source ~/.cpp.vim " Set .ipp and .idl files to .cpp style au BufEnter,BufRead *.ipp set ft=cpp au BufEnter,BufRead *.idl set ft=cpp au BufEnter,BufRead *.swig set ft=cpp au BufEnter,BufRead *.i set ft=cpp au BufEnter,BufRead *.cxx set ft=cpp " When editing a file, always jump to the last cursor position. " This must be after the uncompress commands. au BufReadPost * if line("'\"") && line("'\"") <= line("$") | exe "normal `\"" | endif " Add a file explorer if filereadable("$VIMRUNTIME/macros/explorer.vim") source $VIMRUNTIME/macros/explorer.vim endif " Do indenting " if filereadable("$VIMRUNTIME/indent.vim") " source $VIMRUNTIME/indent.vim " endif " Make sure we use tabs with Makefiles au BufEnter ?akefile* set noet " Only use C-style indenting for C/C++ files au FileType c,cpp,java,idl,swig,i,yxx set cin endif if has("syntax") syntax on " Syntax highlighting endif " C-style comment-in and comment-out map ,q 0i/* A */j map ,Q 0xxx$xxxj " Some programming shortcuts " TODO: These don't work with Ctrl-O map ,if koif(){}kk$hhi map ,for kofor(;;){}kk$hhi " map ,elif oslse{O " Map the delete key map [3~ x " Set indenting options set ts=4 set sw=4 set et set cino=g0,t0,+2,(4,u4,) set smartindent " Here are the colors hi normal ctermfg=grey ctermbg=black guifg=grey guibg=black hi comment ctermfg=darkcyan ctermbg=black hi visual guifg=grey guibg=black hi statement ctermfg=darkgreen ctermbg=black gui=none cterm=none hi search gui=none cterm=none ctermfg=black ctermbg=cyan guifg=black guibg=cyan hi constant gui=none cterm=none guifg=magenta3 set background=light