How do I reload my vimrc or source a Vimscript file?
:source %
The :source command reads and executes a Vimscript file.
: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.
<C-w>> and <C-w><
The > and > increases width by 1 column > increases width by 10 columns maximizes the window width Example With a vertical split, 20> gives the current window 2
: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.
:diffthis in both windows
The :diffthis command enables diff mode for the current buffer.
: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.
"+y and "+p
The "+ register is linked to the system clipboard.
:reg a
The :reg a command shows the contents of register a, which reveals the keystrokes stored in the macro.
"/ register
The / register contains the most recent search pattern.
q{a-z}...q
Recording a macro captures a sequence of keystrokes into a register, which you can replay later.
qa ci"replacement<Esc> /next<CR> q
Macros can contain any Vim command including text objects, searches, and multi-key motions.
"1p through "9p
Registers 1-9 contain the last 9 deletions or changes that are at least one line long.
:g/pattern/norm @a
The :g/pattern/norm @a command combines the global command with macro execution.
qa ... j@bj q
You can create macros that call other macros, applying different operations to alternate lines or creating complex editing patterns.
:let @a = "Iprefix: \<Esc>"
The :let @a = ".