2016-03-08 135 views
0

加載一個名爲[utl.vim][1]的插件後,我需要獲取一些配置行。如何加載plugin後加載vimscript文件utl.vim?

documentation說,我需要把這些配置到after-directory

[23] NOte that you cannot include this line in your .vimrc because it is 
    :source'd before utl_rc.vim (which defines g:utl_cfg_hdl_mt_generic). 
    So either include/change it at <url:config:#r=utl_cfg_hdl_mt_text_directory> 
    or include it in the after-directory, see <url:vimhelp:after-directory#5.> 

我創建了一個名爲utl.vim~/.vim/after/目錄下的文件。

但是這個文件不是來源。我使用:scriptnames驗證了這一點。

如何確保Vim在加載utl.vim插件後獲得此文件?

回答

2

文件的列表/由Vim的裝載目錄在:help startup進行說明。儘管它列出了plugin目錄,但它沒有提及目錄after,所以你看到的是預期的行爲。

通常after目錄是源文件類型插件,如在Vim FAQ 26.3 - "How do I extend an existing filetype plugin?"說明。這可能是插件將運行像:runtime! after/**/*.vim,但是如果文檔不清楚將要問的插件作者,因爲這將是可能更容易爲用戶被允許設置此變量,並將其插件可以附加/添加默認值爲它