Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!sdd.hp.com!zaphod.mps.ohio-state.edu!samsung!uunet!microsoft!nancym From: nancym@microsoft.UUCP (Nancy McGough) Newsgroups: comp.editors Subject: Re: minimum vi command set, was: Wanted: Easy, Full-screen Editor Message-ID: <58374@microsoft.UUCP> Date: 19 Oct 90 03:04:31 GMT References: <1990Oct4.153022.13721@news.iastate.edu> <1846@calmasd.Prime.COM> <1990Oct9.013103.18799@mthvax.cs.miami.edu> Reply-To: nancym@microsoft.UUCP (Nancy McGough) Distribution: na Organization: Microsoft Corp., Redmond WA Lines: 67 In article <1990Oct9.013103.18799@mthvax.cs.miami.edu> wb8foz@mthvax.cs.miami.edu (David Lesher) writes: >What do you REALLY need to use vi? > > cursor keys > > i (forget a,I,A) > x > u (optional) > J (maybe) > ZZ >Sure they're LOTS of things that will go slowly with only the >above, but is there any text you cannot enter or edit? When I first learned vi, the only way I could get from command mode to input mode was with i and it drove me crazy when I wanted to input text after the last character on a line -- I would use i to insert before the last character, retype the last character, then type the new text, then switch to command mode and use x to delete that pesky last character which was no longer the last character. My point is -- I think that "a" should be included in a minimal set of vi commands! Here's what I'd recommend for a minimal set: ESC Command Mode h left j down k up l right x delete character i Input Mode, insert before character a Input Mode, append after character o Input Mode, insert on a new line below current line :wq write (save edits) and quit :q! quit without saving edits For a little more power (in no particular order): I Input Mode, insert at beginning of current line A Input Mode, append to end of current line O Input Mode, insert on a new line above current line R Input Mode, replace text until ESC is pressed r Input Mode, replace character then return to Command Mode u undo last command dd delete line into buffer dw delete word into buffer D delete to end of line into buffer Y yank copy of current line into buffer P put buffer contents before p put buffer contents after cw change word until ESC is pressed ^ move to beginning of current line $ move to end of current line w move forward a word b move back a word J join next line with current line xp exchange current character and next character :1 move to line 1 :$ move to the last line CTRL+b move back a screen CTRL+f move forward a screen Note that you can prepend (is that a word?) a number to many of these commands. For example, 5dd deletes 5 lines. I think I got carried away here . . .! nancy