Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!elroy.jpl.nasa.gov!ames!ncar!csn!tramp.Colorado.EDU!lewis From: lewis@tramp.colorado.edu (LEWIS WILLIAM M JR) Newsgroups: comp.editors Subject: Aligning columns in vi Message-ID: <1991Feb16.204003.22543@csn.org> Date: 16 Feb 91 20:40:03 GMT Sender: news@csn.org (news) Organization: University of Colorado, Boulder Lines: 19 Originator: lewis@tramp.Colorado.EDU Nntp-Posting-Host: tramp.colorado.edu My friend Carl Brandauer of Daemon Associates (attmail!bdaemon!carl or ....!stcvax!bdaemon!carl) suggests the following vi map! command for aligning end of comment markers: map! ^[OQ ^[80a ^[72^V|C*/^M In this example PF2 on a VT100 is used for the command which must be entered like: ^V80a ^V72^V^V|C*/^V The logic is simple: 1. Enter command mode 2. Append 80 spaces 3. Move to column 72 4. Change to end of line with */ and new-line The trick is that the pipe symbol must be preceded by two ^V's.