How do I move selected lines down in the file?
:'<,'>m'>+1
The :m command with the visual range moves selected lines.
261 results for ":b#"
:'<,'>m'>+1
The :m command with the visual range moves selected lines.
:set nrformats+=alpha
By default, and only increment and decrement numbers (decimal, hex, and octal depending on format).
:silent keeppatterns %s/\s\+$//e
Trailing whitespace cleanup is a common housekeeping step, but a plain substitution can leave side effects: it can overwrite your last search pattern (@/) and t
command-line #command-line #ex-commands #editing #search #formatting
/pattern1\&pattern2
Vim's \& operator lets you intersect two patterns so the match must satisfy both simultaneously.
vaB
The aB text object (around Block) selects everything from the matching { to the closing } — including the braces themselves.
:let @q =
Instead of recording a macro with q, you can assign any string directly to a named register using :let @{register} = 'keys'.
:bnext
The :bnext (or :bn for short) command switches to the next buffer in Vim's buffer list.
:call setreg('a', @a . 'text', 'l')
How it works Vim provides two functions for advanced register manipulation: setreg() and getreg().
vim.iter()
vim.
:bprev
The :bprev (or :bp for short) command switches to the previous buffer in Vim's buffer list.
:let @a = 'text'
Vim's :let command lets you assign a value directly to any named register without performing a yank or delete operation.
registers #registers #macros #vimscript #ex-commands #normal-mode
\%'m
Vim's \%'m regex atom matches the exact position of mark m in a search pattern.
]c and [c
When files are open in Vim's built-in diff mode — whether via vimdiff, :diffsplit, or :diffthis — the ]c and [c motions let you jump precisely between chang
:argdedupe
If you build an arglist incrementally (:args, :argadd, glob expansions), duplicates can sneak in and make :argdo workflows slower or confusing.
command-line #command-line #arglist #batch-editing #workflow
"1 through "9
Vim maintains a rotating history of deleted text across registers "1 through "9.
g'{mark}
Vim's standard mark-jump commands ('a, ` a `) always add the current position to the jumplist before leaping to the mark.
vim.print()
vim.
:arglocal
By default, Vim's argument list is global, so changing it in one window can unexpectedly affect another workflow in a different tab or split.
:tabmove +1
:tabmove normally takes an absolute position (:tabmove 0 moves the tab to the far left), but it also accepts relative offsets using + and -.
:set jumpoptions=stack
By default Vim's jump list is a ring: if you press to go back several positions and then make a new jump, the list wraps around and future entries are preserved