How do I see git diff changes in the Vim sign column with vim-gitgutter?
:GitGutterToggle
vim-gitgutter is a plugin that shows git diff markers in the sign column (the narrow column to the left of line numbers).
Search Vim Tricks
Searching...:GitGutterToggle
vim-gitgutter is a plugin that shows git diff markers in the sign column (the narrow column to the left of line numbers).
> and <
How it works In visual mode, you can shift selected lines to the right or left using the > and to indent them or or shifts the selected lines one shiftwidth to
@@
How it works After running a macro with @a (or any other register), you can repeat that same macro by pressing @@.
gaip=
vim-easy-align is a plugin by Junegunn Choi that makes aligning text around delimiters effortless.
:bdelete
How it works The :bdelete command (often abbreviated :bd) removes the current buffer from Vim's buffer list and closes it.
:cabbrev
:cabbrev (command-line abbreviation) lets you define short aliases for longer Ex commands.
:set statusline=%f\ %y\ [%l/%L]
Vim's statusline option lets you build a custom status bar from format items.
"0p in visual mode
When you paste over a visual selection with p, Vim replaces the selection with the register contents — but it also puts the deleted selection into the unnamed
Va{ or Vi{
The a{ (around braces) and i{ (inside braces) text objects combined with visual mode let you instantly select an entire function body or code block, regardless
visual-mode #visual-mode #text-objects #code-navigation #selection
:windo / :bufdo / :tabdo {command}
Vim's do commands iterate over collections and execute a command in each context.
buffers-windows #buffers #windows #tabs #batch-editing #ex-commands
:verbose map <key> or :verbose set option?
The :verbose prefix shows where a mapping, setting, command, or function was defined — which file and line number.
command-line #command-line #debugging #config #mappings #workflow
r{char} in visual mode
In visual mode, pressing r followed by a character replaces every character in the selection with that single character.
o (in visual mode)
While in visual mode, pressing o swaps the cursor to the opposite end of the selection.
<C-]> / <C-t>
The command jumps to the definition of the keyword under the cursor using a tags file, and jumps back.
:Telescope live_grep
Telescope's livegrep picker provides real-time regex search across your entire project as you type.
Treesitter incremental selection with grn/grc
nvim-treesitter provides incremental selection that expands based on the syntax tree rather than simple text patterns.
:source % or :'<,'>source
The :source command executes Vimscript from a file.
command-line #command-line #vimscript #workflow #development
:set statusline=%f\ %m%r%h%w\ %=%l/%L\ %p%%
Vim's statusline option accepts printf-style format codes that display file info, position, mode, and any custom expression.
:%s/pattern/\=MyFunc(submatch(0))/g
The \= prefix in Vim's substitute replacement invokes the expression register, which can call any Vimscript function.
:%s/pattern/\=@0/g
The \=@0 replacement expression inserts the contents of register 0 (last yank) as the replacement text.