问题
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