You cannot cut and paste this version because I have modified it for clarity. I changed the control-M characters into the two characters '^M'. You cannot insert a control-M directly into a file using vim because it is a carriage return. To prevent this one types control-v first: '^V^M'. I have put a copy at dot.exrc.set shell=/bin/csh redraw map K !} fmt -78 -c^M map U !} fmt -50 -c^M} map q K} map E 20^E map F :r ~/script/fast^M map Y 20^Y map Z :r ~/misc/add/single^M map X :r ~/.sig^M map Q :r ~/misc/bar^M map W :r ~/misc/barshort^M map z !} sed -f ~/script/bar.sed^M map B !} sed -f ~/script/percent.sed^M map ^C !} sed -f ~/script/bar.sed.rn^M map ^X :1,$s/^/^V| /^M map * !} centerscript^M map = :r ~/misc/add/www^M map , :w^M map g 1G
The q command is
particularly nice. It calls the K command and that calls the unix fmt - the
result is that if you jump to the start of a paragraph with '{' and then type
'q' you will format the paragraph and end at the bottom of the paragraph,
eady to format the next one. The formatting is to 78 characters, which makes
the text legible to everyone on all systems. This prevents you from having
wrapped text lines which are surprisingly hard on the eyes of a reader.
Note: in Berkeley Unix,
such as on Mac OS X, use this form for the fmt:
map K !} fmt 75 78^M
The z command will put vertical bars, '| ', along the edge of a paragraph. This is like the usual indendation, '> ', that many mail programs use, but it is distinct so I like it. This works by using a sed script in your ~/script directory called 'bar.sed'. It consists of two lines:
s/^/| /g s/| >/| /g
The ',' (comma) command is extremely useful. It does a ':w[carriage return]'. So in one keystroke one writes the file out. In conjunction with atchange, it will save you LOTS of time.
The 'g' command brings one to the top of the file. It is the complement to the standard G which puts one at the bottom of the file. After using this one for a while I wonder why it was not done before.
NOTE: I tried to use characters that do not override important vim commands, but it might be that these had meanings that I was not aware of. If you modify your .vimrc, beware of this.
Schneider Lab
origin: 2002 Mar 15
updated: 2011 Jun 01