How do I temporarily set a Vim option?
:set option
The :set command changes Vim options for the current session.
:set option
The :set command changes Vim options for the current session.
:silent command
The :silent prefix suppresses all output from a command, including messages and prompts.
:source %
The :source command reads and executes a Vimscript file.
:mksession and :source
The :mksession command saves the current Vim session (windows, buffers, tabs, cursor positions) to a file.
:bufdo command
The :bufdo command executes an Ex command on every buffer in the buffer list.
:ball
The :ball command opens a window for every buffer in the buffer list.
:redir @a | command | redir END
The :redir command redirects Vim's command output to a register, file, or variable.
:execute "command"
The :execute command evaluates a string expression and runs it as an Ex command.
<C-f> from : prompt
Pressing while on the : command line opens the command-line window, where you can edit your command using full Vim editing capabilities.
:bp | bd #
The :bp bd # command switches to the previous buffer and then deletes the alternate buffer.
:autocmd Event pattern command
Autocommands let you execute commands automatically in response to events like opening a file, saving, or changing buffers.
:reg a
The :reg a command shows the contents of register a, which reveals the keystrokes stored in the macro.
:g/pattern/norm @a
The :g/pattern/norm @a command combines the global command with macro execution.
:let @a = "Iprefix: \<Esc>"
The :let @a = ".
":
The : register contains the last Ex command that was executed.
:let @a = ""
The :let @{register} = "" command empties a register.
:'<,'>normal @q
The :'normal @q command runs macro q on every line of the visual selection.
:'<,'>s/\%Vpattern/replacement/g
Using \%V in a substitute pattern restricts matching to within the visual block area only, rather than the full lines.
:earlier 10m
The :earlier command restores the buffer to its state at a specific time in the past.
:sort
The :sort command sorts lines in the current buffer or a specified range alphabetically.