" ~/.vimrc "Use Vim mode set nocompatible "Basic startup settings set encoding=utf-8 set termencoding=utf-8 " CUSTOM KEYBINDINGS " "basic key remappings "noremap "make vim act like pager in normal mode "easy buffer flip shortcuts nmap :bprev nmap :bnext "toggle highlight search off and on nmap :let &hls=!&hls imap :let &hls=!&hlsa "toggle view of taglist nmap :TlistToggle imap :TlistToggle "show BufExplorer nmap :BufExplorer imap :BufExplorer "toggle spell checking nmap :let &spell=!&spell imap :let &spell=!&spella "VCS commands nmap vcsa VCSAdd nmap vcsn VCSAnnotate nmap vcsG VCSClearAndGotoOriginal nmap vcsc VCSCommit nmap vcsd VCSDiff nmap vcsg VCSGotoOriginal nmap vcsL VCSLock nmap vcsl VCSLog nmap vcsq VCSRevert nmap vcsr VCSReview nmap vcss VCSStatus nmap vcsU VCSUnlock nmap vcsu VCSUpdate nmap vcsv VCSVimDiff " FILETYPE SETTINGS " filetype on "enable file detection filetype indent on "enable filetype indenting filetype plugin on "enable filetype plugins set fileencodings=ucs-bom,utf-8,default,latin1 "encodings to try let g:load_doxygen_syntax=1 "use doxygen syntax on c/cpp/idl files " SYNTAX HIGHLIGHTING " if (&t_Co > 2) || has("gui_running") syntax enable endif " GUI/NONGUI SETTINGS " colorscheme desert if has("gui_running") if has("gui_gtk2") set guifont=DejaVu\ Sans\ Mono\ 12 endif colorscheme desert "colorscheme inkpot set columns=80 lines=40 else if (&t_Co >= 256) silent! colorscheme inkpot endif "set background=dark endif " BACKUP FILES " set backup " SWAP FILES " set dir=~/.vim/tmp//,.,~/tmp,/var/tmp,/tmp " SEARCHING SETTINGS " set ignorecase "ignore case in searches set smartcase "unless search contains uppercase "set hlsearch "highlight previous search term set incsearch "search-as-you-type " FORMATTING SETTINGS " set autoindent "autoindent from previous line set noexpandtab "keep tabs as tabs set tabstop=4 "set tabstop equiv for display set shiftwidth=4 "set space equiv for each (auto)indent " DISPLAY SETTINGS " set ruler "show cursor position set rulerformat=%19([%5l,%-6(%c%V%)]\ %P%) set showcmd "display incomplete command set cmdheight=1 "restrict command height (and no more 'press enter') set showmode "show current mode set showmatch "show matching []{}() set shortmess+=r "use short message to indicate read only "set number "show line numbers " MISC SETTINGS " set whichwrap=h,l,~,[,] "allow cursor keys to wrap lines set backspace=indent,eol,start "allow backspacing of these chars set ttyfast "smoother on fast terminals set history=50 "number of commands/searches to store set wildchar= set wildmenu set wildmode=longest:full,full "list possibilities when wildcard completing set shell=bash "shell for vim to use set ttymouse=xterm "use xterm mouse codes if has('mouse') set mouse=a "enable mouse in all modes endif " AUTOCOMMMANDS " if has("autocmd") autocmd BufReadPost * \ if line("'\"") > 1 && line("'\"") <= line("$") | \ exe "normal! g`\"" | \ endif endif if !exists(":DiffOrig") command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis \ | wincmd p | diffthis endif " ABBREVIATIONS " iab MAINTTAG # Maintainer: Dan McGee iab CONTRIBTAG # Contributor: Dan McGee