26

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}?

Eugene Yarmash
  • 142,882
  • 41
  • 325
  • 378

1 Answers1

26

: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.

Luc Hermitte
  • 31,979
  • 7
  • 69
  • 83