Vim – 如何在启动vim时立即运行命令?
发布时间:2020-12-15 16:36:14 所属栏目:安全 来源:网络整理
导读:我有一个插件(FindFile.vim)需要运行:FindFileCache。每当我开始vim收集文件缓存快速打开..我必须运行这个每次我启动vim虽然。 我怎么可以写一个运行一次,每次vim启动的命令? 保存配置的最好的地方是.vimrc 文件。但是,它的来源太早,检查:h startup:
我有一个插件(FindFile.vim)需要运行:FindFileCache。每当我开始vim收集文件缓存快速打开..我必须运行这个每次我启动vim虽然。
我怎么可以写一个运行一次,每次vim启动的命令?
保存配置的最好的地方是.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将在插件之前加载。如果你放 为了解决这个问题,而不是直接执行命令,创建一个 *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 . (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |