亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊(cè) 查看新帖 |

Chinaunix

  平臺(tái) 論壇 博客 文庫(kù)
最近訪問(wèn)板塊 發(fā)新帖
查看: 1170 | 回復(fù): 0
打印 上一主題 下一主題

vim學(xué)習(xí) [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2007-11-20 20:27 |只看該作者 |倒序?yàn)g覽

                                                                                                vim的學(xué)習(xí)過(guò)程--學(xué)習(xí)的最好方法就是使用
一:tutor 初學(xué)
      初學(xué)linux編程,要會(huì)用gcc,gdb。。。。。。,但是首先要會(huì)一個(gè)編輯工具,先選擇vim來(lái)學(xué)習(xí)吧,在網(wǎng)上查詢了資料,發(fā)現(xiàn)有翻譯好了的vim文檔,就當(dāng)教材來(lái)學(xué)習(xí)吧。
這是文檔地址:在線的,http://vcd.gro.clinux.org/doc/usr_toc.html
      文檔里講了個(gè)vimtutor,我打開亂碼,使用vimtutor en就不亂碼了,en是語(yǔ)言吧應(yīng)該,試了ch,沒(méi)用,估計(jì)沒(méi)有中文的。教程里的列子很典型,淺顯易懂,非常好學(xué)。比我以前看的vim的書清晰多了。
PS:(網(wǎng)上搜到添加中文vim文檔的方法:
http://vcd.gro.clinux.org    (中文)
下載的文件包應(yīng)該是類似這樣的: vimcdoc-1.5.0.tar.gz
解壓后其中有個(gè)doc文件夾, 將其中的內(nèi)容全部復(fù)制到~/.vim/doc, 或者vim安裝目錄下的doc目錄中, 此時(shí)vim中的help信息已經(jīng)是中文的了.
注意:
a. 如果無(wú)法顯示中文, 在~/.vimrc中增加下面這句試試:
   set helplang=cn
b. 幫助文件的文本是utf-8編碼的, 如果想用vim直接查看, 需要在~/.vimrc中設(shè)置:
   set encoding=utf-8
      gvim--gui版本;
      vim--控制臺(tái)版本;
說(shuō)是30 分鐘的教程,花了兩個(gè)多小時(shí),慢慢來(lái),心急吃不了熱豆腐。Lesson 1 SUMMARY
光標(biāo)的移動(dòng);刪除(delete)操作;離開vim;文本編輯
  1. The cursor is moved using either the arrow keys or the hjkl keys.
         h (left)       j (down)       k (up)       l (right)
  2. To start Vim from the shell prompt type:  vim FILENAME
  3. To exit Vim type:        :q!     to trash all changes.
             OR type:         :wq     to save the changes.
  4. To delete the character at the cursor type:  x
  5. To insert or append text type:
         i   type inserted text            insert before the cursor
         A   type appended text            append after the line
NOTE: Pressing  will place you in Normal mode or will cancel
      an unwanted and partially completed command.
LESSON 2 SUMMARY
d motion的操作;undo,reundo;
  1. To delete from the cursor upto the next word type:    dw
  2. To delete from the cursor to the end of a line type:    d$
  3. To delete a whole line type:    dd
  4. To repeat a motion prepend it with a number:   2w
  5. The format for a change command is:
               operator   [number]   motion
     where:
       operator - is what to do, such as  d  for delete
       [number] - is an optional count to repeat the motion
       motion   - moves over the text to operator on, such as  w (word),
                  $ (to the end of line), etc.
  6. To move to the start of the line use a zero:  0
      move to the end of the line use : $
  7. To undo previous actions, type:           u  (lowercase u)
     To undo all the changes on a line, type:  U  (capital U)
     To undo the undo's, type:                 CTRL-R
LESSON 3 SUMMARY
put;replace;change;
  1. To put back text that has just been deleted, type   p .  This puts the
     deleted text AFTER the cursor (if a line was deleted it will go on the
     line below the cursor).
  2. To replace the character under the cursor, type   r   and then the
     character you want to have there.
     R: replace a word!(in lesson 6)
  3. The change operator allows you to change from the cursor to where the
     motion takes you.  eg. Type  ce  to change from the cursor to the end of
     the word,  c$  to change to the end of a line.
  4. The format for change is:
         c   [number]   motion
Lesson 4 SUMMARY
光標(biāo)定位;查找替換;括號(hào)匹配;
CURSOR LOCATION AND FILE STATUS
  ** Type CTRL-G to show your location in the file and the file status.
     Type  G  to move to a line in the file. **
THE SEARCH COMMAND
** Type  /  followed by a phrase to search for the phrase. **
MATCHING PARENTHESES SEARCH
** Type  %  to find a matching ),], or } . **
Note: This is very useful in debugging a program with unmatched parentheses!
THE SUBSTITUTE COMMAND
** Type  :s/old/new/g  to substitute 'new' for 'old'. **
1. CTRL-G  displays your location in the file and the file status.
             G  moves to the end of the file.
     number  G  moves to that line number.
            gg  moves to the first line.
  2. Typing  /  followed by a phrase searches FORWARD for the phrase.
     Typing  ?  followed by a phrase searches BACKWARD for the phrase.
     After a search type  n  to find the next occurrence in the same direction
     or  N  to search in the opposite direction.
     CTRL-O takes you back to older positions, CTRL-I to newer positions.
  3. Typing  %  while the cursor is on a (,),[,],{, or } goes to its match.
Note: This is very useful in debugging a program with unmatched parentheses!
  4. To substitute new for the first old in a line type    :s/old/new
     To substitute new for all 'old's on a line type       :s/old/new/g
     To substitute phrases between two line #'s type       :#,#s/old/new/g
     To substitute all occurrences in the file type        :%s/old/new/g
     To ask for confirmation each time add 'c'             :%s/old/new/gc
LESSON 5 SUMMARY
執(zhí)行外部命令;保存;選擇性保存;替換文件內(nèi)容;
  1.  :!command  executes an external command.
      Some useful examples are:
         (MS-DOS)         (Unix)
          :!dir            :!ls            -  shows a directory listing.
          :!del FILENAME   :!rm FILENAME   -  removes file FILENAME.
  2.  :w FILENAME  writes the current Vim file to disk with name FILENAME.
  3.  v  motion  :w FILENAME  saves the Visually selected lines in file
      FILENAME.
  4.  :r FILENAME  retrieves disk file FILENAME and puts it below the
      cursor position.
  5.  :r !dir  reads the output of the dir command and puts it below the
      cursor position
LESSON 6 SUMMARY
拷貝;查找模式;
  1. Type  o  to open a line BELOW the cursor and start Insert mode.
     Type  O  to open a line ABOVE the cursor.
  2. Type  a  to insert text AFTER the cursor.
     Type  A  to insert text after the end of the line.
  3. The  e  command moves to the end of a word.
  4. The  y  operator yanks (copies) text,  p  puts (pastes) it.
  5. Typing a capital  R  enters Replace mode until    is pressed.
  6. Typing ":set xxx" sets the option "xxx".  Some options are:
        'ic' 'ignorecase'       ignore upper/lower case when searching
        'is' 'incsearch'        show partial matches for a search phrase
        'hls' 'hlsearch'        highlight all matching phrases
     You can either use the long or the short option name.
  7. Prepend "no" to switch an option off:   :set noic
LESSON 7 SUMMARY
幫助;自動(dòng)補(bǔ)全;
  1. Type  :help  or press  or   to open a help window.
  2. Type  :help cmd  to find help on  cmd .
  3. Type  CTRL-W CTRL-W  to jump to another window
  4. Type  :q  to close the help window
  5. Create a vimrc startup script to keep your preferred settings.
  6. When typing a  :  command, press CTRL-D to see possible completions.
     Press  to use one completion.
               
               
               
               
               
               
               
               
               
               
               
               

本文來(lái)自ChinaUnix博客,如果查看原文請(qǐng)點(diǎn):http://blog.chinaunix.net/u1/54537/showart_426930.html
您需要登錄后才可以回帖 登錄 | 注冊(cè)

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號(hào)-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號(hào):11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專區(qū)
中國(guó)互聯(lián)網(wǎng)協(xié)會(huì)會(huì)員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過(guò)ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請(qǐng)注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP