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}
?
Sourcing a file is 'executing' it. Essentially, each line of the file is considered a command. Sourcing it is the same as typing each command in order. You source with the command :source (usually shortened to :so ). So if you source myStuff.vim :so myStuff.vim.
The Runtime Path. The runtime path is similar to the environment variable PATH in Unix-based systems. Vim will search in these paths to locate and source many different files during startup. To see all of these paths, you can look at the value of the option runtimepath , by running the command :set runtimepath? .
Vim is a text editor to create or edit a text file, config file and programs on a Linux, macOS, and Unix-like system.
: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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With