How do I run shell commands without leaving Vim?
:!ls -la
Vim lets you execute any shell command directly from within the editor using the :! (bang) command.
953 results for ":normal"
:!ls -la
Vim lets you execute any shell command directly from within the editor using the :! (bang) command.
:set list
The :set list command makes invisible characters visible by displaying them as special symbols.
<C-g>u
By default, Vim treats an entire Insert mode session (from entering Insert mode to pressing ) as a single undo unit.
:vsplit
The :vsplit command (or :vs for short) splits the current window vertically, creating a new window side-by-side with the current one.
qq /pattern<CR> {commands} q
By incorporating a search command inside a macro, you can make it jump to the next occurrence of a pattern before performing its edits.
vim.on_key()
vim.
:call setreg('q', keys, 'c')
The setreg() function writes any string directly into a named register, letting you construct macro keystrokes from Vimscript expressions rather than live recor
:let @a=getline('.')<CR>@a
How it works Instead of recording keystrokes interactively, you can write a sequence of Vim commands as plain text in your buffer and then execute that text as
:tjump {name}
Vim's :tjump is the smarter sibling of :tag and :tselect.
:only
The :only command closes every window in the current tab page except the one your cursor is in.
let mapleader = ' ' then nnoremap <leader>key command
The leader key is a configurable prefix for your custom key mappings.
<C-r><C-r>{reg}
When you insert a register with {reg} in insert mode, Vim processes the content as if you had typed it — this means autoindent, autoformat, and insert-mode ma
:set breakindentopt=shift:2
When breakindent is enabled, wrapped continuation lines are indented to match the start of their logical line.
<C-v> (command-line mode)
In command-line mode (after : or /), pressing followed by any key inserts that key literally — bypassing all key notation, mappings, and special interpretatio
Use :s/pat/rep/e flag or :silent! prefix
By default, Vim macros abort on the first error — a failed search, a substitute with no matches, or a movement that can't be performed.
gq
The gq operator reformats text to fit within your configured textwidth.
inoremap <Left> <C-g>U<Left>
In insert mode, any cursor movement — including arrow keys, Home, and End — causes Vim to split the undo block at that point.
<C-r><C-r>
In command-line mode, {reg} inserts a register's contents — but it processes certain sequences, potentially misinterpreting backslashes, pipe characters, or e
:s/pattern/replacement/e
The e flag in Vim's :substitute command silently ignores the "E486: Pattern not found" error when the pattern does not match anything.
:let i=1 then use <C-r>=i<CR> in macro
By combining a Vimscript variable with the expression register inside a macro, you can create a counter that increments on each replay.