How do I quickly switch between a set of frequently used files with Harpoon?
:lua require('harpoon.ui').toggle_quick_menu()
Harpoon by ThePrimeagen lets you mark a small set of files (typically 4-6) and instantly switch between them with dedicated keybindings.
category:
plugins
tags:
#plugins
#harpoon
#navigation
#file-switching
How do I make Vim automatically load a project-specific configuration file from the project directory?
Adding set exrc to your vimrc tells Vim to read a .
category:
config
tags:
#config
#ex-commands
#navigation
How do I switch to a faster regex engine in Vim when syntax highlighting is causing slowdowns?
Vim ships with two regex engines and lets you control which one is used.
category:
config
tags:
#config
#performance
#syntax
#regex
#editing
How do I jump directly to a specific tab page by its number in Vim?
Prefixing gt (go to next tab) with a count jumps directly to the tab page at that position.
category:
buffers-windows
tags:
#tabs
#buffers-windows
#navigation
#normal-mode
How do I search across files with lvimgrep and keep results in a window-local location list?
:lvimgrep /pattern/j **/* | lopen
Quickfix is great, but it is global.
category:
search
tags:
#search
#location-list
#quickfix
#project-navigation
How do I maximize a window to full height or make all windows equal size?
When working with multiple splits, you often want to focus on one window by making it as large as possible, then restore equal sizing when you're done.
category:
buffers-windows
tags:
#windows
#buffers
#navigation
#normal-mode
How do I change the case of text during a search and replace?
Vim's substitute command supports case conversion modifiers in the replacement string.
category:
search
tags:
#search
#substitute
#regex
#text-manipulation
How do I prevent the cursor from jumping when opening a split in Neovim?
Controls how Neovim preserves the visual position of content when creating, closing, or resizing horizontal splits.
category:
buffers-windows
tags:
#windows
#splits
#neovim
#config
#buffers
How do I control exactly what Vim saves when I create a session with :mksession?
The sessionoptions option (abbreviated ssop) is a comma-separated list of flags that determine what :mksession stores in the session file.
category:
buffers-windows
tags:
#buffers-windows
#config
#workflow
#sessions
How do I configure command-line Tab completion to show a list and complete the longest common match first?
: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.
category:
command-line
tags:
#command-line
#completion
#config
#ex-commands
How do I run a command on lines between two search patterns?
Vim allows pattern-based ranges in Ex commands, letting you operate on lines between two search matches.
category:
command-line
tags:
#command-line
#ranges
#patterns
#ex-commands
How do I move to the opposite corner of a visual block selection?
In visual block mode (), pressing O (uppercase) moves the cursor to the diagonally opposite corner of the rectangular selection.
category:
visual-mode
tags:
#visual-mode
#editing
#navigation
How do I extract the directory, filename, or extension from the current file path inside a Vim command?
Vim's filename modifiers let you derive path components from the current buffer's filename directly on the command line.
category:
command-line
tags:
#ex-commands
#command-line
#editing
How do I save a file only if it has unsaved changes, without touching the file timestamp if nothing changed?
The :update command (abbreviated :up) writes the buffer to disk only if it has been modified since the last save.
category:
command-line
tags:
#ex-commands
#buffers
#editing
How do I customize the sign column and line number display with a single expression in Neovim?
:set statuscolumn=%s%=%l\
Neovim 0.
category:
config
tags:
#config
#neovim
#statusline
#line-numbers
#formatting
How do I yank text from the cursor to the next occurrence of a pattern without entering visual mode?
Any operator in Vim can take a search motion as its argument.
category:
editing
tags:
#editing
#search
#motions
#normal-mode
How do I get a visual tab-completion menu for Vim commands and filenames?
The wildmenu option enhances Vim's command-line completion by showing a horizontal menu of matches above the command line when you press .
category:
config
tags:
#config
#command-line
#completion
#productivity
#vimrc
How do I apply a macro across multiple files at once?
:argdo normal @q | update
The :argdo command runs a command in every file in the argument list.
category:
macros
tags:
#macros
#batch-editing
#multi-file
#ex-commands
#workflow
How do I save a file I opened without sudo permissions?
The :w !sudo tee % command lets you save a file that requires root permissions, even if you forgot to open Vim with sudo.
category:
command-line
tags:
#command-line
#ex-commands
#editing
How do I wrap a word in quotes or brackets using vim-surround?
The ysiw" command wraps the word under the cursor in double quotes using the vim-surround plugin.
category:
plugins
tags:
#plugins
#text-objects
#editing
#insert-mode