1359 Vi Editor

826 views

Published on

visit: www.techbed.blogspot.com

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
826
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

1359 Vi Editor

  1. 2. <ul><li>The vi editor (short for visual editor) is a screen editor which is available on almost all Unix systems. </li></ul><ul><li>vi is a text editor, not a “WYSIWYG&quot; word processor </li></ul><ul><li>vi has no menus but instead uses combinations of keystrokes in order to accomplish commands. </li></ul>
  2. 3. <ul><li>Lets you add, change, and delete text but does not provide such formatting capabilities as centering lines or indenting paragraphs. </li></ul><ul><li>Can be used from any type of terminal </li></ul>
  3. 4. <ul><li>At the Unix prompt type vi followed by a file name. </li></ul><ul><li>vi filename </li></ul><ul><li>Then hit Return . You will see a screen similar to the one below which shows blank lines with tildes and the name and status of the file. </li></ul><ul><li>~ </li></ul><ul><li>~ </li></ul><ul><li>&quot;myfile&quot; [New file] </li></ul>
  4. 7. <ul><li>Command mode </li></ul><ul><li>Insert mode </li></ul>
  5. 8. <ul><li>In command mode, the letters of the keyboard perform editing functions. </li></ul><ul><li>Press escape <Esc> key to enter in command mode. </li></ul><ul><li>In insert mode, the letters you type form words and sentences. </li></ul><ul><li>Press the alphabet i to enter in insert mode. </li></ul>
  6. 10. <ul><li>KEY </li></ul><ul><li>h  </li></ul><ul><li>j  </li></ul><ul><li>k  </li></ul><ul><li>l  </li></ul><ul><li>CURSOR MOVEMENT </li></ul><ul><li>left one space </li></ul><ul><li>down one line </li></ul><ul><li>up one line </li></ul><ul><li>right one space </li></ul>
  7. 11. <ul><li>x  delete character </li></ul><ul><li>dw  delete word </li></ul><ul><li>dd  delete line </li></ul><ul><li>cw  replace a word </li></ul><ul><li>J  join succeeding line to current cursor line </li></ul><ul><li>u  undo last change </li></ul>
  8. 12. <ul><li>w  Forward word by word </li></ul><ul><li>b  Backward word by word </li></ul><ul><li>$  To end of line </li></ul><ul><li>0  To beginning of line </li></ul><ul><li>H  to top line of screen </li></ul><ul><li>M  to middle line of screen </li></ul><ul><li>L  to last line of screen </li></ul><ul><li>G  to last line of file </li></ul>
  9. 13. <ul><li>1G  to first line of file </li></ul><ul><li><Control>f  scroll forward one screen <Control>b  scroll backward one screen <Control>d  scroll down one-half screen <Control>u  scroll up one-half screen </li></ul>
  10. 14. <ul><li>:q or ZZ  save file and then quit </li></ul><ul><li>:w  save file </li></ul><ul><li>:q!  discard changes and quit file </li></ul><ul><li>:q  quit </li></ul>
  11. 15. <ul><li>SOME </li></ul><ul><li>EXAMPLES </li></ul>
  12. 25. <ul><li>THANK YOU </li></ul>

×