vim 使用者手冊閱讀導覽

來源:互聯網
上載者:User

學習vim 時遇到了困難,所以想做點工作來減低一下門檻 ...

先一個例子來說明文檔的表示結構和方法 ...
#vim
  :help e117
內容如下:

                                                :cal :call E107 E117:[range]cal[l] {name}([arguments])                Call a function.  The name of the function and its arguments                are as specified with :function.  Up to 20 arguments can be                used.  The returned value is discarded.                Without a range and for functions that accept a range, the                function is called once.  When a range is given the cursor is                positioned at the start of the first line before executing the                function.                When a range is given and the function doesn't handle it                itself, the function is executed for each line in the range,                with the cursor in the first column of that line.  The cursor                is left at the last line (possibly moved by the last function                call).  The arguments are re-evaluated for each line.  Thus                this works:                                                function-range-example  >        :function Mynumber(arg)        :  echo line(".") . " " . a:arg        :endfunction        :1,5call Mynumber(getline("."))<                The "a:firstline" and "a:lastline" are defined anyway, they                can be used to do something different at the start or end of                the range.                Example of a function that handles the range itself: >        :function Cont() range        :  execute (a:firstline + 1) . "," . a:lastline . 's/^/\t\\ '        :endfunction        :4,8call Cont()<                This function inserts the continuation character "\" in front                of all the lines in the range, except the first one.                When the function returns a composite value it can be further                dereferenced, but the range will not be used then.  Example: >        :4,8call GetDict().method()<               Here GetDict() gets the range but method() does not.

每一個 >(包括前面的block(塊))<(包括後面的block(塊)),包括><中間的block(塊),構成一個完整的模組。

命令詳解:

:代表 命令模式
[range]代表範圍,[]表示option(可選)。
cal 表示調用,固定且必備。
{name}代表所要調用的函數名,name 是一個非固定值且必備。

([arguments]) 表示參數 左右括弧是必須的,[arguments] 是非固定的並且是可選的。

接下來開始對學習進行導航 :

在命令模式下:

:help user-manual

開啟使用者手冊,這或者vim最好的教程吧,嘻嘻 ,把游標 hjkl 移動到usr_02.txt 等高亮標籤上面去,按著 <C-]>是跳轉過去,<C-o>是跳回來(按鍵為Ctrl + o),<C-t>是返回。

:help usr_02.txt 是一個quicktutor

接下來是如何產看現有的映射情況:

:map 是查看映射情況

:nmap 是查看normal模式下的映射情況

:vmap 是查看visual模式下的映射情況

:imap 是查看insert 模式下的映射情況
:set 則可以看到一些現有的設定,例如runtimepath

說起來英文真是半桶水,有些地方看來一知半解,所以還是要藉助一下中文翻譯。

http://vimcdoc.sourceforge.net/  (下載中文文檔)

#wget http://prdownloads.sourceforge.net/vimcdoc/vimcdoc-1.8.0.tar.gz?download

#tar zxvf vimcdoc-1.8.0.tar.gz

此時注意要用普通使用者身份運行安裝指令碼.它會把文檔拷貝到$HOME/.vim 下。

#cd vimcdoc-1.8.0

#./vimcdoc.sh -i

這樣就ok 了 ,接下來就可以使用 :set helplang=en 和  :set helplang=cn進行切換了 。

而線上的中文使用者手冊可以在這裡,可以查看手冊的分類樹,還有檢索:
http://vimcdoc.sourceforge.net/doc/help.html  
通過google 搜尋來進行檢索 例如 : “烏幹達 site:vimcdoc.sourceforge.net”

而學習了部分基本操作之後,就需要進行配置和鼓搗外掛程式了,這裡有兩個小技巧分享一下 .

1." 設定檔.vimrc更改後自動重新載入使設定生效,而不需要重新啟動vim
autocmd! bufwritepost .vimrc source ~/.vimrc  

2.同時用外掛程式管理系統 vbundle , 來對外掛程式進行更新和安裝

https://github.com/gmarik/vundle

配置方法也在這個頁面裡面有。

其實還是有灰常多困難,只能慢慢摸索了 ...

QQ群:213572677,剛建,有興趣就來交流吧 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.