How do I specify line ranges in Ex commands to target specific parts of a file?
Every Ex command in Vim can be preceded by a range that specifies which lines it should operate on.
category:
command-line
tags:
#command-line
#ex-commands
#ranges
#editing
#productivity
How do I navigate and operate on sentences and paragraphs in Vim?
Vim treats sentences and paragraphs as first-class navigation units.
category:
navigation
tags:
#navigation
#motions
#text-objects
#prose
#editing
How do I split a single-line code statement into multiple lines or join them back in Vim?
The splitjoin.
category:
plugins
tags:
#plugins
#splitjoin
#editing
#refactoring
#formatting
How do I view all available branches in Vim's undo tree to recover changes that u and Ctrl-R can't reach?
Vim's undo history is a tree, not a linear stack.
category:
editing
tags:
#undo-redo
#editing
#command-line
How do I view the contents of all registers in Vim?
The :registers command displays the contents of all Vim registers, showing you exactly what text is stored in each one.
category:
registers
tags:
#registers
#ex-commands
#normal-mode
How do I do a live fuzzy search across all files with Telescope in Neovim?
Telescope's livegrep picker provides real-time regex search across your entire project as you type.
category:
plugins
tags:
#plugins
#search
#fuzzy-finder
#neovim
#telescope
How do I copy a range of lines to another location without yanking and pasting?
The :t command (short for :copy) duplicates lines from one location to another without touching any registers.
category:
command-line
tags:
#editing
#ex-commands
#lines
#productivity
#ranges
How do I programmatically find the project root directory in Neovim Lua based on marker files?
vim.
category:
config
tags:
#neovim
#lua
#project
#lsp
#filesystem
How do I jump forward through the jump list after going back with Ctrl-O?
Every time you make a "jump" — using G, /, %, :tag, , or similar commands — Vim records your position in the jump list.
category:
navigation
tags:
#navigation
#normal-mode
How do I copy and paste to the system clipboard?
The "+ register is linked to the system clipboard.
category:
registers
tags:
#registers
#editing
#normal-mode
How do I customize Vim's statusline to show useful file information?
:set statusline=%f\ %y\ [%l/%L]
Vim's statusline option lets you build a custom status bar from format items.
category:
config
tags:
#config
#formatting
How do I quickly comment and uncomment code with vim-commentary?
gcc (toggle line), gc{motion} (toggle range)
vim-commentary by Tim Pope provides a simple way to toggle comments.
category:
plugins
tags:
#plugins
#editing
How do I search for yanked text literally in Vim without escaping regex characters?
When your yanked text includes regex symbols like .
category:
search
tags:
#search
#registers
#command-line
#regex
How do I open a file explorer sidebar in Vim with NERDTree?
The NERDTree plugin provides a full-featured file explorer sidebar in Vim, giving you a visual directory tree that you can navigate, search, and manipulate file
category:
plugins
tags:
#plugins
#nerdtree
#files
#navigation
#explorer
How do I fix broken or incorrect syntax highlighting in Vim?
Vim's syntax highlighting engine does not always parse the entire file from the beginning — it uses sync points to determine where to start parsing for the vi
category:
config
tags:
#config
#ex-commands
#editing
How do I see the raw UTF-8 byte values of the character under the cursor?
Pressing g8 in normal mode displays the UTF-8 encoding of the character under the cursor as a sequence of hex bytes.
category:
navigation
tags:
#navigation
#encoding
#unicode
#normal-mode
How do I export the current buffer as syntax-highlighted HTML from within Vim?
Vim ships with a built-in plugin that converts the current buffer into a standalone HTML file, complete with your exact syntax highlighting colors.
category:
command-line
tags:
#command-line
#editing
#ex-commands
How do I auto-indent a block of code using visual mode?
Pressing = in visual mode auto-indents the selected lines according to Vim's built-in indentation rules.
category:
visual-mode
tags:
#editing
#visual-mode
#indentation
#formatting
#productivity
How do I paste or reuse my last search pattern from the search register?
Vim stores the last search pattern in the search register "/.
category:
registers
tags:
#registers
#search
#editing
How do I wrap a word or text object with quotes, brackets, or tags in Vim?
The vim-surround plugin provides the ys (you surround) operator to wrap any Vim text object or motion with a delimiter pair.
category:
plugins
tags:
#plugins
#surround
#editing
#text-objects
#normal-mode