How do I execute a Vimscript expression as a macro without recording it?
@=
The @= command lets you type a Vimscript expression and execute the result as if it were a macro.
@=
The @= command lets you type a Vimscript expression and execute the result as if it were a macro.
\u and \l in :s replacement
Vim's substitute command supports special case modifiers in the replacement string that let you change the case of captured text on the fly.
:{range}normal {commands}
The :normal command executes normal mode keystrokes from the command line.
command-line #command-line #ex-commands #editing #normal-mode
:center
The :center command pads a line with leading spaces so the text is centered within a given width.
:'<,'>m'>+1
The :m command with the visual range moves selected lines.
:vimgrep /pattern/ **/*.py
By specifying a file glob pattern with :vimgrep, you can restrict the search to specific file types.
:let @b = @a
The :let @b = @a command copies the contents of register a into register b.
:set updatetime=250
The updatetime option controls how long Vim waits after you stop typing before triggering certain events (like swap file writes and CursorHold autocommands).
V select then :norm A text
Selecting lines and running :norm A text appends the same text to the end of every selected line.
:set termguicolors
The termguicolors option enables 24-bit RGB color support, allowing color schemes to use millions of colors instead of the terminal's 256-color palette.
<C-r>=system('cmd')
In command-line mode, =system('command') evaluates the shell command and inserts its output into the command line.
:s/pattern/replace/flags
The substitute command supports several flags that modify its behavior.
:set belloff=all
The belloff=all option disables all error bells and visual bells in Vim.
:bwipeout
The :bwipeout command (:bw) completely removes a buffer from Vim's memory, including its marks, options, and variables.
:enew
The :enew command creates a new unnamed empty buffer in the current window.
:TestNearest (vim-test)
vim-test provides commands to run tests from within Vim.
:Git command (e.g., :Git status)
vim-fugitive by Tim Pope is a comprehensive Git wrapper for Vim.
:Make (vim-dispatch)
vim-dispatch by Tim Pope provides asynchronous build commands in Vim.
:set textwidth=80
The textwidth option sets the maximum width for text.
:command Name action
The :command command defines a new user Ex command.