VI 命令簡易使用說明

cklea發表於2008-01-30
 
                            ╭════════════╮
                            ║ VI  命令簡易使用說明 ║
                            ╰════════════╯
[@more@]

                            ╭════════════╮
                            ║ VI  命令簡易使用說明 ║
                            ╰════════════╯

    軟體簡介:資料編輯軟體

一、指令格式:
     vi  filename

二、使用說明:(Quick Reference Guide)
┌─────────────────────────────────────────────────╰{
│                 vi - Quick Reference Guide                                                        │
│                                                                                                   │
│                       % vi demo                                                                   │
│┌──────────────┐  :   ┌─────────┐ character   ┌─────────┐    │
││          (EX)              │     └─────────┘    │
│ Search Functions:                 |  Screen/Lin Movement:        | Add/Append Text:               │
│                                   |  j-下 k-上 h-左 l-右         |  a  Append after cursor        │
│ /exp  GO forward to exp           |  0 Goto line start           |  A  Append at line end         │
│ ?exp  GO backward to exp          |  s Goto line end             |  i  Insert before cursor       │
│                                   |  % Goto matching             | 5i  Insert text 5 times        │
│ Move and insert Text:             |    brace/paren               |  l  Insert at beginning of line│
│ :3,8d  Delete lines 3-8           |  G Goto last file line       |                                │
│ :4,9m 12 Move lines 4-9 to 12     | 3G Goto line 3               | Add new lines:                 │
│ :2,5t 13 Copy lines 2-5 to 13     |                              |  0  Open a line below cursor   │
│ :5,9w file Write lines 5-9 to file| Word Movement:               |  O  Open a line above cursor   │
│                                   |  W GO forword 1 word         |                                │
│ Save File and Exit:               | 3W GO forword 3 words        | Change text:                   │
│ :W         Write buffer to disk   |  B GO back 1 word            |  CW Change 2 word              │
│ :W newfile Write buffer to newfile| 3B GO back 3 words           | 3CW Change 3 words             │
│ :W! File   Write absolutely       |                              |  C  Change line                │
│ :Wq        Write buffer and quit  | Search Functions:            |  r  Replace one character      │
│ :q         Quit editor            | n  Repeat previous search    |  R  Replace/Type-over a line   │
│ :e         Load a fresh copy      | N  Reverse previous search   |                                │
│ :q!        Quit,discarding buffer |                              |                                │
│                                   | Delete Text:                 |                                │
│ :Control Edit Session:            |   x Delete one character     |                                │
│ :set nu    Display line numbers   |  dw Delete one word          |                                │
│ :set nonu  Turn off an option     |  dd Delete one ling          |                                │
│ :set all   Show all settings      |   D Delete to end of line    |                                │
│ :set List  display invisible chars|  do Delete to begin of line  |                                │
│ :set Wm=5  Wrap lines 5 sp from   |  dG Delete to end of file    |                                │
│            right margin           | 4dd Delete 4 lines           |                                │
│                                   |                              |                                │
│                                   | Cancel Edit Function:        |                                │
│                                   | u  Undo last change          |                                │
│                                   | .  Do last change again      |                                │
│                                   |                              |                                │
│                                   | Copy and insert Text:        |                                │
│                                   |  Y  Yank a copy of a line    |                                │
│                                   | 5Y  Yank a copy of 5 lines   |                                │
│                                   |  P  put below cursor         |                                │
│                                   |  P  put above cursor         |                                │
│                                   |                              |                                │
│                                   | Word processing functions:   |                                │
│                                   |  J  Join next line to current|                                │
│                                   | 4J  Join 4 lines to current  |                                │
│                                   |                              |                                │
│                                   | XP  Transposes 2 characters  |                                │
└─────────────────────────────────────────────────-┘
  *表內之資料節錄自SUN訓練教材--&gt Introduction to unix system

.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7196059/viewspace-998754/,如需轉載,請註明出處,否則將追究法律責任。

相關文章