" Andre Guibert de Bruet 's .vimrc " Borrow it, modify it, who cares! Just do something useful with your editor! " Inspired on mark@itsolve.co.uk (JALH)'s vimrc. version 6.3 set nocompatible set backspace=2 " Yippie! we can use the mouse now :) "set mouse=a " save before :make, :suspend, etc set autowrite " backups are for wimps! they also leave files with ~ extensions all over. set nobackup " write a .viminfo file, don't store more than 50 lines set viminfo='20,\"50 " various options for a tab stop of 8 spaces. set cinoptions=>8 set shiftwidth=8 set tabstop=8 set softtabstop=8 " different syntax highlighting look " set background=dark " stop beeping! set noerrorbells " show partial command in status line set showcmd " show ruler (line & column numbers) set ruler " don't jump cursor around, stay in current column set nostartofline " search like emacs, show matches while searching set incsearch " always show status line, even when editing just one file set laststatus=2 set joinspaces " yes. allow magic patterns in searches set magic " we use bash set shell=bash " show short messages. lessens the changes of ever getting a 'hit-return' " prompt set shortmess=at " show short messages " show which mode we're in set showmode " smoother output, we're not on a 1200 dialup :) set ttyfast " quickly edit files often edited map ,v :e ~/.vimrc map ,b :e ~/.bash_profile map ,i :e ~/.ircrc map ,p :e ~/.procmailrc map ,s :e ~/.signature map ,t :!ctags -l c `find . -name "*.[ch]"` " suffixes that get lower priority when doing tab completion for filenames. set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc iab _date =strftime("%a %b %d %T %Z %Y") iab _mail andre@siliconlandmark.com iab alos also iab aslo also iab becuase because iab bianry binary iab bianries binaries iab charcter character iab charcters characters iab exmaple example iab exmaples examples iab didnt didn't iab isnt isn't iab wouldnt wouldn't iab shoudl should iab seperate separate iab teh the iab u you iab tpyo typo fun Norm() set ignorecase set noai set nosmartindent set nocindent syn off set textwidth=0 set noshowmatch endfun fun Prog() set noignorecase set ai set smartindent set cindent syn on set showmatch set textwidth=80 " i hate cyan comments :) "hi Comment ctermfg=DarkGrey guifg=DarkGrey endfun com Norm call Norm() com Prog call Prog() Prog if has("autocmd") " Set some sensible defaults for editing C-files augroup cprog " Remove all cprog autocommands au! " When starting to edit a file: " For *.c and *.h files set formatting of comments and set C-indenting on. " For other files switch it off. " Don't change the order, it's important that the line with * comes first. autocmd BufRead * set formatoptions=tcql nocindent comments& autocmd BufRead *.c,*.h set formatoptions=croql cindent comments=sr:/*,mb:*,el:*/,:// augroup END " Also, support editing of gzip-compressed files. DO NOT REMOVE THIS! " This is also used when loading the compressed helpfiles. augroup gzip " Remove all gzip autocommands au! " Enable editing of gzipped files " read: set binary mode before reading the file " uncompress text in buffer after reading " write: compress file after writing " append: uncompress file, append, compress file autocmd BufReadPre,FileReadPre *.gz set bin autocmd BufReadPre,FileReadPre *.gz let ch_save = &ch|set ch=2 autocmd BufReadPost,FileReadPost *.gz '[,']!gunzip autocmd BufReadPost,FileReadPost *.gz set nobin autocmd BufReadPost,FileReadPost *.gz let &ch = ch_save|unlet ch_save autocmd BufReadPost,FileReadPost *.gz execute ":doautocmd BufReadPost " . expand("%:r") autocmd BufWritePost,FileWritePost *.gz !mv :r autocmd BufWritePost,FileWritePost *.gz !gzip :r autocmd FileAppendPre *.gz !gunzip autocmd FileAppendPre *.gz !mv :r autocmd FileAppendPost *.gz !mv :r autocmd FileAppendPost *.gz !gzip :r augroup END augroup bzip2 " Remove all bzip2 autocommands au! " Enable editing of bzipped files " read: set binary mode before reading the file " uncompress text in buffer after reading " write: compress file after writing " append: uncompress file, append, compress file autocmd BufReadPre,FileReadPre *.bz2 set bin autocmd BufReadPre,FileReadPre *.bz2 let ch_save = &ch|set ch=2 autocmd BufReadPost,FileReadPost *.bz2 |'[,']!bunzip2 autocmd BufReadPost,FileReadPost *.bz2 let &ch = ch_save|unlet ch_save autocmd BufReadPost,FileReadPost *.bz2 execute ":doautocmd BufReadPost " . expand("%:r") autocmd BufWritePost,FileWritePost *.bz2 !mv :r autocmd BufWritePost,FileWritePost *.bz2 !bzip2 :r autocmd FileAppendPre *.bz2 !bunzip2 autocmd FileAppendPre *.bz2 !mv :r autocmd FileAppendPost *.bz2 !mv :r autocmd FileAppendPost *.bz2 !bzip2 -9 --repetitive-best :r augroup END augroup gpg1files au! autocmd BufReadPre,FileReadPre *.asc let ch_save = &ch|set ch=2 autocmd BufReadPre,FileReadPre *.asc set noswapfile autocmd BufReadPost,FileReadPost *.asc '[,']!gpg --skip-verify --decrypt --quiet 2>/dev/null autocmd BufReadPost,FileReadPost *.asc let &ch = ch_save|unlet ch_save autocmd BufWritePre,FileWritePre *.asc let ch_save = &ch|set ch=2 autocmd BufWritePost,FileWritePost *.asc :w !gpg --armour --no-tty --encrypt --yes --quiet --output % autocmd BufWritePost,FileWritePost *.asc let &ch = ch_save|unlet ch_save autocmd FileAppendPre *.asc let ch_save = &ch|set ch=2 autocmd FileAppendPost *.asc :w !gpg --armour --no-tty --encrypt --yes --quiet --output % autocmd FileAppendPost *.asc let &ch = ch_save|unlet ch_save autocmd BufLeave *.asc set swapfile augroup END augroup gpg2files au! autocmd BufReadPre,FileReadPre *.gpg let ch_save = &ch|set ch=2 autocmd BufReadPre,FileReadPre *.gpg set noswapfile autocmd BufReadPre,FileReadPre *.gpg set bin autocmd BufReadPost,FileReadPost *.gpg '[,']!gpg --skip-verify --decrypt --quiet 2>/dev/null autocmd BufReadPost,FileReadPost *.gpg let &ch = ch_save|unlet ch_save autocmd BufReadPost,FileReadPost *.gpg set nobin autocmd BufWritePre,FileWritePre *.gpg let ch_save = &ch|set ch=2 autocmd BufWritePost,FileWritePost *.gpg :w !gpg --encrypt --yes --quiet --output % autocmd BufWritePost,FileWritePost *.gpg let &ch = ch_save|unlet ch_save autocmd FileAppendPre *.gpg let ch_save = &ch|set ch=2 autocmd FileAppendPost *.gpg :w !gpg --no-tty --encrypt --yes --quiet --output % autocmd FileAppendPost *.gpg let &ch = ch_save|unlet ch_save autocmd BufLeave *.gpg set swapfile augroup END endif " has ("autocmd")