How do I always maximize the current split window when I switch focus without using plugins?
:set winwidth=999 winheight=999
Setting winwidth=999 and winheight=999 tells Vim to try to make the active window at least 999 columns wide and 999 rows tall whenever it gains focus.
category:
buffers-windows
tags:
#windows
#config
#buffers
How do I prevent accidental edits to a buffer by making it completely read-only?
:set nomodifiable locks a buffer so that no changes can be made at all — not even temporary ones.
category:
buffers-windows
tags:
#buffers
#editing
#normal-mode
#ex-commands
How do I open a file found in Vim's path setting in a new split without typing the full path?
:sfind (split-find) searches Vim's path setting for a file matching the given name and opens it in a new horizontal split, all in one command.
category:
navigation
tags:
#navigation
#buffers
#windows
#ex-commands
How do I jump directly to the top-left or bottom-right window in a complex split layout?
When managing multiple splits, t jumps to the top-left window and b jumps to the bottom-right window.
category:
buffers-windows
tags:
#windows
#navigation
#buffers
How do I move my cursor into the preview window to interact with its contents?
The preview window is a special auxiliary split — usually at the top — opened by commands like :ptag, :pedit, and omni-completion to display reference infor
category:
buffers-windows
tags:
#buffers
#windows
#navigation
#editing
How do I view the git history for the current file as a navigable quickfix list using vim-fugitive?
Running :Gclog in vim-fugitive loads the git log for the current file into the quickfix list.
category:
plugins
tags:
#plugins
#git
#buffers
#quickfix
How do I paste the name of the alternate (previously edited) file into the buffer?
The # register holds the name of the alternate file — the file you were editing just before the current one.
category:
registers
tags:
#registers
#buffers
#navigation
#normal-mode
How do I configure Vim's :grep command to use a faster external search tool like ripgrep or ag?
:set grepprg={cmd} grepformat={fmt}
Vim's :grep command delegates to an external tool defined by grepprg, then parses the output according to grepformat to populate the quickfix list.
category:
search
tags:
#search
#ex-commands
#config
#buffers
How do I jump to a tag in a new split window showing all matching tags?
g] splits the window and then runs :tselect for the identifier under the cursor, displaying a numbered list of all matching tags so you can pick the exact defin
category:
buffers-windows
tags:
#navigation
#buffers
#windows
#tags
How do I find a file by name in Vim's path and open it in a new tab?
:tabfind is the tab-aware counterpart to :find.
category:
buffers-windows
tags:
#buffers
#tabs
#navigation
#ex-commands
How do I create new files and directories directly inside Vim's built-in file browser without leaving Vim?
Vim's built-in file explorer netrw (opened with :Explore or :Ex) is more capable than it looks.
category:
buffers-windows
tags:
#buffers
#navigation
#netrw
#editing
How do I make Vim's built-in file explorer display files as a tree rather than a flat list?
Vim ships with a built-in file browser called netrw, opened with :Explore (or :Ex).
category:
config
tags:
#config
#navigation
#netrw
#buffers
How do I use Harpoon to bookmark project files and jump between them instantly?
:lua require('harpoon.mark').add_file()
Harpoon by ThePrimeagen is a Neovim plugin that maintains a small, numbered list of the files you're actively working on.
category:
plugins
tags:
#navigation
#buffers
#marks
#plugins
How do I view the git commit history for the current file in vim-fugitive?
vim-fugitive's :Gclog command loads the git log into the quickfix list, but when prefixed with the range 0 it restricts the history to only the commits that tou
category:
plugins
tags:
#plugins
#git
#fugitive
#quickfix
#buffers
How do I open or edit a file in the same directory as the file I am currently editing?
Vim expands % to the current file's path in Ex commands, and the :h modifier strips the last filename component to give you just the directory.
category:
command-line
tags:
#ex-commands
#buffers
#navigation
#editing
How do I force any window-opening command to create a vertical split instead of horizontal?
The :vertical command modifier forces any window-opening Ex command to create a vertical split instead of the default horizontal split.
category:
buffers-windows
tags:
#windows
#buffers
#command-line
#splits
#ex-commands
How do I reopen the current file and force Vim to interpret it with a specific line ending format?
The ++ff modifier forces Vim to re-read the current file from disk using a specific fileformat — unix (LF), dos (CRLF), or mac (CR).
category:
editing
tags:
#ex-commands
#editing
#buffers
How do I open a diff between my current buffer and the last saved version of the file?
:DiffOrig opens a side-by-side split comparing your current (unsaved) buffer against the version on disk.
category:
buffers-windows
tags:
#diff
#buffers
#editing
#workflow
#buffers-windows
How do I open a persistent file explorer sidebar using Vim's built-in netrw?
:Lexplore opens Vim's built-in netrw file explorer as a persistent sidebar anchored to the left of the screen.
category:
buffers-windows
tags:
#netrw
#file-explorer
#buffers
#windows
#navigation
How do I make the focused window automatically expand to a minimum size while keeping other windows visible?
:set winwidth=85 winheight=20
Setting winwidth and winheight tells Vim the minimum column width and line height the current focused window must have.
category:
buffers-windows
tags:
#windows
#buffers
#config
#navigation