在windows中使用gVim的時候,安裝插件時看說明需要放到vimfiles文件夾中。在安裝gVim的時候,會自動在安裝目錄下創建vimfiles和執行程序文件夾vimXX。當時在安裝插件的時候,就有一個疑問,vim的執行程序是在vimXX文件夾裏面,爲什麼安裝到該vimfiles文件夾下,vim程序會自動讀取到。
經過Google查詢,發現有篇文章中是這樣寫的:
I have been wondering for a long time why my beloved Vim plugins would not load under Windows. It turns out Vim looks for them in $HOME/vimfiles/plugins under Windows. More information can be found with :help runtimepath.
然後我在vim中輸入了 :help runtimepath 看到以下說明:
'runtimepath' 'rtp' vimfiles
'runtimepath' 'rtp' string (default:
Unix: "$HOME/.vim,
$VIM/vimfiles,
$VIMRUNTIME,
$VIM/vimfiles/after,
$HOME/.vim/after"
Amiga: "home:vimfiles,
$VIM/vimfiles,
$VIMRUNTIME,
$VIM/vimfiles/after,
home:vimfiles/after"
PC, OS/2: "$HOME/vimfiles,
$VIM/vimfiles,
$VIMRUNTIME,
$VIM/vimfiles/after,
$HOME/vimfiles/after"
Macintosh: "$VIM:vimfiles,
$VIMRUNTIME,
$VIM:vimfiles:after"
RISC-OS: "Choices:vimfiles,
$VIMRUNTIME,
Choices:vimfiles/after"
VMS: "sys$login:vimfiles,
$VIM/vimfiles,
$VIMRUNTIME,
$VIM/vimfiles/after,
sys$login:vimfiles/after")
從這個說明中可以看出:
在Windows中runtimepath包括
對於