青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

posts - 297,  comments - 15,  trackbacks - 0
Moving around
These commands help you move around in a file:
h
Move left one character on the current line
j
Move down to the next line
k
Move up to the previous line
l
Move right one character on the current line
w
Move to the next word on the current line
e
Move to the next end of word on the current line
b
Move to the previous beginning of the word on the current line
Ctrl-f
Scroll forward one page
Ctrl-b
Scroll backward one page
If you type a number before any of these commands, then the command will be
executed that many times. This number is called a repetition count or simply count.
For example, 5h will move left five characters. You can use repetition counts with
many vi commands.

Moving to lines
The following commands help you move to specific lines in your file:
G
Moves to a specific line in your file. For example, 3G moves to line 3. With no
parameter, G moves to the last line of the file.
H
Moves relative to the top line on the screen. For example, 3H moves to the line
currently 3rd from the top of your screen.
L
Is like H, except that movement is relative to the last line on screen. Thus, 2L
moves to the second-to-last line on your screen.

Getting out of vi
One of the most useful things to know about a new editor is how to get out of it
before you do anything you shouldn't do, such as destroying an important
configuration file. You can get out of vi by saving or abandoning your changes, or by
restarting from the beginning. If these commands don't seem to work for you, you
may be in insert mode, which you will learn about in a moment. If in doubt, pressing
Esc will leave insert mode and return you to command mode where these
commands should work.
:q!
Quit editing the file and abandon all changes. This is a very common idiom for
getting out of trouble.
:w!
Write the file (whether modified or not). Attempt to overwrite existing files or
read-only or other unwritable files. You may give a filename as a parameter,
and that file will be written instead of the one your started with. It's generally
safer to omit the ! unless you know what you're doing here.
ZZ
Write the file if it has been modified. Then exit. This is a very common idiom for
normal vi exit.
:e!
Edit the current disk copy of the file. This will reload the file, abandoning
changes you have made. You may also use this if the disk copy has changed
for some other reason and you want the latest version.
:!
Run a shell command. Type the command and press Enter. When the
command completes, you will see the output and a prompt to return to vi
editing.
Notes:
1. When you type the colon (:), your cursor will move to the bottom line of
your screen where you can type in the command and any parameters.
2. If you omit the exclamation point from the above commands, you may
receive an error message such as one saying changes have not been
saved, or the output file cannot be written (for example, you are editing a
read-only file).
3. The : commands have longer forms (:quit, :write, :edit), but the longer
forms are seldom used.
vi modes
The vi editor has two modes of operation:
Command mode
In command mode, you move around the file and perform editing operations
such as searching for text, deleting text, changing text, and so on. You usually
start in command mode.
Insert mode
In insert mode, you type new text into the file at the insertion point. To return to
command mode, press the Esc (Escape) key.
These two modes determine the way the editor behaves. Anything you type in insert
mode is considered text to be inserted into the file. If you are trying to type a
command and nothing happens, or the character appears under the cursor, then you
probably forgot to press Esc to escape from insert mode.
Editing text
Now that you can open a file in vi, move around it and get out, it's time to learn how
to edit the text in the file.
Modifying text
Use the following commands when you need to insert, delete, or modify text. Note
that some of these commands have an uppercase form that is similar to the
lowercase form; see the descriptions below.
i
Enter insert mode before the character at the current position. Type your text
and press Esc to return to command mode. Use I to insert at the beginning of
the current line.
a
Enter insert mode after the character at the current position. Type your text and
press Esc to return to command mode. Use A to insert at the end of the current
line.
c
Use c to change the current character and enter insert mode to type
replacement characters.
o
Open a new line for text insertion below the current line. Use O to open a line
above the current line.
cw
Delete the remainder of the current word and enter insert mode to replace it.
Use a repetition count to replace multiple words. Use c$ to replace to end of
line.
dw
Same as for cw (and c$) above, except that insert mode is not entered.
dd
Delete the current line. Use a repetition count to delete multiple lines.
x
Delete the character at the cursor position. Use a repetition count to delete
multiple characters.
p
Put the last deleted text after the current character. Use P to put it before the
current character.
xp
This combination of x and p is a useful idiom. This swaps the character at the
cursor position with the one on its right.
Searching text
You can search for text in your file using regular expressions:
/
Use / followed by a regular expression to search forward in your file.
?
Use ? followed by a regular expression to search backward in your file.
n
Use n to repeat the last search in either direction.
You may precede any of the above search commands with a number indicating a
repetition count. So 3/x will find the third occurrence of x from the current point, as
will /x followed by 2n. Similarly, 2/^e will find the second line from the current position
that starts with e.
Note that search will wrap around to the top once the bottom of file is reached.
Getting help
Another useful command in vi is the help command, which you invoke by typing
:help. Help will open inside vi; use the :q command to leave help and go back to
your work. If you want help on some particular topic, say wrapping of lines, try
adding a word after the :help command, for example: :help wrap.
Putting it together
We began by wanting to add a line to our count1.sh file. To keep the original and
save the modified version as count2.sh, we could use these vi commands once we
open the file with vi. Note that <Esc> means to press the Esc key.
Listing 3. Editor commands to add a line to count1.sh
1G
O
sleep 20<Esc>
:w! count2.sh
:q
These commands do the following:
1G
Move to the first line of the file
O
Open a new line above it and enter insert mode
sleep 20
The new text that you want to add
<Esc>
Press the Esc key to return to command mode
:w! count2.sh
Write the file to disk
:q
Close vi
Simple when you know how.
This is the last article for Exam 101 - Topic 103: GNU and UNIX commands. See our
series roadmap for a description of and link to other articles in this series.

from:
IBM Developer works
posted on 2010-03-16 15:04 chatler 閱讀(351) 評論(0)  編輯 收藏 引用 所屬分類: vi

只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


<2010年11月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

常用鏈接

留言簿(10)

隨筆分類(307)

隨筆檔案(297)

algorithm

Books_Free_Online

C++

database

Linux

Linux shell

linux socket

misce

  • cloudward
  • 感覺這個博客還是不錯,雖然做的東西和我不大相關,覺得看看還是有好處的

network

OSS

  • Google Android
  • Android is a software stack for mobile devices that includes an operating system, middleware and key applications. This early look at the Android SDK provides the tools and APIs necessary to begin developing applications on the Android platform using the Java programming language.
  • os161 file list

overall

搜索

  •  

最新評論

閱讀排行榜

評論排行榜

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            老**午夜毛片一区二区三区| 欧美jizzhd精品欧美巨大免费| 亚洲欧洲另类国产综合| 久久亚洲国产成人| 亚洲欧洲日本专区| 亚洲精品乱码久久久久久按摩观| 欧美成人午夜激情| 国产精品99久久久久久久久| 亚洲视频在线免费观看| 国产精品―色哟哟| 久久漫画官网| 欧美高清在线播放| 亚洲一区中文| 久久精品色图| 亚洲精品日韩欧美| 国产精品99久久久久久有的能看| 国产精品色在线| 巨乳诱惑日韩免费av| 欧美成va人片在线观看| 亚洲永久视频| 久久综合网hezyo| 日韩小视频在线观看专区| 亚洲视频在线观看网站| 精品动漫3d一区二区三区| 亚洲激情视频在线| 国产精品色一区二区三区| 欧美a级一区| 欧美午夜一区| 欧美成人精品影院| 国产精品青草久久| 欧美激情日韩| 国产亚洲一区二区三区在线播放 | 国产精品日韩欧美一区二区| 久久成人av少妇免费| 欧美99久久| 久久久水蜜桃| 欧美视频网址| 亚洲春色另类小说| 国产午夜精品理论片a级探花| 欧美激情一区二区久久久| 国产精品综合视频| 99re热这里只有精品视频| 极品少妇一区二区三区精品视频| 一区二区日韩| 亚洲理伦电影| 蜜臀久久久99精品久久久久久| 欧美中文字幕在线播放| 欧美精品一区三区在线观看| 麻豆国产精品777777在线| 国产精品中文字幕欧美| 日韩视频免费观看| 亚洲精品久久| 乱码第一页成人| 久久综合给合久久狠狠色| 国产精品欧美精品| 中文国产成人精品| 亚洲私人黄色宅男| 欧美日韩中文字幕日韩欧美| 亚洲激情在线| 亚洲精品久久久蜜桃| 久久综合狠狠综合久久激情| 久久久久久97三级| 国产一区二区三区网站| 性欧美办公室18xxxxhd| 久久国产精品黑丝| 国产亚洲精品久久飘花 | 久久综合999| 国产一区二区精品丝袜| 欧美一区二区三区久久精品| 久久国产精品99久久久久久老狼 | 国产乱码精品一区二区三区不卡| a4yy欧美一区二区三区| 亚洲视频狠狠| 国产精品久久久久三级| 亚洲一区激情| 久久久久久国产精品mv| 极品中文字幕一区| 久久综合狠狠综合久久综青草| 欧美1区2区| 9i看片成人免费高清| 欧美色中文字幕| 亚洲欧美日韩精品| 久久综合影视| 99视频超级精品| 国产精品区一区二区三区| 欧美一级欧美一级在线播放| 老司机精品视频网站| 亚洲毛片一区| 国产精品久久久久国产精品日日| 亚洲欧美另类综合偷拍| 欧美 日韩 国产在线| 日韩亚洲精品电影| 国产精品一区久久久| 久久久久久久波多野高潮日日| 欧美国产精品专区| 亚洲专区在线| 伊人成人在线| 欧美日韩中文字幕日韩欧美| 欧美在线一二三区| 最新高清无码专区| 欧美在线亚洲在线| 亚洲欧洲精品一区二区三区| 国产精品久久久久av免费| 久久精品日韩一区二区三区| 亚洲美女诱惑| 免费高清在线视频一区·| 这里只有精品丝袜| 一区二区亚洲精品国产| 欧美午夜精品电影| 久久在线免费观看| 亚洲一二三四区| 亚洲福利在线观看| 久久aⅴ乱码一区二区三区| 91久久亚洲| 国产亚洲欧美另类中文| 欧美午夜激情视频| 欧美成人精品影院| 久久久久九九视频| 亚洲欧美成人| 一本久道久久综合中文字幕| 欧美大秀在线观看| 久久久久国产精品www| 亚洲直播在线一区| 99综合在线| 亚洲精品日韩欧美| 一区二区在线视频播放| 国产欧美一区二区精品性| 欧美涩涩视频| 欧美日韩高清在线| 欧美黄色精品| 欧美www视频| 麻豆精品精品国产自在97香蕉| 欧美在线观看日本一区| 亚洲欧美韩国| 亚洲一区激情| 亚洲四色影视在线观看| 日韩亚洲不卡在线| 亚洲人成网站999久久久综合| 欧美成ee人免费视频| 另类激情亚洲| 免费成人激情视频| 欧美成人精品h版在线观看| 久久这里有精品15一区二区三区| 久久国产福利| 久久先锋影音| 欧美大片在线观看一区| 免费av成人在线| 欧美高潮视频| 最近中文字幕日韩精品| 最新精品在线| 亚洲精品资源| 一区二区欧美激情| 亚洲午夜国产成人av电影男同| 日韩午夜激情av| 99亚洲一区二区| 亚洲在线一区二区| 午夜精品久久久久久久99黑人| 亚洲欧美在线x视频| 久久激情久久| 麻豆精品视频在线观看| 欧美剧在线观看| 国产精品黄页免费高清在线观看| 国产精品日韩一区| 好看不卡的中文字幕| 91久久久久久国产精品| 中文日韩在线| 久久精品国产77777蜜臀| 久久免费视频一区| 亚洲国产精品va在线观看黑人| 亚洲黄色毛片| 亚洲欧美日韩精品在线| 久久国产精品网站| 欧美福利电影在线观看| 国产精品www| 一区免费视频| 亚洲视频欧美在线| 久久亚洲国产成人| 亚洲精品美女久久久久| 香蕉国产精品偷在线观看不卡| 久久亚洲一区| 国产精品日本| 亚洲人成啪啪网站| 欧美中日韩免费视频| 最新中文字幕亚洲| 欧美中文在线字幕| 欧美日韩国产黄| 尤物在线观看一区| 亚洲综合色婷婷| 亚洲国内精品| 久久久国产精品一区二区中文| 欧美日韩精品综合在线| 黄色精品一区| 午夜一区不卡| 91久久综合亚洲鲁鲁五月天| 久久福利电影| 国产麻豆精品theporn| 亚洲美女色禁图| 蜜臀av性久久久久蜜臀aⅴ| 亚洲女性裸体视频| 欧美日韩一区二区欧美激情 |