0707070000020033641006440001450000000000010052650372372216600000500000000006Size46080 0707070000020031001006440001450000000000010417330372372017700000600000000153Files./Size ./Files ./Install ./Name ./Remove ./exinit ./exrc ./man ./1.vikeys ./vikeys.1 ./MAKEcpio ./MAKEflop 0707070000020030261006440001450000000000010052640372420347600001000000004164Install# --------------------------------------------------------------------- # Install script for vi function key mapping # 12 May 86 # Reuel Robertson # Altered for multi logins, /usr/man command. Susan M. Woodbury 8/24/86 # --------------------------------------------------------------------- #Let them know we've started > /usr/lib/.vikeys echo "Installing `cat Name` \n" echo MNAME=`uuname -l` cat < /dev/null 2>&1 chmod +x ${BINDIR}/man chown bin ${BINDIR}/man chgrp bin ${BINDIR}/man fi ln 1.vikeys ${MANDIR}/1.vikeys ln vikeys.1 ${HOME}/Filecabinet/vikeys.1 message -i "A primitive man(1) command has been installed. man(1) is a shell script in $BINDIR. List it for more information.\n\nTouch to continue" echo "Installing vikeys files (.exrc, exinit) in users' home directories.\n" echo "For each login I will present type 'y' if you wish that user to have this tool, 'n' otherwise\n" exec 3> /usr/lib/.vikeys grep EXINIT ${homdir}/.profile > /dev/null 2> /dev/null if [ $? -eq 0 ] then message -i "The EXINIT definition in ${homedir}/.profile will over ride the .exrc file just installed. Either replace the EXINIT definition with the contents of ${homdir}/exinit, or delete it from the .profile.\n\n Press Enter." fi fi lin=`line <&3` done 0707070000020030511006440001450000000000010052600372373473000000500000000030NameVIKEYS - via THE STORE! 0707070000020030521006440001450000000000010052610372420362600000700000000672Remove# Remove file for the vi function key mapping - Reuel Robertson echo Removing vi function key mapping Package.. while read homdir do rm -f ${homdir}/exinit rm -f ${homdir}/.exrc mv ${homdir}/oldexrc ${homdir}/.exrc > /dev/null 2>&1 done < /usr/lib/.vikeys rm /usr/man/1.vikeys rm -f ${HOME}/Filecabinet/vikeys.1 echo finished removing vi function key mapping Package.. #----------------------------------------------------------------- 0707070000020030241006440001450000000000010052620372420331500000700000001504exinitexport EXINIT EXINIT='set ai aw w1200=20 scroll=16 sm wm=0 sw=4 :map O * :map *k ZZ :map! Ok ZZ :map *w :q! :map! Ow :q! :map *s u :map *S U :map *o :w :map *O :w! :map *a dd :map *x / :map *X ? :map *r :map :map *v o :map *V O :map *y "lp :map *Y "lP :map *t . :map! Ou  :map Nf x :map NF X :map Na :map Ng `` :map Nh n :map NH N :map Ni ml :map NI `l :map Ne dw :map NE D :map Nj a :map NJ i :map NC "ld`l :map ND "ly`l :map!  a :map!  a :map!   a :map!  i :map   :map   :map   :map   :map   :map   :map! NL $a :map! NK 0i :map NL $ :map NK 0 :map   :map   :map  H :map NM L :map 9 1G :map 0 G ' EXINIT=$EXINIT":map Nc " EXINIT=$EXINIT\"ld\'l EXINIT=$EXINIT' :map Nd ' EXINIT=$EXINIT\"ly\'l 0707070000020031441006440001450000000000010052630372420327000000500000001357exrc:set ai aw w1200=20 scroll=16 sm wm=0 sw=4 :map O * :map *k ZZ :map! Ok ZZ :map *w :q! :map! Ow :q! :map *s u :map *S U :map *o :w :map *O :w! :map *a dd :map *x / :map *X ? :map *r :map :map *v o :map *V O :map *y "lp :map *Y "lP :map *t . :map! Ou  :map Nf x :map NF X :map Na :map Ng `` :map Nh n :map NH N :map Ni ml :map NI `l :map Ne dw :map NE D :map Nj a :map NJ i :map NC "ld`l :map ND "ly`l :map!  a :map!  a :map!   a :map!  i :map   :map   :map   :map! NL $a :map! NK 0i :map NL $ :map   :map NK 0 :map   :map   :map   :map  H :map NM L :map 9 1G :map 0 G :map Nc "ld'l :map Nd "ly'l :map  Lz. 0707070000020031511007750001450000000000010053020372372005500000400000000616manif [ $# -eq 1 ] then if [ -s /usr/man/1.$1 ] then cat /usr/man/1.$1 exit 0 else echo "$0: cannot find /usr/man/1.$1" >&2 exit 1 fi fi echo "Usage: $0 command_name Only one command name may be specified. This is not a full implementation of the man command as this machine does not have many manual pages. For a list of manual pages available, list the /usr/man directory" >&2 exit 2 07070700000200315210064400014500000000000100533403723717702000011000000516551.vikeys IIIInnnnffffoooorrrrmmmmaaaattttiiiioooonnnn SSSSyyyysssstttteeeemmmmssss subject: Vi Keys on the UNIX PC date: August 24, 1986 from: Reuel Robertson MT 01317 3F-321 x7-2604 mtunh!rrr _M_E_M_O_R_A_N_D_U_M__F_O_R__F_I_L_E 1. _I_n_t_r_o_d_u_c_t_i_o_n The UNIX PC keyboard has a complete set of labeled function keys, many of which are well suited for editor functions. However, most vi users cannot use these keys when editing, because the characters they issue are not interpreted correctly by vi. A mapping of these character sequences into useful vi commands is needed, and I have provided such a facility in the form of a .exrc file. An .EXINIT definition, as an alternative, is also available. The commands are described in the next section. The commands are listed, and defined, in the order they appear on the keyboard in section 3. Installation is described in section 4. The notation s-KEYSTROKE is used to indicate a shifted keystroke. The key mappings described in this paper may be used for remote access to UNIX systems, by the UNIX PC, as well. The .exrc just needs to be installed in your $HOME directory on the remote system. Alternatively, the .EXINIT definition just needs to be added to your .profile on the remote system. However, two caveats are worth mentioning. First, using the mapping with the Phone Manager's terminal emulator may not work correctly, due to a bug in that emulator requiring two s to be typed for each one sent (in the version I run). Second, on many systems vi limits the number of macros (maps) that can be defined at initialization (by EXINIT or .exrc) to 32. This is about half the number needed for the mapping I have implemented. The easiest solution is having vi rebuilt to permit 64 macros, as has already been done on our local systems. - 2 - 2. _C_o_m_m_a_n_d__K_e_y_s The use of the UNIX PC function keys while editing in vi is described in the sub-sections below. The keys are grouped into sections based on common functionality. Particular attention should be paid to the section on block moves, which describes a simplified block move or copy technique. 2.1 _B_l_o_c_k__M_o_v_e_s A simplified method for moving or copying blocks of text is supported by the UNIX PC function keys. Two keys from column 1, and two keys from column 2 may be used for these operations; Mark, Move, Copy, and Rplac. Three basic operations are supported. These are: copying a block of text into a buffer, deleting a block of text while saving it in a buffer, and restoring a block of text from the buffer into the file. Each operation is described below. 2.1.1 _C_o_p_y_i_n_g__a__T_e_x_t__B_l_o_c_k First, the block to be copied must be delimited. The beginning of the block may be marked by positioning the cursor there, and hitting the Mark button. To delimit a block of whole lines, place the mark at the beginning of the first line. The cursor is then positioned to the end of the block. The block is now delimited to include all the text between the mark and the cursor. Next, the Copy key is depressed. This copies the delimited block into a buffer (the el buffer). Full lines are copied from the line that contained the mark to the line that contained the cursor. To copy the block delimited exactly by the mark and the cursor (not necessarily full lines), use s-Copy instead of Copy. Replacing the text block is described in the next section. In the delimiting operation, the mark may be placed at the end of the block instead of the beginning. In this case, the cursor is then position to the beginning of the block before the Copy key is hit. 2.1.2 _R_e_p_l_a_c_i_n_g__t_h_e__T_e_x_t__B_l_o_c_k To replace the text block in the buffer, the cursor is positioned to where you want the block inserted. Hit the Rplac button to replace the block into the file at the current cursor position. When copying/moving a block of whole lines, the block will be placed after the line the cursor is on. - 3 - Use s-Rplac to place the block before the cursor, or above the current line when copying/moving a block of whole lines. 2.1.3 _M_o_v_i_n_g__a__T_e_x_t__B_l_o_c_k The move operation is identical to the copy operation, except that the Move key is hit instead of the Copy key. When the Move key is hit, the delimited block of whole lines is deleted from the file, and copied into a buffer (the el buffer). Use s-Move to move the block delimited exactly by the mark and the cursor. Replacing the block is described above. 2.1.4 _A__v_i__B_u_g__W_o_r_k_a_r_o_u_n_d An infrequent, but occasionally useful operation in vi is to delimit a small block within a single line, for moving, copying, or deleting. There is a bug in vi that affects s- Copy and s-Move, when used on a single line. To work properly, the cursor must be placed before the mark (on the same line), rather than after it. In other words, delimit the block with the mark at the end (after the last character) and the cursor at the beginning. An alternative workaround is to use "p" or "P" to restore the deleted/copied text. This works even if the cursor follows the mark on the same line, provided no other yanks or deletions have occurred since s-Copy or s-Move was hit. 2.2 _C_u_r_s_o_r__P_o_s_i_t_i_o_n_i_n_g The following function keys support cursor positioning on the screen, or within the file; left arrow, s-left arrow, right arrow, s-right arrow, up arrow, down arrow, Roll up, Roll down, Beg, End, Home, s-Home, Page, s-Page, and s-Mark (Slect). These are each described in section 3. Below I briefly describe only those keys whose functions I do not consider obvious. To move to either the beginning or the end of a line, s-left arrow and s-right arrow may be used, respectively. Beg moves you to the beginning of the file, and End moves you to the end of it. Home moves the cursor to the top of the screen, at the beginning of the line, and s-Home moves the cursor to the bottom of the screen, at the beginning of the line. Page and s-Page move the cursor to the next or previous page respectively, preserving two lines of the current display if possible. Hitting s-Mark moves the cursor to a mark placed earlier with the Mark key. If no mark was placed, or if the mark has been deleted, an error is displayed. The Slect label has no meaning in this - 4 - instance. 2.3 _D_e_l_e_t_e__k_e_y_s Clear Line deletes the line the cursor is on, and Dlete Char deletes the character the cursor is on. Use s-Dlete to delete the character before the cursor. Dlete deletes the word, or partial word, following the cursor. Hitting s- Dlete deletes the rest of the line. All these commands may be preceded by a count, except s-Dlete. 2.4 _F_i_l_e__O_p_e_r_a_t_i_o_n_s The edit buffer may be saved, without exiting the editor, by hitting Save. s-Save does a save despite lack of write permission on the file, provided you are the owner. Exit saves the buffer (if changes were made) and exits the editor. Hitting Cancl issues a command to abort the editing session without saving any of the changes made. Cancl must be followed by a or an to actually abort the session. If Cancl is hit by mistake, it may be cancelled by hitting Cancl again, or you can hit . makes Cancl exit only if no changes were made to the file in the current editing session. 2.5 _S_e_a_r_c_h_i_n_g The Find key is used to initiate a search for a string. After hitting Find, a string is entered, terminated by a . The cursor is then moved to the next occurrence of that string in the file. Successive occurrences of that string may be found by hitting the Next key or by typing Find. Hitting s-Find searches for in the other direction (above). Next may then be used to continue the search in the same direction. s-Next continues the search in the opposite direction from which it was started. 2.6 _I_n_p_u_t__M_o_d_e__O_p_e_r_a_t_i_o_n_s There are eight functions that may be performed with the function keys while in input mode; two to end the session and six for cursor positioning. While in input mode, the Exit key may be used to exit vi and save all the changes made during that session. Cancl may be used to end the session without saving the changes. A is needed to complete the Cancl, just as in input mode. - 5 - The four arrow keys also work during input mode. There are some differences with their operation during command mode. If you are at the end of a line and you use Up Arrow or Down Arrow to move to a longer line, the cursor does not go to the end of that line, but rather to the column it had just occupied. The Right, Up, and Down Arrow keys all behave anomalously when the cursor is on the first character of a line that contains two or more characters. They each position the cursor one character farther to the right than one would expect. The cursor may be moved left one character after this occurs by using the Left Arrow key. Moving the cursor left from the beginning of a line, or right from the end of a line, causes an error beep and puts vi in command mode. The s-Left and s-Right Arrow keys may be used in input mode to position the cursor at the beginning or end of the current line, respectively. Also, please note that the arrow keys are non-destructive. Thus, Left Arrow and Back Space are not the same; Backspace deletes the characters it moves over (from the edit buffer, but not the screen) and Left Arrow preserves them. In input mode, the other function keys are not mapped. Hitting them sends a three character escape code, with various undesirable (but usually harmless) results. 2.7 _M_i_s_c_e_l_l_a_n_e_o_u_s__O_p_e_r_a_t_i_o_n_s The Undo key performs the vi undo operation. To undo all the changes made to a line since the cursor moved to that line, hit s-Undo. Redo repeats the last operation that changed the edit buffer. Unfortunately, Redo remembers only operations that were done without macros most of the time, due to a vi bug. So Redo can only be used reliably to repeat commands entered on the qwerty portion of the keyboard. In command mode, hitting Input Mode puts you in input mode for appending text after the cursor. Hitting s-Input Mode puts you in input mode for inserting text before the cursor. The Open key opens a new line after the current line, and puts you in input mode on that line. When in input mode, hitting the Cmd key returns vi to command mode. 3. _K_e_y__D_e_f_i_n_i_t_i_o_n_s The five columns of labeled function keys on the UNIX PC keyboard, numbered 1 to 5 from left to right, are defined below in terms of their use with vi. An equivalent vi operation from the qwerty keyboard is shown in braces {} for - 6 - each key. Key definitions starting with "[cnt]" may optionally be preceded with a count number before invocation, to perform the operation the specified number of times. 3.1 _C_o_l_u_m_n__1 o+ [cnt] Clear Line: Clears the line that the cursor is on. {dd} o+ Creat: Not mapped. o+ Undo: Undoes the last change to the edit buffer. {u} o+ s-Undo: Undoes the changes made to the current line since the cursor was last moved to the current line. {U} o+ Find: Starts a search. After hitting Find, a string terminated by a is typed in. Find finds the next string (below) matching the last search. {/} o+ s-Find: Starts a reverse search. After hitting s- Find, a string terminated by a is typed in. s- Find finds the next string (above) matching the last search. {?} o+ Move: Move a block of full lines of text delimited by the cursor and the el mark into the el buffer. {"ld'l} o+ s-Move: Move a block of text delimited by the cursor and the el mark into the el buffer. {"ld`l} o+ [cnt] s-Move: Move a line of text into the el buffer. {"ldd} o+ [cnt] Dlete: Delete a word. {dw} o+ s-Dlete: Delete the rest of the line. {D} o+ Mark: Set the el mark. {ml} o+ s-Mark: Go to the el mark. {`l} 3.2 _C_o_l_u_m_n__2 o+ Ref/Rstrt: Not mapped. o+ Save: Save the edit buffer in the file, without exiting the editor. {:w} - 7 - o+ s-Save: Save the edit buffer in the file, without exiting the editor. Lack of write permission is ignored if you are the owner of the file. {:w!} o+ [cnt] Redo: Redo the last command that affected the edit buffer. Due to a vi bug, this only works dependably on non-macro commands (commands entered on the qwerty portion of the keyboard. {.} o+ Rplac: Replace the last block copied or deleted with Copy or Move after the current cursor position, or after the current line if full lines were copied or deleted. {"lp} o+ s-Rplac: Replace the last block copied or deleted with Copy or Move before the current cursor position, or before the current line if full lines were copied or deleted. {"lP} o+ Copy: Copy a block of full lines of text delimited by the cursor and the el mark into the el buffer. {"ly'l} o+ s-Copy: Copy a block of text delimited by the cursor and the el mark into the el buffer. {"ly`l} o+ [cnt] Dlete Char: Delete the character at the cursor. {x} o+ [cnt] s-Dlete Char: Delete the character before the cursor. {X} o+ Input Mode: Append text after the cursor. This puts vi in input mode. {a} o+ s-Input Mode: Insert text before the cursor. This puts vi in input mode. {i} 3.3 _C_o_l_u_m_n__3 o+ Exit: Exit the editor, saving any changes made during this session. This also works in input mode. {ZZ} or {ZZ} o+ Suspd: Not mapped. This does the usual UNIX PC suspend operation. o+ Cmd: Mapped for input mode. Enters command mode. {} o+ Print: Not mapped. - 8 - o+ Beg: Go to the beginning of the file. o+ Prev: Go to the last context. {``} o+ [cnt] Left Arrow: Go left one character. Also works in Input Mode (without cnt). {h} o+ s-Left Arrow: Go to the beginning of the line. Also works in Input Mode. {0} 3.4 _C_o_l_u_m_n__4 o+ Msg: Not mapped. This does the normal UNIX PC message operation. o+ Rsume: Not mapped. This does the usual UNIX PC resume operation. o+ Open: Open a new line following the current line, and enter input mode. {o} o+ s-Open: Open a new line preceding the current line, and enter input mode. {O} o+ Rfrsh: Refresh the screen (redraw). {^L} o+ Home: Go to the line at the top of the screen. {H} o+ s-Home: Go to the line at the bottom of the screen. {L} o+ [cnt] Up Arrow: Move up one line, at the current cursor position. Also works in Input Mode (without cnt). {k} o+ [cnt] s-Roll Up: Roll up one half page, or cnt lines, at the current cursor position. {^u} o+ [cnt] Down Arrow: Move down one line, at the current cursor position. Also works in Input Mode (without cnt). {j} o+ [cnt] s-Roll Down: Roll down one half page, or cnt lines, at the current cursor position. {^D} For the .exrc implementation, [cnt] is invalid and the operation actually redraws the screen a half page down, leaving the cursor in the middle of the screen. {Lz.} - 9 - 3.5 _C_o_l_u_m_n__5 o+ Help: Not mapped. o+ Opts: Displays all the mapping currently in effect. {:map} o+ Cancl: Prepare to exit the editor without saving any of the changes made. This is followed by a to exit with no changes saved. will cause exit to abort if any changes were made. {:q!} o+ [cnt] Page: Move the cursor to the next page. A count moves that many pages. Two lines of the current page are kept if possible. {^F} o+ [cnt] s-Page: Move the cursor to the previous page. A count moves that many pages. Two lines of the current page are kept if possible. {^B} o+ End: Go to the end of the file. o+ Next: Go to the next string matching the last search, in the direction of the last search. {n} o+ s-Next: Go to the next string matching the last search, in the direction opposite from the last search. {N} o+ [cnt] Right Arrow: Move right one character. Also works with Input Mode (without cnt). {l} o+ s-Right Arrow: Go to the end of the line. Also works with Input Mode (without cnt). {$} 4. _I_n_s_t_a_l_l_a_t_i_o_n To enable the function keys on the UNIX PC to operate as described above, one thing is needed. My EXINIT definition must be added to your .profile. Alternatively, my .exrc file may be added to your $HOME directory. I can provide either one on floppy, if you provide the floppy disk. If you already have an EXINIT defined in your .profile, edit it's contents into my EXINIT definition (or .exrc file), and remove it from your .profile. If you already have a .exrc file, it is a simple matter to add its contents to the EXINIT (or my .exrc). Just edit your .exrc commands into the beginning of my EXINIT definition. - 10 - The EXINIT definition in your .profile over rides any .exrc file when vi is invoked. MT-01317-RRR-rrr Reuel Robertson CONTENTS 1. Introduction......................................... 1 2. Command Keys......................................... 2 2.1 Block Moves..................................... 2 2.1.1 Copying a Text Block 2 2.1.2 Replacing the Text Block 2 2.1.3 Moving a Text Block 3 2.1.4 A vi Bug Workaround 3 2.2 Cursor Positioning.............................. 3 2.3 Delete keys..................................... 4 2.4 File Operations................................. 4 2.5 Searching....................................... 4 2.6 Input Mode Operations........................... 4 2.7 Miscellaneous Operations........................ 5 3. Key Definitions...................................... 5 3.1 Column 1........................................ 6 3.2 Column 2........................................ 6 3.3 Column 3........................................ 7 3.4 Column 4........................................ 8 3.5 Column 5........................................ 9 4. Installation......................................... 9 - i - 0707070000020030751006660001450000000000010052520372371735600001100000040210vikeys.1.SA 1 .nr Cl 3 .ds HF 2 2 2 2 2 2 2 .nr Hs 7 .nr Hb 7 .AF "Information Systems" .ND "August 24, 1986" .TL Vi Keys on the UNIX PC .AU "Reuel Robertson" RRR MT 01317 7-2604 3F-321 mtunh!rrr .MT 1 .H 1 "Introduction" The UNIX PC keyboard has a complete set of labeled function keys, many of which are well suited for editor functions. However, most vi users cannot use these keys when editing, because the characters they issue are not interpreted correctly by vi. A mapping of these character sequences into useful vi commands is needed, and I have provided such a facility in the form of a .exrc file. An .EXINIT definition, as an alternative, is also available. .P The commands are described in the next section. The commands are listed, and defined, in the order they appear on the keyboard in section 3. Installation is described in section 4. The notation s-KEYSTROKE is used to indicate a shifted keystroke. .P The key mappings described in this paper may be used for remote access to UNIX systems, by the UNIX PC, as well. The .exrc just needs to be installed in your $HOME directory on the remote system. Alternatively, the .EXINIT definition just needs to be added to your .profile on the remote system. However, two caveats are worth mentioning. First, using the mapping with the Phone Manager's terminal emulator may not work correctly, due to a bug in that emulator requiring two s to be typed for each one sent (in the version I run). Second, on many systems vi limits the number of macros (maps) that can be defined at initialization (by EXINIT or .exrc) to 32. This is about half the number needed for the mapping I have implemented. The easiest solution is having vi rebuilt to permit 64 macros, as has already been done on our local systems. .H 1 "Command Keys" The use of the UNIX PC function keys while editing in vi is described in the sub-sections below. The keys are grouped into sections based on common functionality. Particular attention should be paid to the section on block moves, which describes a simplified block move or copy technique. .H 2 "Block Moves" A simplified method for moving or copying blocks of text is supported by the UNIX PC function keys. Two keys from column 1, and two keys from column 2 may be used for these operations; Mark, Move, Copy, and Rplac. Three basic operations are supported. These are: copying a block of text into a buffer, deleting a block of text while saving it in a buffer, and restoring a block of text from the buffer into the file. Each operation is described below. .H 3 "Copying a Text Block" First, the block to be copied must be delimited. The beginning of the block may be marked by positioning the cursor there, and hitting the Mark button. To delimit a block of whole lines, place the mark at the beginning of the first line. The cursor is then positioned to the end of the block. The block is now delimited to include all the text between the mark and the cursor. .P Next, the Copy key is depressed. This copies the delimited block into a buffer (the el buffer). Full lines are copied from the line that contained the mark to the line that contained the cursor. To copy the block delimited exactly by the mark and the cursor (not necessarily full lines), use s-Copy instead of Copy. Replacing the text block is described in the next section. .P In the delimiting operation, the mark may be placed at the end of the block instead of the beginning. In this case, the cursor is then position to the beginning of the block before the Copy key is hit. .H 3 "Replacing the Text Block" To replace the text block in the buffer, the cursor is positioned to where you want the block inserted. Hit the Rplac button to replace the block into the file at the current cursor position. When copying/moving a block of whole lines, the block will be placed after the line the cursor is on. .P Use s-Rplac to place the block before the cursor, or above the current line when copying/moving a block of whole lines. .H 3 "Moving a Text Block" The move operation is identical to the copy operation, except that the Move key is hit instead of the Copy key. When the Move key is hit, the delimited block of whole lines is deleted from the file, and copied into a buffer (the el buffer). Use s-Move to move the block delimited exactly by the mark and the cursor. Replacing the block is described above. .H 3 "A vi Bug Workaround" An infrequent, but occasionally useful operation in vi is to delimit a small block within a single line, for moving, copying, or deleting. There is a bug in vi that affects s-Copy and s-Move, when used on a single line. To work properly, the cursor must be placed before the mark (on the same line), rather than after it. In other words, delimit the block with the mark at the end (after the last character) and the cursor at the beginning. .P An alternative workaround is to use "p" or "P" to restore the deleted/copied text. This works even if the cursor follows the mark on the same line, provided no other yanks or deletions have occurred since s-Copy or s-Move was hit. .H 2 "Cursor Positioning" The following function keys support cursor positioning on the screen, or within the file; left arrow, s-left arrow, right arrow, s-right arrow, up arrow, down arrow, Roll up, Roll down, Beg, End, Home, s-Home, Page, s-Page, and s-Mark (Slect). These are each described in section 3. Below I briefly describe only those keys whose functions I do not consider obvious. .P To move to either the beginning or the end of a line, s-left arrow and s-right arrow may be used, respectively. Beg moves you to the beginning of the file, and End moves you to the end of it. Home moves the cursor to the top of the screen, at the beginning of the line, and s-Home moves the cursor to the bottom of the screen, at the beginning of the line. Page and s-Page move the cursor to the next or previous page respectively, preserving two lines of the current display if possible. Hitting s-Mark moves the cursor to a mark placed earlier with the Mark key. If no mark was placed, or if the mark has been deleted, an error is displayed. The Slect label has no meaning in this instance. .H 2 "Delete keys" Clear Line deletes the line the cursor is on, and Dlete Char deletes the character the cursor is on. Use s-Dlete to delete the character before the cursor. Dlete deletes the word, or partial word, following the cursor. Hitting s-Dlete deletes the rest of the line. All these commands may be preceded by a count, except s-Dlete. .H 2 "File Operations" The edit buffer may be saved, without exiting the editor, by hitting Save. s-Save does a save despite lack of write permission on the file, provided you are the owner. Exit saves the buffer (if changes were made) and exits the editor. .P Hitting Cancl issues a command to abort the editing session without saving any of the changes made. Cancl must be followed by a or an to actually abort the session. If Cancl is hit by mistake, it may be cancelled by hitting Cancl again, or you can hit . makes Cancl exit only if no changes were made to the file in the current editing session. .H 2 "Searching" The Find key is used to initiate a search for a string. After hitting Find, a string is entered, terminated by a . The cursor is then moved to the next occurrence of that string in the file. Successive occurrences of that string may be found by hitting the Next key or by typing Find. .P Hitting s-Find searches for in the other direction (above). Next may then be used to continue the search in the same direction. s-Next continues the search in the opposite direction from which it was started. .H 2 "Input Mode Operations" There are eight functions that may be performed with the function keys while in input mode; two to end the session and six for cursor positioning. While in input mode, the Exit key may be used to exit vi and save all the changes made during that session. Cancl may be used to end the session without saving the changes. A is needed to complete the Cancl, just as in input mode. .P The four arrow keys also work during input mode. There are some differences with their operation during command mode. If you are at the end of a line and you use Up Arrow or Down Arrow to move to a longer line, the cursor does not go to the end of that line, but rather to the column it had just occupied. The Right, Up, and Down Arrow keys all behave anomalously when the cursor is on the first character of a line that contains two or more characters. They each position the cursor one character farther to the right than one would expect. The cursor may be moved left one character after this occurs by using the Left Arrow key. .P Moving the cursor left from the beginning of a line, or right from the end of a line, causes an error beep and puts vi in command mode. The s-Left and s-Right Arrow keys may be used in input mode to position the cursor at the beginning or end of the current line, respectively. Also, please note that the arrow keys are non-destructive. Thus, Left Arrow and Back Space are not the same; Backspace deletes the characters it moves over (from the edit buffer, but not the screen) and Left Arrow preserves them. .P In input mode, the other function keys are not mapped. Hitting them sends a three character escape code, with various undesirable (but usually harmless) results. .H 2 "Miscellaneous Operations" The Undo key performs the vi undo operation. To undo all the changes made to a line since the cursor moved to that line, hit s-Undo. Redo repeats the last operation that changed the edit buffer. Unfortunately, Redo remembers only operations that were done without macros most of the time, due to a vi bug. So Redo can only be used reliably to repeat commands entered on the qwerty portion of the keyboard. .P In command mode, hitting Input Mode puts you in input mode for appending text after the cursor. Hitting s-Input Mode puts you in input mode for inserting text before the cursor. The Open key opens a new line after the current line, and puts you in input mode on that line. When in input mode, hitting the Cmd key returns vi to command mode. .H 1 "Key Definitions" The five columns of labeled function keys on the UNIX PC keyboard, numbered 1 to 5 from left to right, are defined below in terms of their use with vi. An equivalent vi operation from the qwerty keyboard is shown in braces {} for each key. Key definitions starting with "[cnt]" may optionally be preceded with a count number before invocation, to perform the operation the specified number of times. .H 2 "Column 1" .BL .LI [cnt] Clear Line: Clears the line that the cursor is on. {dd} .LI Creat: Not mapped. .LI Undo: Undoes the last change to the edit buffer. {u} .LI s-Undo: Undoes the changes made to the current line since the cursor was last moved to the current line. {U} .LI Find: Starts a search. After hitting Find, a string terminated by a is typed in. Find finds the next string (below) matching the last search. {/} .LI s-Find: Starts a reverse search. After hitting s-Find, a string terminated by a is typed in. s-Find finds the next string (above) matching the last search. {?} .LI Move: Move a block of full lines of text delimited by the cursor and the el mark into the el buffer. {"ld'l} .LI s-Move: Move a block of text delimited by the cursor and the el mark into the el buffer. {"ld`l} .LI [cnt] s-Move: Move a line of text into the el buffer. {"ldd} .LI [cnt] Dlete: Delete a word. {dw} .LI s-Dlete: Delete the rest of the line. {D} .LI Mark: Set the el mark. {ml} .LI s-Mark: Go to the el mark. {`l} .LE .H 2 "Column 2" .BL .LI Ref/Rstrt: Not mapped. .LI Save: Save the edit buffer in the file, without exiting the editor. {:w} .LI s-Save: Save the edit buffer in the file, without exiting the editor. Lack of write permission is ignored if you are the owner of the file. {:w!} .LI [cnt] Redo: Redo the last command that affected the edit buffer. Due to a vi bug, this only works dependably on non-macro commands (commands entered on the qwerty portion of the keyboard. {.} .LI Rplac: Replace the last block copied or deleted with Copy or Move after the current cursor position, or after the current line if full lines were copied or deleted. {"lp} .LI s-Rplac: Replace the last block copied or deleted with Copy or Move before the current cursor position, or before the current line if full lines were copied or deleted. {"lP} .LI Copy: Copy a block of full lines of text delimited by the cursor and the el mark into the el buffer. {"ly'l} .LI s-Copy: Copy a block of text delimited by the cursor and the el mark into the el buffer. {"ly`l} .LI [cnt] Dlete Char: Delete the character at the cursor. {x} .LI [cnt] s-Dlete Char: Delete the character before the cursor. {X} .LI Input Mode: Append text after the cursor. This puts vi in input mode. {a} .LI s-Input Mode: Insert text before the cursor. This puts vi in input mode. {i} .LE .H 2 "Column 3" .BL .LI Exit: Exit the editor, saving any changes made during this session. This also works in input mode. {ZZ} or {ZZ} .LI Suspd: Not mapped. This does the usual UNIX PC suspend operation. .LI Cmd: Mapped for input mode. Enters command mode. {} .LI Print: Not mapped. .LI Beg: Go to the beginning of the file. .LI Prev: Go to the last context. {``} .LI [cnt] Left Arrow: Go left one character. Also works in Input Mode (without cnt). {h} .LI s-Left Arrow: Go to the beginning of the line. Also works in Input Mode. {0} .LE .H 2 "Column 4" .BL .LI Msg: Not mapped. This does the normal UNIX PC message operation. .LI Rsume: Not mapped. This does the usual UNIX PC resume operation. .LI Open: Open a new line following the current line, and enter input mode. {o} .LI s-Open: Open a new line preceding the current line, and enter input mode. {O} .LI Rfrsh: Refresh the screen (redraw). {^L} .LI Home: Go to the line at the top of the screen. {H} .LI s-Home: Go to the line at the bottom of the screen. {L} .LI [cnt] Up Arrow: Move up one line, at the current cursor position. Also works in Input Mode (without cnt). {k} .LI [cnt] s-Roll Up: Roll up one half page, or cnt lines, at the current cursor position. {^u} .LI [cnt] Down Arrow: Move down one line, at the current cursor position. Also works in Input Mode (without cnt). {j} .LI [cnt] s-Roll Down: Roll down one half page, or cnt lines, at the current cursor position. {^D} For the .exrc implementation, [cnt] is invalid and the operation actually redraws the screen a half page down, leaving the cursor in the middle of the screen. {Lz.} .LE .H 2 "Column 5" .BL .LI Help: Not mapped. .LI Opts: Displays all the mapping currently in effect. {:map} .LI Cancl: Prepare to exit the editor without saving any of the changes made. This is followed by a to exit with no changes saved. will cause exit to abort if any changes were made. {:q!} .LI [cnt] Page: Move the cursor to the next page. A count moves that many pages. Two lines of the current page are kept if possible. {^F} .LI [cnt] s-Page: Move the cursor to the previous page. A count moves that many pages. Two lines of the current page are kept if possible. {^B} .LI End: Go to the end of the file. .LI Next: Go to the next string matching the last search, in the direction of the last search. {n} .LI s-Next: Go to the next string matching the last search, in the direction opposite from the last search. {N} .LI [cnt] Right Arrow: Move right one character. Also works with Input Mode (without cnt). {l} .LI s-Right Arrow: Go to the end of the line. Also works with Input Mode (without cnt). {$} .LE .H 1 "Installation" To enable the function keys on the UNIX PC to operate as described above, one thing is needed. My EXINIT definition must be added to your .profile. Alternatively, my .exrc file may be added to your $HOME directory. I can provide either one on floppy, if you provide the floppy disk. .P If you already have an EXINIT defined in your .profile, edit it's contents into my EXINIT definition (or .exrc file), and remove it from your .profile. If you already have a .exrc file, it is a simple matter to add its contents to the EXINIT (or my .exrc). Just edit your .exrc commands into the beginning of my EXINIT definition. .P The EXINIT definition in your .profile over rides any .exrc file when vi is invoked. .SG rrr .TC 0707070000020030461007740001450000000000010430670372372026200001100000000043MAKEcpiocat Files | cpio -ocBv > VIKEYS+IN 0707070000020030351007740001450000000000010430700372372006500001100000000061MAKEflopcat Files | cpio -ocBv > /dev/rfp021 dismount -f 0707070000020030351007740001450000000000010430700372372006500001300000000000TRAILER!!!raw). {^L} .LI Home: Go to the line at the top of the screen. {H} .LI s-Home: Go to the line at the bottom of the screen. {L} .LI [cnt] Up Arrow: Move up one line, at the current cursor position. Also works in Input Mode (without cnt). {k} .LI [cnt] s-Roll Up: Roll up one half page, or cnt lines, at the current cursor position. {^u} .LI [cnt] Down Arrow: Move down one line, at the current cursor position. Also works in Input Mode (without cnt). {j} .LI [cnt] s-Roll Down: Roll down one half page, or cnt lines, at the current cursor position. {^D} For the .exrc implementation, [cnt] is invalid and the operation actually redraws the screen a half page down, leaving the cursor in the middle of the screen. {Lz.} .LE .H 2 "Column 5" .BL .LI Help: Not mapped. .LI Opts: Displays all the mapping currently in effect. {:map} .LI Cancl: Prepare to exit the editor without saving any of the changes made. This is followed by a to exit with no changes saved. will cause exit to abort if any changes were made. {:q!} .LI [cnt] Page: Move the cursor to the next page. A count moves that many pages. Two lines of the current page are kept if possible. {^F} .LI [cnt] s-Page: Move the cursor to the previous page. A count moves that many pages. Two lines of the current page are kept if possible. {^B} .LI End: Go to the end of the file. .LI Next: Go to the next string matching the last search, in the direction of the last search. {n} .LI s-Next: Go to the next string matching the last search, in the direction opposite from the last search. {N} .LI [cnt] Right Arrow: Move right one character. Also works with Input Mode (without cnt). {l} .LI s-Right Arrow: Go to the end of the line. Also works with Input Mode (without cnt). {$} .LE .H 1 "Installation" To enable the function keys on the UNIX PC to operate as described above, one thing is needed. My EXINIT definition must be added to your .profile. Alternatively, my .exrc file may be added to your $HOME directory. I can provide either one on floppy, if you provide the floppy disk. .P If you already have an EXINIT defined in your .profile, edit it's contents into my EXINIT definition (or .exrc file), and remove it from your