2011-10-03 50 views

回答

6

檢查:h runtimepath用於爲 您的文件夾可能位置的完整描述(你不使用捆綁插件考慮)。以下是摘錄:

       *'runtimepath'* *'rtp'* *vimfiles* 
'runtimepath' 'rtp'  string (default: 
             Unix, Mac OS X: "$HOME/.vim, 
               $VIM/vimfiles, 
               $VIMRUNTIME, 
               $VIM/vimfiles/after, 
               $HOME/.vim/after" 
             ... 
         global 
         {not in Vi} 
     This is a list of directories which will be searched for runtime 
     files: 
      filetype.vim filetypes by file name |new-filetype| 
      scripts.vim filetypes by file contents |new-filetype-scripts| 
      autoload/  automatically loaded scripts |autoload-functions| 
      colors/  color scheme files |:colorscheme| 
      compiler/  compiler files |:compiler| 
      doc/   documentation |write-local-help| 
      ftplugin/  filetype plugins |write-filetype-plugin| 
      indent/  indent scripts |indent-expression| 
      keymap/  key mapping files |mbyte-keymap| 
      lang/   menu translations |:menutrans| 
      menu.vim  GUI menus |menu.vim| 
      plugin/  plugin scripts |write-plugin| 
      print/  files for printing |postscript-print-encoding| 
      spell/  spell checking files |spell| 
      syntax/  syntax files |mysyntaxfile| 
      tutor/  files for vimtutor |tutor| 

     And any other file searched for with the |:runtime| command. 

     The defaults for most systems are setup to search five locations: 
     1. In your home directory, for your personal preferences. 
     2. In a system-wide Vim directory, for preferences from the system 
      administrator. 
     3. In $VIMRUNTIME, for files distributed with Vim. 
                 *after-directory* 
     4. In the "after" directory in the system-wide Vim directory. This is 
      for the system administrator to overrule or add to the distributed 
      defaults (rarely needed) 
     5. In the "after" directory in your home directory. This is for 
      personal preferences to overrule or add to the distributed defaults 
      or system-wide settings (rarely needed). 

     ... 
0

您應該按照Eric的評論。

這麼說,我有我的.vimrc裏使用這些行:

- 編輯 -

我知道這個答案不是選擇之一,但我所以這裏學到感謝ZYX評論的東西是一個編輯。

下面的行應該寫成如下:

nnoremap <Esc>A <up> 
nnoremap <Esc>B <down> 
nnoremap <Esc>C <right> 
nnoremap <Esc>D <left> 
inoremap <Esc>A <up> 
inoremap <Esc>B <down> 
inoremap <Esc>C <right> 
inoremap <Esc>D <left> 

只怕的人很多做我做的完全一樣的錯誤:原料轉義代碼的解決方案是喜歡到處從網Vim wiki通過很多論壇來SO。

--END EDIT--

nnoremap <type ctrl+v then Esc to obtain a single char that looks like ^[>A <up> 
nnoremap <type ctrl+v then Esc to obtain a single char that looks like ^[>B <down> 
nnoremap <type ctrl+v then Esc to obtain a single char that looks like ^[>C <right> 
nnoremap <type ctrl+v then Esc to obtain a single char that looks like ^[>D <left> 
inoremap <type ctrl+v then Esc to obtain a single char that looks like ^[>A <up> 
inoremap <type ctrl+v then Esc to obtain a single char that looks like ^[>B <down> 
inoremap <type ctrl+v then Esc to obtain a single char that looks like ^[>C <right> 
inoremap <type ctrl+v then Esc to obtain a single char that looks like ^[>D <left> 

,並沒有需要刪除任何插件。

+0

不要將原始命令代碼添加到文件中,您已經有'<...>'符號和«看起來像^ [»的字符被表示爲''。令人驚訝的是,不是嗎?請注意,每當我看到''輸出' O [A-D]',而不是' [A-D]''這樣的問題時。 – ZyX

+0

這就是你盲目隨機發布論壇帖子時得到的結果。當然,我知道''['意思是'',但我相信這兩種符號具有不同的「重量」(由於沒有更好的詞)使用一個符合特定環境的符號。感謝您的信息,我現在要試一試。你有沒有使用.vimrc保留原始命令代碼的具體原因?除了完美的原因,我們已經有'<...>'我的意思了。 – romainl

+0

除了一點h/l移動不便之外,更多的原始控制代碼越多,mercurial保留我的配置的機會將該文件視爲二進制文件(因此不會顯示差異)。另外,如果你用':TOhtml',':Format'格式化你的插件,或者你會得到這些字符不顯示或者顯示爲'^ ['(並且將被複制)。難道你沒有看清楚自己:不是寫''而是寫''? – ZyX

0

而不是閱讀'runtimepath'規則,我認爲這是比較容易得到所有已安裝的腳本列表:

:scriptnames 

這將顯示每個腳本,VIM已加載的完整路徑。如果只有少數,那麼你可以找到你正在尋找的那個(autoclose.vim爲OP)。

如果列表很長,那麼你可以捕捉scriptnamesa寄存器的輸出(或任何其他),將其粘貼到一個空的緩衝區,並搜索插件的名稱:

:redir @a 
:scriptnames 
:redir END 
:new 
:put a 
:/autoclose\.vim