each selected line.
See |visual-repeat|, |default-mappings|.
*Q*
Q Repeat the last recorded register [count] times.
See |reg_recorded()|.
*v_Q-default*
{Visual}Q In linewise Visual mode, repeat the last recorded
register for each selected line.
See |visual-repeat|, |default-mappings|.
*:@*
:[addr]@{0-9a-z".=*+} Execute the contents of register {0-9a-z".=*+} as an Ex
command. First set cursor at line [addr] (default is
current line). When the last line in the register does
not have a <CR> it will be added automatically when
the 'e' flag is present in 'cpoptions'.
For ":@=" the last used expression is used. The
result of evaluating the expression is executed as an
Ex command.
Mappings are not recognized in these commands.
When the |line-continuation| character (\) is present
at the beginning of a line in a linewise register,
then it is combined with the previous line. This is
useful for yanking and executing parts of a Vim
script.
*:@:*
:[addr]@: Repeat last command-line. First set cursor at line
[addr] (default is current line).
:[addr]@ *:@@*
:[addr]@@ Repeat the previous :@{register}. First set cursor at
line [addr] (default is current line).
==============================================================================
Using Vim scripts *using-scripts*
For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
*:so* *:source* *load-vim-script*
:so[urce] {file} Runs |Ex-commands| or Lua code (".lua" files) from
{file}.
Triggers the |SourcePre| autocommand.
:[range]so[urce] Read Ex commands or Lua code from the [range] of lines
in the current buffer. When [range] is omitted read
all lines. The buffer is treated as Lua code if its
'filetype' is "lua" or its filename ends with ".lua".
When sourcing commands or Lua code from the current
buffer, the same script-ID |<SID>| is used even if the
buffer is sourced multiple times. If a buffer is
sourced more than once, then the functions in the
buffer are defined again.
*:source!*
:so[urce]! {file}
Runs |Normal-mode| commands from {file}. When used
after |:global|, |:argdo|, |:windo|, |:bufdo|, in
a loop or when another command follows the display
won't be updated while executing the commands.
*:ru* *:runtime*
:ru[ntime][!] [where] {file} ..
Sources |Ex| commands or Lua code (".lua" files) read
from {file} (a relative path) in each directory given
by 'runtimepath' and/or 'packpath'.
Ignores non-existing files.
Example: >
:runtime syntax/c.vim
:runtime syntax/c.lua
< There can be multiple space-separated {file}
arguments. Each {file} is searched for in the first
directory from 'runtimepath', then in the second
directory, etc.
When [!] is included, all found files are sourced.
Else only the first found file is sourced.
When [where] is omitted only 'runtimepath' is used.
Other values:
START search only under "start" in 'packpath'
OPT search only under "opt" in 'packpath'
PACK search under "start" and "opt" in
'packpath'
ALL first use 'runtimepath', then search
under "start" and "opt" in 'packpath'
When {file} contains wildcards it is expanded to all
matching files. Example: >
:runtime! plugin/**/*.{vim,lua}
< This is what Nvim uses to load the plugin files when
starting up. This similar command: >
:runtime plugin/**/*.{vim,lua}
< would source the first file only.
For each {file} pattern, if two `.vim` and `.lua` file
names match and differ only in extension, the `.vim`
file is sourced first.
When 'verbose' is one or higher, there is a message
when no file could be found.
When 'verbose' is two or higher, there is a message
about each searched file.
*:pa* *:packadd* *E919*
:pa[ckadd][!] {name} Search for an optional plugin directory in 'packpath'
and source any plugin