El mejor lugar para guardar sus cosas de configuración es en su archivo .vimrc . Sin embargo, es de origen muy temprano, comprobar :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
Como se puede ver, su .vimrc se cargará antes de plugins. Si coloca :FindFileCache .
en él, se producirá un error, ya que ese comando aún no existe. (Existirá una vez que se carga el complemento en el paso 4.)
Para resolver esto, en lugar de ejecutar el comando directamente, crea un autocontrol . Los autocomandos ejecutan algunos comandos cuando ocurre un evento. En este caso, el eventoVimEnter parece apropiada (de :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.
A continuación, sólo tiene que colocar esta línea en su .vimrc:
autocmd VimEnter * FindFileCache .
+1, esta debería ser la respuesta aceptada, es mucho más limpio que crear un archivo separado para un comando. – stackunderflow
Utilicé esto para abrir vim en modo pantalla completa en Ubuntu: https://github.com/emmett9001/dotfiles/blob/115831ec75f19b60b30ddd521cd6e806467db18a/vimrc#L342 –
Quiero agregar que tuve este descanso en mí con E172 porque tuve un espacio después . – Caroline