Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site sdcc3.UUCP Path: utzoo!linus!decvax!ittatc!dcdwest!sdcsvax!sdcc3!bi50xrs From: bi50xrs@sdcc3.UUCP (dragonpup) Newsgroups: net.wanted Subject: advanced "vi" guide Message-ID: <3105@sdcc3.UUCP> Date: Wed, 4-Dec-85 20:32:45 EST Article-I.D.: sdcc3.3105 Posted: Wed Dec 4 20:32:45 1985 Date-Received: Sat, 7-Dec-85 16:22:52 EST Organization: lack of Lines: 83 Keywords: bsd 4.2 or better this is the advanced version of the previous article again i am not claiming to be any guru on vi yes there is a guide by berkeley. this is just for a friend. Advanced vi commands to recover lost files in vi type "vi -r filename" [disclaimer this may not always work] :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Cursor Movement Commands - move to the beginning of one line above H move to top of screen M move to middle of screen L move to end of screen ) move to end of sentence ( move to beginning of sentence } move to end of paragraph { move to beginning of paragraph ctrl-j move one line down ctrl-m move one line down ctrl-n move one line down ctrl-e display one more line at bottom ctrl-y display one more line at top ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Insert Commands o open open line BELOW the cursor and begin insert O open open line ABOVE the cursor and begin insert s substitute same as "xi" ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Editing Commands J join two lines (remove a carriage return and concatenate) y - yank lines into a buffer #Y yank # lines into buffer (default = 1) P to put lines from buffer BEFORE the cursor p to put lines from buffer AFTER the cursor ~ change from upper to lowercase or vice versa #>> shift # lines usually 8 spaces to the right (default = 1) #<< shift # lines usually 8 spaces to the left (default = 1) :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Search Commands /pattern - searches for "pattern" after the cursor ?pattern - " " " before " " n next - keeps searching in the same direction N " - " " " " opposite direction :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Special Commands editting two or more files at a time [not advised to edit more than 2] "vi file1 file2" :n moves to next file :rew! returns to previous file :e# does the same as the above :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Colon Commands :#1,#2 w name write only the lines #1 to #2 to the file (for excerpting) :r filename read in a file into the text after the cursor :!shell-command execute a shell-command put result at bottom of screen :r!shell-command execute as above, but put result before cursor :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Buffer Commands m mark as a spot note the "< >" are not typed ' return to that spot " lowercase lettered buffer "<1-9> last 9 text deletions in backwards order "my'a yank from mark a into buffer m "mp put from buffer m "My'a append to a ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::