18.12.09

Using vi as the editor

Using vi as the editor

This tutorial is a basic tutorial for beginners who are confused how to use the vi editor in linux and unix

Vi editor has many features that help the programmers, but the novice user avoid the vi editor because they considered it very difficult and confusing. This article will teach you how to use vi


Vi is a screen editor used by many Unix users.
its the same thing Edit programs in MS-DOS.

Various kinds of editors in linux
1.vi
2.pico
3.joe
4.emacs
5.dll

a. How to start and end Vi

sam @ Vanadium: ~ $ vi [nama_file] -> to start the edited / new
sam @ Vanadium: ~ $ to end Vi press [Esc] then type: q

b.
        U

 L             R

        B

* R key button, to move to the right.
* L key button, to move to the left.
* U key button, to move on
* B key button, to move down

there are several commands to moving cursor:
^: Press the ctrl key
g: to switch to a specific line
^ F: move one full screen down
^ B: move to a full screen of
^ D: move a half-full screen to the bottom
^ U: move a half-full screen to the top
^ w: move one word forward
^ b: to move one word backward

c. Editing Text
press Esq press
* I (insert): enter the new text
* A: add text after the current cursor
* O: opening newline after the current line
* O: open a newline before the current line and add text
* X or delete: delete a character
* Dd: delete a row
* U: undo to cancel the order
* P: put the text
* W: save text
* Wq: save and exit
* E: open the file
* / [Text]: to search for the word up
*? [Text]: to search for the word down

How to pass either copy paste it and exploit source programs.

Copy:
press the ESC key
Navigate to the line where you want the text to be copied. If you just want to copy 1 line, then press y button twice.
If a lot of press shift v to block and then press the button once y times (for paste).
Paste Navigate to the location where the text in the memory you want to put it.
Press the ESC key
p press
Cut
Just like copy, but replace it with the y button d.



Komentar :

ada 0 comment ke “Using vi as the editor”

Post a Comment