Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!umd5!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: vi tips- summary number one Message-ID: <8524@mimsy.UUCP> Date: Fri, 11-Sep-87 13:35:08 EDT Article-I.D.: mimsy.8524 Posted: Fri Sep 11 13:35:08 1987 Date-Received: Sun, 13-Sep-87 09:34:25 EDT References: <601@augusta.UUCP> Sender: chris@mimsy.UUCP Lines: 36 Keywords: vi tips, summary, good stuff, help with vi Xref: mnetor comp.unix.questions:4030 comp.unix.wizards:4212 [Our sys file was broken for a while, and I think this did not go out to the net in general. Apologies if this is a repeat.] Something that is, I believe, undocumented about `range' commands (dw, dd, dG; cw, cc, cfl; etc.) is that they have two `modes', namely line-oriented and character-oriented. For instance, dd is line-oriented: it deletes the entire current line, no matter where the cursor is within that line, while d$ deletes from the cursor to the end of the line. The mode is determined by the addressing construct: _ or stuttering (d_ and c_ are aliases for dd and cc respectively) produces a line address: `this line'. G (go to line , default end of file) produces a line address: `this line through that other line'. w, e, W, E, ^ or | (beginning of text), 0 (beginning of line), and $ (end of line) all produce a character address: `the cursor position to the end of the line'. The searching operators /, ?, n, and N all produce character addresses. Try, for instance, editing a file with the words foo bar out Type the following keys: 1 G / a r RETURN 1 G l d n The mark-referencing commands ' and ` produce line and character oriented addresses respectively. Some commands (notably `!', pipe region through command) will not accept character oriented addresses: `!w' simply beeps, while `!/pattern' produces odd results, and `!n' produces even odder results. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris