Basic Syntax Or Command Vi (vim)

There never feel frustrated when you have to do edit the file in Linux? Or have you how the confusion out of the vi editor? I have therefore I write this article that do not have to kill every time should exit from the vi ..

To start vi editor can be done in two ways, namely:
1. to use them directly

vi

and you will be under the vi editor with the blank page.

2. to use them with

vi filename

done to edit a file that already exists or if the filenames are not automatically opened a blank file with a name like that typed.

Mode in vi
1. command mode:
the mode where we give commands to the vi text manipulation to make or files. To ensure that we are in the command mode just press ESC

2. Insert mode:
the mode where we are allowed to insert text to edit or delete text in the file. to start this mode enough when I command in the mode.

Before us dizzy with the commands that we must recognize the following command with this because we can exit from the vi editor.
all done via the command mode
1. : Q [enter]
exit from the vi editor only when there are no modifications at all.

2.ZZ
exit from the vi and save the results of last modification

3. : wq [enter]
exit from the vi and save the results of last modification to the files.

4. [enter]
exit from the vi and save the results of last modification to the files.

5. : q! [enter]
vi forced out of the store without modification results.

Ok you can exit from the vi now we learn how to move in the vi editor.
1. l, right arrow or space
used to move the right one character

2. h, or left arrow
used to move one character to the left

3. j, or down arrow
used to move one line down.

4. k, or arrows on the
used to move a line to the top.

5. : 0 or 1-shift-G
to move to the first line

6. : $
to move to the last line

7. nG
to move to the line to the n

8. 0
to move to the beginning

9. $
to move to the end of the line

After can move freely in the vi editor we learn to do edit the text.
1. x
remove one character at the cursor position
2. X
delete characters to the left of the cursor
3. ss
delete one line at the cursor position
4. d [enter]
remove two barus, position the cursor on the line and the next line
5. d0
remove the line from the beginning until the position where the cursor is located
6. d $
remove from the position of the cursor to the last line.

Switching between the screen (scrolling)
1. ctrl-b
move one screen to the top of the (previous)
2. ctrl-d
move one screen to the bottom (after him)
3. ctrl-f
Decrease the one screen
4. ctrl-j
up half the screen.

Copy and paste
Some commands can be repeated several times by adding the amount of repetition in front of the command.
For example, if you want to copy and paste a few lines of direct use the following steps:
1. place the cursor position on the line, which will be copied.
2. example, if you want to copy 3 rows, use the command 3yy (press 3 followed by a number of key y 2x)
3. place the cursor position on the place that will be in insertkan and then press p.

The commands in vi.
1. U or u
to cancel the previous (Undo)
2. / Or?
command to search for a word used to use them with “word” or “the words” without the quotes, of course
3. / \
This command will only find the word out in which words such as the word ghost, a, and carpenters will be ignored.
4. : 1.7 s / balloon / car / g
to change the word balloon with the words car from the line to 1 to 7

Related Posts:

  • Configuration Cron and Crontab
    Cron is a program that perform tasks that have been scheduled based on the table crontab. Cron complete this task by himself awake every minute and check whether there is a jobs, which must be based o...
  • 20 Tools Editor Wordpress / Blogger
    20 Aplikasi yang bisa membantu qta Blogging. Ada yang free ada yang bayar, berikut daftar lengkapnya :- BlogJet Platform: Windows only Price: Free trial / €29.95 Supports: WordPress, ...
  • Konsep Dasar Linux
    Apakah Linux tepat untuk Anda ? Anda ingin beralih dari DOS ke Linux? Ide Bagus! tapi hati hati, ada kemungkinan bahwa ini tidak akan berguna bagi Anda, IMHO, tidak ada komputer ataupun sistem opera...

Tags: , , , ,

12.Nov.08 Linux


You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.

Reader's Comments

  1. Configuration Cron and Crontab | EarlyEdition.Info Free Tutorial and Information | November 15th, 2008 at 7:50 pm

    [...] must be based o&#110 t&#104e table dijala&#110ka&#110&#110ya &#99ro&#110tab. Please note the differen&#99e bet&#119een &#99ron same &#99rontab. Cron is a pr&#111&#103ram or daemon, [...]

Leave a Comment

:)