आपके कॉन्फ़िगरेशन सामान को रखने का सबसे अच्छा स्थान आपकी .vimrc
फ़ाइल में है। हालाँकि, यह बहुत जल्दी शुरू होता है, जाँच करें :h startup:
At startup, Vim checks environment variables and files and sets values
accordingly. Vim proceeds in this order:
1. Set the 'shell' and 'term' option *SHELL* *COMSPEC* *TERM*
2. Process the arguments
3. Execute Ex commands, from environment variables and/or files *vimrc* *exrc*
4. Load the plugin scripts. *load-plugins*
5. Set 'shellpipe' and 'shellredir'
6. Set 'updatecount' to zero, if "-n" command argument used
7. Set binary options
8. Perform GUI initializations
9. Read the viminfo file
10. Read the quickfix file
11. Open all windows
12. Execute startup commands
जैसा कि आप देख सकते हैं, प्लगइन्स से पहले आपका .vimrc लोड हो जाएगा। यदि आप इसमें डालते :FindFileCache .हैं तो एक त्रुटि आएगी, क्योंकि यह कमांड अभी तक मौजूद नहीं है। (यह प्लगइन 4. चरण में लोड होने के बाद मौजूद होगा)
इसे हल करने के लिए, कमांड को सीधे निष्पादित करने के बजाय, एक ऑटो-कमांड बनाएं। जब कोई घटना होती है तो ऑटो-कमांड कुछ कमांड निष्पादित करते हैं। इस स्थिति में, VimEnter ईवेंट उपयुक्त (से :h VimEnter) दिखता है :
*VimEnter*
VimEnter After doing all the startup stuff, including
loading .vimrc files, executing the "-c cmd"
arguments, creating all windows and loading
the buffers in them.
फिर, इस लाइन को अपने .vimrc में रखें :
autocmd VimEnter * FindFileCache .