" Chess Griffin's .vimrc " " " Version History " " 0.1 2002-05-18 " 0.2 2005-04-11 " 0.3 2006-09-18 " " All I know is something like a bird within her sang " " ----------------------- " General settings " ----------------------- set nocompatible " get out of horrible vi-compatible mode filetype on " detect the type of file set history=1000 " How many lines of history to remember set undolevels=200 " Number of undo levels. set cf " enable error files and error jumping set ffs=dos,unix,mac " support all three, in this order filetype plugin on " load filetype plugins set viminfo+=! " make sure it can save viminfo set isk+=_,$,@,%,#,- " none of these should be word dividers setlocal spell spelllang=en_us " turn on spell-check set background=dark " dark background syntax on " syntax highlighting is on color desert " set color scheme " ----------------------- " User interface settings " ----------------------- set lsp=0 " space it out a little more (easier to read) set wildmenu " turn on wild menu set ruler " Show the line and column numbers of the cursor. set cmdheight=2 " set command bar height set showcmd " Show (partial) command in status line. set showmode " Show current mode. set ignorecase " Case insensitive matching. set scrolloff=5 " Keep a context when scrolling. " set nomodeline " Disable modeline. set modeline " Enable modeline. set title " show title in console title bar set esckeys " Cursor keys in insert mode. set gdefault " Use 'g' flag by default with :s/foo/bar/. set magic " Use 'magic' patterns (extended regular expressions). set ttyscroll=0 " Turn off scrolling (this is faster). set ttyfast " We have a fast terminal connection. set encoding=utf-8 " Set default encoding to UTF-8. set showbreak=+ " Show a '+' if a line is longer than the screen. " set autowrite " Automatically save before :next, :make etc. set linebreak set display+=lastline set nostartofline " Do not jump to first character with page commands, set number " show line numbers set lz " do not redraw while running macros set hid " can change buffer without saving set backspace=2 " make backspace work normally set whichwrap+=<,>,h,l " backspace and cursor keys wrap to set mouse=a " use mouse everywhere set shortmess=atI " shortens messages to avoid 'press a key' prompt set report=0 " tell us when anything is changed via :... set noerrorbells " don't make noise " make the splitters between windows be blank set fillchars=vert:\ ,stl:\ ,stlnc:\ " ----------------------- " Visual stuff " ----------------------- set showmatch " Show matching brackets. set mat=5 " how many tenths of a second to blink matching brackets set nohlsearch " do not highlight search terms set incsearch " Incremental search. set listchars=tab:\|\ ,trail:.,extends:>,precedes:<,eol:$ " what to show when I hit :set list set textwidth=70 " 70 cols width is very safe. set so=10 " Keep 10 lines (top/bottom) for scope set novisualbell " don't blink set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%04l,%04v][%p%%]\ [LEN=%L] set laststatus=2 " always show the status line " ----------------------- " Text Formatting " ----------------------- set fo=tcrqn " See Help (complex) set autoindent " Autoindent my code. set smartindent " set smart indent set cindent " cindent. set tabstop=8 " number of spaces of tab character set softtabstop=8 " same as above set shiftwidth=8 " number of space to (auto)indent set noexpandtab " real tabs only set nowrap " do not wrap lines set smarttab " use tabs at the start of a line, spaces elsewhere " ----------------------- " Folding " ----------------------- set foldenable " Turn on folding set foldmethod=indent " Make folding indent sensitive set foldlevel=100 " Don't autofold anything set foldopen-=search " don't open folds when you search into them set foldopen-=undo " don't open folds when you undo stuff " ----------------------- " Backups " ----------------------- set backup " make backup file set backupdir=~/.vim/backup/ " where to put backup file set directory=~/.vim/tmp/ " directory is the directory for temp file set makeef=error.err " When using make, where should it dump the file " ----------------------- " Function keys " ----------------------- " F1: Toggle hlsearch (highlight search matches). nmap :set hls! " F2: Toggle list (display unprintable characters). nnoremap :set list! " F3: Toggle expansion of tabs to spaces. nmap :set expandtab! " F4: Write a ChangeLog entry. map :r !dateChess Griffin * | " F5: Insert current date. map :r !date " ----------------------- " Correct typos. " ----------------------- iab beacuse because iab becuase because iab acn can iab cna can iab centre center iab chnage change iab chnages changes iab chnaged changed iab chnagelog changelog iab Chnage Change iab Chnages Changes iab ChnageLog ChangeLog iab debain debian iab Debain Debian iab defualt default iab Defualt Default iab differnt different iab diffrent different iab emial email iab Emial Email iab figth fight iab figther fighter iab fro for iab fucntion function iab ahve have iab homepgae homepage iab logifle logfile iab lokk look iab lokking looking iab mial mail iab Mial Mail iab miantainer maintainer iab amke make iab mroe more iab nwe new iab recieve receive iab recieved received iab erturn return iab retrun return iab retunr return iab seperate separate iab shoudl should iab soem some iab taht that iab thta that iab teh the iab tehy they iab truely truly iab waht what iab wiht with iab whic which iab whihc which iab yuo you iab databse database iab versnio version iab obnsolete obsolete iab flase false iab recrusive recursive iab Recrusive Recursive " Days of week. iab monday Monday iab tuesday Tuesday iab wednesday Wednesday iab thursday Thursday iab friday Friday iab saturday Saturday iab sunday Sunday " Enable this if you mistype :w as :W or :q as :Q. " nmap :W :w " nmap :Q :q " ----------------------- " Abbreviations. " ----------------------- " My name + email address. ab cng Chess Griffin " Use 'g' to go to the top of the file. "map g 1G " Quit with 'q' instead of ':q'. VERY useful! "map q :q " HTML. " Print an empty tag. map! ;h 5hi " Wrap an tag around the URL under the cursor. map ;H lBi3hi " ----------------------- " Miscellaneous stuff. " ----------------------- " Path/file expansion in colon-mode. set wildmode=list:longest set wildchar= " ROT13 decode/encode the selected text (visual mode). " Alternative: 'unmap g' and then use 'g?'. vmap rot :!tr A-Za-z N-ZA-Mn-za-m " Make p in visual mode replace the selected text with the "" register. vnoremap p :let current_reg = @"gvdi=current_reg " ----------------------- " File-type specific settings. " ----------------------- if has("autocmd") " Enabled file type detection and file-type specific plugins. " filetype plugin on indent filetype indent on " Python code. augroup python autocmd BufReadPre,FileReadPre *.py set tabstop=4 autocmd BufReadPre,FileReadPre *.py set expandtab augroup END " PHP code. augroup php autocmd BufReadPre,FileReadPre *.php set tabstop=4 autocmd BufReadPre,FileReadPre *.php set expandtab augroup END " Docbook helper augroup BEGIN au! BufRead,BufNewFile *.xml source ~/.vim/ftplugin/dbhelper.vim augroup END endif " ----------------------- " Local settings. " ----------------------- " Source a local configuration file if available. if filereadable(expand("~/.vimrc.local")) source ~/.vimrc.local endif