How do I jump back to where I was before my last search?
``
The double backtick jumps to the exact position before the last jump.
795 results for "g* g#"
``
The double backtick jumps to the exact position before the last jump.
qaYp<C-a>q99@a
By recording a macro that duplicates a line and increments its number, you can generate a numbered list of any length with a single replay command.
macros #macros #editing #normal-mode #automation #productivity
Use :let i=1 with macro
By combining a Vimscript variable with a macro, you can create sequences with incrementing numbers.
:Git
The vim-fugitive plugin by Tim Pope provides an interactive Git status window that lets you stage, unstage, diff, and commit files entirely from within Vim.
:'<,'>normal @q
The :'normal @q command runs macro q on every line of the visual selection.
/pattern\_s\+next
Vim's regular expressions support multi-line matching through underscore-prefixed atoms.
autocmd FileType {lang} setlocal {options}
Vim's autocmd FileType lets you apply settings that only take effect when editing a specific file type.
<leader><leader>w
vim-easymotion lets you jump to any visible position by highlighting targets with unique letters.
:'<,'>!awk '{print toupper($0)}'
Vim can pipe any visual selection through external Unix commands and replace the selection with the output.
visual-mode #visual-mode #external-command #awk #text-transformation
:'<,'>retab!
The :retab! command converts between tabs and spaces based on your expandtab setting.
gi
The gi command moves the cursor to the position where you last exited insert mode and immediately enters insert mode again.
navigation #navigation #insert-mode #marks #normal-mode #productivity
<C-o> and <C-i>
Vim maintains a jump list of positions you have visited.
/[\x00-\x1f]
Files sometimes contain hidden control characters that cause subtle bugs.
{N}%
The {N}% command jumps the cursor to the line that is N percent of the way through the file.
:execute 'normal! ' . count . 'j'
The :execute command evaluates a string as an Ex command, enabling dynamic command construction.
guiw
The guiw command converts the entire word under the cursor to lowercase.
gUiw
The gUiw command converts the entire word under the cursor to uppercase.
:set scrolloff=5
The scrolloff option keeps a minimum number of lines visible above and below the cursor when scrolling.
: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
<C-y>,
The emmet-vim plugin brings the full power of Emmet (formerly Zen Coding) to Vim, letting you type a short CSS-like abbreviation and expand it into a complete H