Useful Controls for the Vim Text Editor

In this lab we use several highly useful controls for the vim text editor. These controls are to be kept in your ~/.vimrc file. The .vimrc file contains:
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
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.

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.

color bar Small icon for Theory of Molecular Machines: physics,
chemistry, biology, molecular biology, evolutionary theory,
genetic engineering, sequence logos, information theory,
electrical engineering, thermodynamics, statistical
mechanics, hypersphere packing, gumball machines, Maxwell's
Daemon, limits of computers


Schneider Lab

origin: 2002 Mar 15
updated: 2011 Jun 01
color bar


U.S. Department of Health and Human Services  |  National Institutes of Health  |  National Cancer Institute  |  USA.gov  | 
Policies  |  Viewing Files  |  Accessibility  |  FOIA