Mike Parson's vi/ex .exrc file

I wrote a few of these myself, I picked up some of them from elsewhere on the net. In any case, this is what it would look like in your text editor, just don't try and cut & paste this file directly into your .exrc, download this file instead.

" Display the current  editor  mode  and  a ''modified'' flag.
set showmode
" Note matching ``{'' and ``('' for ``}'' and ``)'' characters.
set showmatch
" Display a row/column ruler on the colon command line.
set ruler

" set ignorecase
" set tabstop=4
" set directory=/var/tmp

" these are self explainitory
map =i :r $HOME/.include.headers
map == :r $HOME/.separator
map =s :r ~/.signature

" goes to the next file in a multi-file vi session
map , :n^M
" removes this file from the multi-file vi session
map =dd :!rm %^M:n^M
" write out this file, go to the next one
map =w :w:n^M

" prints out today's day into the file
map =t :r!date +\%y\%m\%d\%t\%T

" similar, but uses discordian date format:
map =d :r!ddate +'Today is \%{\%A, the \%e day of \%B\%} in the YOLD \%Y, \%.\%N\%nCelebrate \%H'^M

" this should convert whitespace on tabstops to actual tabs
" given that things line up on tapstops
map =T :%!unexpand -a^M

" convert '> > >' type quoted replies to be '>>> '
map =q mx:.,$s/> />/g^M'x:.,$s/>\([^>]\)/> \1/^M'x

" C-style comments out the current line
map =C  ^i/* ^[$A */^[

" this will format a paragraph to 65 columns
" map F {!}fmt -65^M}

" par(1) formats quoted text too
" requires some setup
" from tha par(1) manpage:
" export PARINIT='rTbgqR B=.,?_A_a Q=_s>|'
map F {!}par ^M}

" This will center the current line.
" see the page http://www.oac.uci.edu/indiv/gdh/vi/ for info on this one
map =c 0>>d0:co.^Mk:s/./x/g^M40A x^[079lD:s/x//g^MJ

" right-justify this line
map =L 0>>d0:co.^Mk:s/./x/g^M65A ^[065lD:s/x//g^MJ

" invoke ispell on the current file
map V :w!^M:!/usr/local/bin/ispell -x % ^M:e!^M^M

" set autoindent

Back to BLSOFT
This page is maintained by Michael Parson. Please email mparson@bl.org with comments and corrections.
page last modified on Monday, 17-May-2004 10:55:53 CDT