What's the difference between ':source file' and ':runtime file' in vim?

佐手、 提交于 2019-12-30 03:01:12

问题


I saw this command in the /etc/vimrc file on my system:

runtime! vimrc_example.vim

From the docs:

:ru[ntime][!] {file} .. Read Ex commands from {file} in each directory given by 'runtimepath'.

Is it otherwise equivalent to :source {file}?


回答1:


:source sources the file specified by the path given (relative or absolute)

:runtime sources the first file (unless banged!) found in &runtimepath that matches the partial path given.

BTW, the pathnames used with :runtime can contain wildchars (somehow a glob-pattern). This has nothing to do with regexes.



来源:https://stackoverflow.com/questions/7321073/whats-the-difference-between-source-file-and-runtime-file-in-vim

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!