How do I duplicate the current line to the end of the file without yanking or moving the cursor?
:.t$
The Ex command :.
233 results for "10@a"
:.t$
The Ex command :.
:ls +
The :ls command (or :buffers) supports filter flags that narrow the buffer list to specific states.
/\%>10l\%<20lpattern
Vim's \%>Nl and \%10l matches only after line 10 \%10l\%10l\%<20lold/new/g Combine with column restrictions for precise region targeting Tips Line numbers in \%
gcc / gc{motion}
The vim-commentary plugin by Tim Pope provides a simple, operator-based way to comment and uncomment code.
:'<,'>w {filename}
After making a visual selection, you can write only those lines to a new file using :'w {filename}.
{count}n
Like most Vim motions, the n and N search repeat commands accept a count prefix.
:g/pattern/normal @q
The :global command combined with :normal lets you execute a recorded macro on every line that matches a given pattern.
macros #macros #command-line #ex-commands #global #batch-editing
:set winfixbuf
Neovim's winfixbuf option (added in Neovim 0.
g<C-a> in visual mode
When you have multiple lines with the same number and want to turn them into a sequence (1, 2, 3.
:%s/pattern//n
The n flag in the substitute command suppresses the actual replacement and instead reports the match count.
"/
Vim stores the last search pattern in the special / register.
:keeppatterns normal! @q<CR>
When you replay macros from Ex commands, Vim can overwrite @/ (the last search pattern) depending on what the macro does.
set nrformats-=octal
By default, Vim treats numbers prefixed with a leading zero (like 007) as octal when you use or to increment or decrement them.
/\%>10l\%<20lTODO
Vim regex supports position atoms that can constrain where a match is allowed to occur.
:let @a = "value"
The :let @{reg} = expr command lets you assign any string or expression directly into a named register without entering insert mode or performing a yank.
:source % or :'<,'>source
The :source command executes Vimscript from a file.
command-line #command-line #vimscript #workflow #development
qa0f:dwj0q
How it works When recording a macro that you plan to repeat across multiple lines, the key technique is to end the macro positioned on the next line, ready for
!{motion} {cmd}
The ! operator passes text selected by a motion through an external shell command, replacing it with the command's output.
gx
The gx command opens the URL, file path, or identifier under the cursor using the system's default handler.
navigation #navigation #netrw #workflow #browser #normal-mode
:iabbrev <expr> {trigger} {expression}
The flag on :iabbrev turns the right-hand side into a Vimscript expression that is evaluated at expansion time rather than stored as a literal string.