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

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 閱讀(343) 評(píng)論(0)  編輯 收藏 引用 所屬分類: vi
<2009年6月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

常用鏈接

留言簿(10)

隨筆分類(307)

隨筆檔案(297)

algorithm

Books_Free_Online

C++

database

Linux

Linux shell

linux socket

misce

  • cloudward
  • 感覺這個(gè)博客還是不錯(cuò),雖然做的東西和我不大相關(guān),覺得看看還是有好處的

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

搜索

  •  

最新評(píng)論

閱讀排行榜

評(píng)論排行榜

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            欧美韩国日本一区| 欧美国产一区二区在线观看| 久久er精品视频| 亚洲小说欧美另类婷婷| 亚洲美女少妇无套啪啪呻吟| 国产性猛交xxxx免费看久久| 欧美视频免费看| 国产精品久久久久久福利一牛影视| 美国成人直播| 性做久久久久久| 久久一区二区三区超碰国产精品| 午夜一区在线| 男人的天堂成人在线| 欧美国产日韩精品| 亚洲成人自拍视频| 蜜桃av噜噜一区| 久久久久久久网站| 久久蜜桃资源一区二区老牛 | 亚洲激情成人在线| 一区二区三区精密机械公司| 艳妇臀荡乳欲伦亚洲一区| 欧美亚洲一区二区在线观看| 久久久久看片| 国产视频亚洲精品| 亚洲伦理精品| 免费的成人av| 午夜久久一区| 国产精品久久久久久五月尺| 亚洲福利精品| 午夜在线不卡| 亚洲国产精品va在看黑人| 亚洲一区二区三区在线看| 久久久999成人| 国产亚洲欧美一区二区三区| 亚洲一级特黄| 亚洲天堂av在线免费| 欧美精品日韩一本| 91久久精品国产91性色| 噜噜噜在线观看免费视频日韩| 亚洲一区在线观看视频| 麻豆国产精品777777在线| 美日韩精品视频| 韩国女主播一区| 亚洲激情婷婷| 亚洲精品一二三| 欧美日韩小视频| 亚洲欧美日韩国产精品| 亚洲一区二区三区色| 国产美女精品视频免费观看| 久久精品国产免费| 久久色中文字幕| 9久草视频在线视频精品| 日韩亚洲一区二区| 国产欧美不卡| 亚洲国产日韩欧美在线99| 欧美日本不卡视频| 久久精品91久久久久久再现| 免费不卡在线观看| 小处雏高清一区二区三区| 久久久精品欧美丰满| 一本色道综合亚洲| 久久久国产精品一区二区三区| 亚洲久久一区二区| 久久精品人人爽| 午夜精品视频在线观看一区二区| 久久精品成人欧美大片古装| 一区二区三区国产盗摄| 久久精品欧美日韩精品| 一区二区三区久久| 久久精品视频播放| 欧美在线观看网站| 国产精品久久午夜| 欧美视频在线观看视频极品| 欧美国产乱视频| 麻豆91精品91久久久的内涵| 在线电影国产精品| 亚洲国产精品毛片| 欧美一区午夜视频在线观看| 亚洲高清资源综合久久精品| 亚洲视频国产视频| 欧美性做爰毛片| 亚洲欧美日韩国产一区二区三区 | 国产一区二区成人久久免费影院| 亚洲激情在线观看视频免费| 国产精品久久久久久久久久直播| 久久精品国产亚洲一区二区| 国产精品永久免费视频| 亚洲一区在线观看免费观看电影高清| 9人人澡人人爽人人精品| 欧美激情综合亚洲一二区| 亚洲精品久久久久久下一站| 亚洲欧洲一区二区天堂久久| 欧美精选一区| 亚洲欧美欧美一区二区三区| 欧美一级成年大片在线观看| 久久一区亚洲| 亚洲美女视频在线观看| 国产精品国色综合久久| 久久亚洲捆绑美女| 亚洲午夜av| 亚洲国产欧美一区二区三区丁香婷| 亚洲视频播放| 亚洲黄一区二区三区| 国产一区二区你懂的| 欧美日韩中文精品| 欧美韩日一区二区| 久久精品色图| 久久久www成人免费无遮挡大片| 一区二区成人精品| 亚洲最新视频在线| 亚洲高清资源| 日韩亚洲视频| 国产精品久久一区二区三区| 美女久久一区| 久热国产精品| 欧美激情国产日韩精品一区18| 久久久精品tv| 麻豆国产精品777777在线| 久久久999精品免费| 久久精品国产69国产精品亚洲| 性高湖久久久久久久久| 亚洲欧美综合精品久久成人| 在线亚洲自拍| 欧美亚洲日本国产| 久久精品亚洲一区二区| 久久免费精品日本久久中文字幕| 久久精品国产一区二区三区| 亚洲欧美国产不卡| 久久久天天操| 国产欧美日韩一区二区三区在线观看| 国产一区香蕉久久| 亚洲激情电影在线| 欧美亚洲在线视频| 欧美黑人国产人伦爽爽爽| 亚洲国产欧美久久| 一区二区三区日韩在线观看| 午夜精品一区二区三区电影天堂 | 亚洲精品自在久久| 欧美一级黄色网| 欧美三级视频在线观看| 国产亚洲一区二区三区在线观看| 精品1区2区| 久久se精品一区二区| 亚洲精品五月天| 欧美成人免费小视频| 国内精品视频一区| 久久久久中文| 欧美在线欧美在线| 国产精品乱码人人做人人爱| 亚洲欧美美女| 亚洲大片av| 久久久久久高潮国产精品视| 欧美精品成人| 亚洲欧洲一区二区在线播放| 久久久久久久网站| 久久精品国产第一区二区三区最新章节 | 欧美一区二区三区视频在线观看| 亚洲第一页中文字幕| 久久久综合香蕉尹人综合网| 韩国v欧美v日本v亚洲v| 久久久噜噜噜久久中文字免| 午夜精品福利一区二区三区av | 亚洲人午夜精品免费| 欧美成人午夜影院| 亚洲精品美女在线观看| 亚洲免费黄色| 欧美理论大片| 欧美一区二区三区视频在线观看| 亚洲女同精品视频| 在线观看久久av| a4yy欧美一区二区三区| 国产精品av免费在线观看| 日韩亚洲一区二区| 国产婷婷色一区二区三区| 巨胸喷奶水www久久久免费动漫| 久久天天躁狠狠躁夜夜爽蜜月| 亚洲人成网站在线播| 亚洲一区二区精品在线观看| 国产中文一区二区三区| 亚洲国产欧美一区二区三区同亚洲| 欧美日韩人人澡狠狠躁视频| 久久精品一二三区| 国产精品一区视频| 亚洲视频在线播放| 免费在线日韩av| 男男成人高潮片免费网站| 国产精品腿扒开做爽爽爽挤奶网站| 亚洲欧洲一区二区三区在线观看| 欧美日韩大片| 久久久久国产精品一区| 欧美日韩一区二区视频在线观看| 久久精品国产清高在天天线| 欧美色图一区二区三区| 亚洲日韩视频| 亚洲人成毛片在线播放| 欧美超级免费视 在线| 欧美激情女人20p| 日韩午夜av电影| 欧美午夜精品久久久久久超碰| 亚洲一本视频|