" vim:set ts=4 sw=4: " Ken Scott's personal Vim settings file " " To use it, copy it to " for Unix and OS/2: ~/.vimrc " for Amiga: s:.vimrc " for MS-DOS and Win32: $VIM\_vimrc " " Last Modified: Mon Oct 27 22:36:56 1997 " sources " so c:\vim\macros\browser.vim "so $HOME/.vim/explorer.vim so $VIMRUNTIME/macros/justify.vim so $HOME/.vim/selectbuffer.vim " Spell check vars let g:cvimsyn = "~/.vim/CVIMSYN/" let g:spchkpunc = 1 let g:spchkautonext = 1 let g:spchkdialect = "can" " MAPS " select all map a ggvG " Format Paragraph "map _F !}fmt } map _P !}perl -MText::Autoformat -e'undef$/;print autoformat(<>,{all=>1})' } " Toggle Paste Mode map :set invpaste " Indent and Outdent map :'<,'>s/^// map :'<,'>s/^// vmap :'<,'>s/^// vmap :'<,'>s/^// " Switch between Windows set wmh=0 map j_ map k_ command -nargs=* Make make | cwindow 3 filetype plugin on filetype indent on if &term =~ "xterm" if has("terminfo") set t_Co=8 set t_Sf=[3%p1%dm set t_Sb=[4%p1%dm else set t_Co=8 set t_Sf=[3%dm set t_Sb=[4%dm endif endif " Status Line set statusline=%<%F\ %h%m%r%y\ %a%=Dec\ %3(%b%)\ Hex\ %4(0x%B%)\ \ %10(%l,%c%V%)\ \ \ \ %P " For backups set nobackup set nowritebackup " Don't hilight on searches set nohlsearch " allow backspacing over everything in insert mode set bs=2 " Expand tabs to spaces set expandtab " don't wrap lines at the edge of the screen set nowrap " read/write a .viminfo file, don't store more than 50 lines of registers set viminfo='20,\"50 " always display a status line at the bottom of window set laststatus=2 " display the current line and col at all times set ruler " Enable mouse in all modes set mouse=a " default tabstop of 4 spaces set ts=4 " default shiftwidth of 4 spaces set sw=4 " don't allow tilde (~) to act as an operator -- ~w, etc. set notildeop if has("gui") " set the gui options to: " g: grey inactive menu items " m: display menu bar " r: display scrollbar on right side of window " b: display scrollbar at bottom of window " t: enable tearoff menus on Win32 " T: enable toolbar on Win32 set go=agmrbtT set notitle endif " Don't use Ex mode, use Q for formatting map Q gq " make tab in v mode work like I think it should (keep highlighting): vmap >gv vmap =strftime("%a %b %d %H:%M:%S %Y") iab lastmod ="Last Modified: " . strftime("%a %b %d %H:%M:%S %Y") " When starting to edit a file: augroup filetype autocmd BufNewFile,BufRead */.screenrc set filetype=screen autocmd BufNewFile,BufRead */vim*/doc/*.txt,*/runtime/doc/*.txt set ft=help autocmd BufNewFile,BufRead /tmp/mutt* set filetype=mail augroup END " Only do this for Vim version 5.0 and later. if version >= 500 " Enable syntax highlighting syntax on " Set the location of my syntax overrides and read the defaults " let mysyntaxfile = "/usr/share/vim/usersyntax/usersyntax.vim" " source $VIM/syntax/syntax.vim endif " Only for Vim 6.0 and later if version >= 600 " Settings for the perl.vim syntax file set foldlevel=999999 " Toggle fold state between closed and opened. " " If there is no fold at current line, just moves forward. " If it is present, reverse it's state. fun! ToggleFold() if foldlevel('.') == 0 " normal! l else if foldclosed('.') < 0 . foldclose else . foldopen endif endif " Clear status line echo endfun " Map this function to Space key. noremap :call ToggleFold() endif " Change some of the default colours source $HOME/.vim/syntax/mycolour.vim