Tempat terbaik untuk menyimpan barang-barang konfigurasi Anda adalah di
file .vimrc Anda . Namun, itu bersumber terlalu dini, periksa :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
Seperti yang Anda lihat, .vimrc Anda akan dimuat sebelum plugin. Jika Anda memasukkannya :FindFileCache .ke dalamnya kesalahan akan terjadi, karena perintah itu belum ada. (Ini akan ada setelah plugin dimuat di langkah 4.)
Untuk mengatasi ini, alih-alih menjalankan perintah secara langsung, buat perintah otomatis. Perintah otomatis menjalankan beberapa perintah saat suatu peristiwa terjadi. Dalam kasus ini, acara VimEnter terlihat sesuai (dari :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.
Kemudian, letakkan saja baris ini di .vimrc Anda :
autocmd VimEnter * FindFileCache .