- 论坛徽章:
- 0
|
Chapter5 Using vi Editor
Three modes in
vi:
*command mode
*input(or insert)
mode
*last line mode(ex
commans mode)
*When you start
vi, it’s in command mode. If you want to go to text insert mode, press “i”. In
the text insert mode, you can’t issue any command. You can go back to command
by pressing “ESC”.
* “~” showing no text
in the line
*One line of text
maybe up 256 character in length. When you press , you go to the
next line.
save the file
after save the
file, you can quit vi by issue “:q” in last line mode
save and quit
save and quit
save the file as “filename” if have no name
quit without
saving
you can add “!”
to any command when you eant to force vi to do something
*Cursor movement
In the command mode(by
pressing ):
move one
character left
move one
character right
move one
character up
move one
character down
move one
character right
go to the last
line of the file
go to the (n)
number line of the file
go to the fist
line of the screen
go to the middle
line of the screen
go to the last
line of the screen
go to the
beginning of the of sentence
go to the end of
sentence
go to the
beginning of the paragraph
go to the end of
the paragraph
go to beginning
of current line
go to end of
current line
go to the
beginning of next word
go to the
beginning of previous word
go to the end of
word
show which line you are on
*Inserting
text
In command mode(pressing
from text-inserting mode)
start inserting text
at the current cursor location
start inserting text
at the beginning of the current line
start inserting
text at the next position relative to current cursor location
start inserting text
at the end of the current line
append a blank
line just below the current line and start inserting text from the beginning og
the new line
append a blank
line just above the current line and start inserting text from the beginning og
the new line
*Deleting
text
In command
mode(pressing from text-inserting mode)
deleting
character at current cursor
deleting n
caracters starting at current cursor location
deleting previous
character from the current cursor location
deleting n previous
character from the current cursor location
deleting current
line
deleting previous
word
deleting from
current cursor location to the end of the word
deteling to the
end of the file, including the current line
*Replacing
text
In command mode (pressing
from text-inserting mode)
repalce current character
remaining in command mode
relace current character and
go to insert mode
replace multiple characters
until “ESC” is pressed
change to the beginning of
next word
change the entire line
change to the end of the
file
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/14038/showart_78887.html |
|