Der beste Ort, um Ihre Konfigurationssachen aufzubewahren, ist in Ihrer .vimrc-
Datei. Es wird jedoch zu früh bezogen. Überprüfen Sie :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
Wie Sie sehen können, wird Ihre .vimrc vor Plugins geladen. Wenn Sie setzen:FindFileCache . es eingeben, tritt ein Fehler auf, da dieser Befehl noch nicht vorhanden ist. (Es wird existieren, sobald das Plugin in Schritt 4 geladen wurde.)
Um dies zu lösen, erstellen Sie einen automatischen Befehl, anstatt den Befehl direkt auszuführen. Auto-Befehle führen einen Befehl aus, wenn ein Ereignis auftritt. In diesem Fall sieht das VimEnter- Ereignis angemessen aus (von :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.
Dann setzen Sie einfach diese Zeile in Ihre .vimrc :
autocmd VimEnter * FindFileCache .