Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!mit-eddie!ll-xn!ames!aurora!labrea!decwrl!pyramid!prls!mips!dce From: dce@mips.UUCP (David Elliott) Newsgroups: comp.unix.questions Subject: Re: vi tips- summary number one Message-ID: <679@quacky.UUCP> Date: Tue, 15-Sep-87 10:14:16 EDT Article-I.D.: quacky.679 Posted: Tue Sep 15 10:14:16 1987 Date-Received: Thu, 17-Sep-87 06:04:20 EDT References: <601@augusta.UUCP> <8524@mimsy.UUCP> <2280@sphinx.uchicago.edu> <1741@tekgen.TEK.COM> Reply-To: dce@quacky.UUCP (David Elliott) Organization: MIPS Computer Systems, Sunnyvale, CA Lines: 35 Keywords: vi tips, summary, good stuff, help with vi In article <1741@tekgen.TEK.COM> jerryp@tekgen.TEK.COM (Jerry Peek) writes: >In article <2280@sphinx.uchicago.edu> d757@sphinx.UUCP (Lawrence Lerner) writes: >> !! place results of command into file i.e. !!cat it.p will place >> the list of it.p in your file. > >Oops. This *replaces the current line* with the contents of the it.p file. Still not quite correct. !! replaces the current line with the result of sending the line through a pipe to the given command. Also, ! is orthogonal like 'd' and 'y'. Examples: 1. We have a command called "uupath" that will take a "To:" or "Cc:" line on the standard input, extract the mail address, change it using the pathalias database, and print out the new line. Thus, I can place my cursor on a "To:" line, type "!!uupath", and the mail address gets fixed. 2. I can run a whole block of text through the tr command. Take the following lines: a b c d Place the cursor on the 'a' and type !3jtr 'a-z' 'A-Z' and note that the 4 letters get changed to upper case. -- David Elliott {decvax,ucbvax,ihnp4}!decwrl!mips!dce