How do I open a file and jump directly to a specific line or pattern?
The :edit command accepts a +{cmd} prefix that executes an Ex command immediately after the file is loaded.
category:
command-line
tags:
#buffers
#ex-commands
#navigation
#command-line
How do I search for a pattern across all files in my project with Vim's built-in grep?
:vimgrep /pattern/ (shortened to :vim) is Vim's built-in project-wide search.
category:
command-line
tags:
#search
#ex-commands
#navigation
#command-line
How do I open a related file with a different extension using the current filename?
In Vim's command line, % expands to the current buffer's filename.
category:
command-line
tags:
#ex-commands
#command-line
#buffers
#navigation
How do I cycle through all lowercase marks in the current file sequentially?
The ]' command jumps to the start of the line containing the next lowercase mark in the file, while [' jumps to the previous one.
category:
navigation
tags:
#navigation
#marks
#normal-mode
How do I change the working directory for only the current window without affecting other windows or tabs?
:cd changes the global working directory, affecting every window and tab in the session.
category:
buffers-windows
tags:
#buffers
#windows
#ex-commands
#navigation
How do I set a different working directory for each split window in Vim?
:lcd (local cd) sets the working directory for the current window only, leaving other windows at their previous directory.
category:
buffers-windows
tags:
#buffers-windows
#navigation
#ex-commands
#config
How do I see a list of recently opened files and quickly jump back to one?
:oldfiles displays a numbered list of every file Vim has recorded in its viminfo (or shada in Neovim) file.
category:
navigation
tags:
#navigation
#buffers
#ex-commands
How do I quickly switch between the current file and the last file I was editing?
:e # opens the alternate file — the file you were editing just before the current one.
category:
buffers-windows
tags:
#buffers
#editing
#ex-commands
#navigation
What is the difference between ' and ` when jumping to a mark in Vim?
Vim provides two distinct ways to jump to a mark, and they behave differently: the apostrophe ' jumps to the first non-blank character of the marked line, while
category:
navigation
tags:
#marks
#navigation
#normal-mode
How do I search for a pattern across all files in my project without leaving Vim?
:vimgrep /pattern/ searches recursively through all files in the current working directory tree using Vim's own regex engine, populating the quickfix list with
category:
search
tags:
#search
#quickfix
#ex-commands
#navigation
How do I reopen Vim and jump directly to where I was editing last time?
Pressing '0 in normal mode jumps to the exact cursor position in the most recently edited file, even after closing and reopening Vim.
category:
navigation
tags:
#navigation
#marks
#viminfo
#shada
#sessions
How do I pick from multiple tag matches instead of jumping to the first one?
g] is the disambiguation-aware alternative to .
category:
navigation
tags:
#navigation
#tags
How do I move through search matches while still typing the pattern?
While the search prompt is open (with incsearch enabled), pressing advances the cursor to the next match and moves it to the previous match — all without leav
category:
search
tags:
#search
#incsearch
#navigation
How do I bookmark a position in one file and jump back to it from any other file?
Uppercase marks (A–Z) are global marks — they persist across files and Vim sessions.
category:
navigation
tags:
#navigation
#marks
#buffers
How do I search for the word under the cursor as a substring, not a whole word?
The and # commands search for the exact whole word under the cursor (with word boundaries \).
category:
search
tags:
#search
#navigation
#normal-mode
How do I jump between function or section boundaries in Vim?
[[ and ]] navigate between section boundaries — typically the start of the previous or next top-level block.
category:
navigation
tags:
#navigation
#motions
#normal-mode
How do I open a file by name without knowing its full path?
The :find command searches for a file by name across all directories listed in Vim's path option, so you can open files without typing full paths.
category:
navigation
tags:
#navigation
#ex-commands
#buffers
#editing
How do I navigate between spelling errors and fix them in Vim?
Vim has a built-in spell checker that highlights misspelled words and provides correction suggestions — all without plugins.
category:
config
tags:
#config
#search
#navigation
How do I open the alternate (previously visited) buffer in a new split window?
Vim tracks the alternate buffer — the last file you were editing before the current one.
category:
buffers-windows
tags:
#buffers-windows
#navigation
#windows
How do I search for an exact multi-word phrase or special text I've selected?
In normal mode, searches for the word under the cursor with word-boundary anchors.
category:
search
tags:
#search
#visual-mode
#navigation