Support Telephone: +61 2 9212 0811 | Support Email: support@itng.com.au  
Home | Contact | Search Knowledge Base    
 Information

 
 
 Support

Support
Knowlege Base
 

Search our Knowledge Base for technical articles. This database may contain information sourced from other sites.

You can enter up to 100 characters in your search term. We continue to add articles in this database as we encounter issues in our support work.

If you are directed to this page to start a support session click on the logo below. You will be prompted to install a file. Please follow the directions provided by support.

 

Search Knowledge Base
 
Search Terms
Enter up to 10 search terms. Up to 99 pages that contain ANY of yor search terms will be returned - the pages will be listed in order with the best results listed first.
Clear

VI Reference Sheet 
VI Reference Sheet

Entering the editor: vi


All "C" programs should end with the ".c" extension. All FORTRAN programs should end with the ".f" extension. All Pascal programs should end with the ".p" extension.


Leaving the editor:


ZZ This exits and saves your work. Case matters. See line editor commands to exit and not save.


Creating Text
a Append at right of cursor.


A Append at end of current line.


i Insert at left of cursor.


I Insert at beginning of current line.


o Create text on newline after current line.


O Create text on newline above current line.


ESC EXIT INPUT OR APPEND MODE.


Positioning in the Window
$ Last character on the current line.


0 First character on the current line.


#- Move up # number lines.


#+ Move down # number lines.


j Down arrow


k Up arrow


l Right arrow


h Left arrow


Arrow Keys The arrow keys work.


Do not hold them down or you'll be sorry.


Scrolling Text
ctrl-f Forward one window.


ctrl-b Backward one window.


G Go to last line of current file.


#G Go to the #th line of the current file.


ctrl-g Give the current line number and status.


Delete Commands
x Delete 1 character.


#x Delete # number of characters.


dw Delete 1 word.


#dw Delete # number of words.


dd Delete 1 line.


#dd Delete # number of lines.


D Delete from cursor to EOLN.


Replacing Text
r Replace 1 character.


R Replace only those characters typed over.


C Replace characters up to EOLN.


ESC EXIT REPLACE MODE.


Moving Text
yw Yank copy of current word into buffer.


Y Yank copy of current line into buffer.


#Y Yank copy of # number of lines into buffer.


p Place copy of buffer after cursor.


NOTE: All deleted text was placed in this same buffer.


Misc. vi Commands
% Match ('s or }'s.
Note: Place cursor over a ( or { and the % command will automatically take you to the matching ( or }. J Join lines.


ctrl-l Refresh the screen


u UNDO LAST CHANGE!
Line Editor Style Commands
:q! Quit the editor and discard all changes.


:w Write out contents of editor to that filename.


:set number Number lines.


:set nonumber Un-number lines.


:# Go to line #.


:/pattern Search forward for pattern.


:?pattern Search backward for pattern.


:/ Repeat last forward search.


:? Repeat last backward search.


:#,#s/old/new/ Substitute old pattern for new pattern on lines # thru #.


Substitute Examples
:1,5s/wite/write/ This changes the first occurrence of "wite" to "write" on lines 1 thru 5.


:1,5s/wite/write/g This changes every occurrence of "wite" to "write" on lines 1 thru 5. ( Global substitution )


:1,$s/wite/write/gc This changes every occurrence of "wite" to "write" on lines 1 thur EOF. The "c" option gives the user a chance to confirm each change. ( y or n )


:10,15s/^/ / This changes Begining of line into four spaces on lines 10 thur 15. (i.e. indents those lines) The "^" is a special character that matches beginning of line.


:.,12s/$/ ;/ This changes End of line into a space and a semi-colon on the current line thur line 12. The "$" is a special character that matches En
 
Link http://www.packetnexus.com/node.php?id=24

 
File  
 

©2006 IT Next Generation Pty Ltd | Suite 103, 330 Wattle Street, Ultimo NSW 2007
T: +61 2 9212 0811 | F: +61 2 9212 0833 | E: support@itng.com.au | W: www.itng.com.au
Website Design and Solutions | Business Grade Internet Solutions
Microsoft Small Business Specialist | Cisco Partner | Trend Micro | Destra Business