How do I use marks inside a macro to return to a specific position?
qama{edits}'aq
How it works When a macro needs to jump to different parts of the file and then return to a starting position, marks are the perfect tool.
870 results for "it at"
qama{edits}'aq
How it works When a macro needs to jump to different parts of the file and then return to a starting position, marks are the perfect tool.
<C-r><C-f>
While typing a command, inserts the filename under the cursor in the buffer at the command-line prompt.
:set formatoptions
The formatoptions setting is a string of single-character flags that governs Vim's automatic text formatting: when lines wrap, whether comment syntax continues
O (in blockwise visual mode)
In blockwise Visual mode (), pressing O moves the cursor to the diagonally opposite corner of the rectangle.
<C-d> (in command mode)
Pressing in Vim's command line displays the full list of matching completions below the command prompt, without cycling through them one at a time.
command-line #command-line #completion #ex-commands #navigation
:set jumpoptions+=view
By default, when you navigate the jump list with (older) or (newer), Neovim restores the cursor's line and column but does NOT restore where the window was scro
Paste with "ap and execute keys manually
To debug a macro, paste its contents into the buffer, read each keystroke, and execute them one at a time to find where the macro goes wrong.
o (visual mode)
In visual mode, pressing o swaps the cursor between the two ends of the selection (the anchor and the free end).
qqq then qq{commands}@qq
A recursive macro in Vim calls itself at the end of its body, repeating automatically until one of its commands fails.
highlight TrailingWhitespace ctermbg=red and match TrailingWhitespace /\s\+$/
How it works Vim's highlight and match commands let you create custom visual indicators.
qa/https\?:\/\/\nyiW:put\nq
Record a macro that searches for URLs, yanks the URL, and puts it at the end of the file.
"=expression<CR>p
The expression register ("=) lets you evaluate any Vimscript expression and paste the result directly into your buffer from normal mode.
registers #registers #editing #normal-mode #productivity #math
<C-u> in insert mode
Pressing while in insert mode deletes all characters entered since you last entered insert mode on the current line.
:earlier {time} / :later {time}
Vim's :earlier and :later commands let you navigate the undo history by wall-clock time rather than by individual undo steps.
editing #editing #undo-redo #ex-commands #advanced #productivity
v:count1
The v:count1 variable holds the count typed before a command, defaulting to 1 if no count was given.
( ) { } [[ ]]
Vim provides structural navigation motions that move by sentences, paragraphs, and sections.
<C-x><C-e> and <C-x><C-y>
While in insert mode, scrolls the window up one line and scrolls it down one line — all without leaving insert mode.
qa$bywdw0Pa <Esc>q
Record a macro that yanks the last word, deletes it, pastes it at the beginning of the line.
:earlier {time} and :later {time}
Vim's :earlier and :later commands let you navigate the undo history by elapsed time rather than by edit count.
:set wildmode=list:longest,full
Vim's default Tab completion in the command-line cycles through matches one at a time, making it hard to see all available options at once.