How do I make buffer-jump commands reuse an existing tab before opening a new one?
:set switchbuf=usetab,newtab
When you jump to buffers from quickfix, tags, or command-line completions, Vim's default window selection can feel unpredictable.
category:
buffers-windows
tags:
#buffers
#windows
#tabs
#quickfix
#navigation
How do I sort lines by a field in the middle or end of each line using a pattern?
The :sort r /{pattern}/ command sorts lines using the text that matches the pattern as the sort key.
category:
command-line
tags:
#command-line
#sorting
#ex-commands
#regex
How do I open the file whose name is under the cursor in a new tab?
gf reads the filename under the cursor and opens it in a new tab page, keeping your current buffer untouched.
category:
navigation
tags:
#navigation
#buffers-windows
#tabs
How do I open a file by name by searching through my project directories?
:find searches for a file in all directories listed in the path option and opens it in the current window.
category:
navigation
tags:
#navigation
#ex-commands
#buffers
How do I prevent Vim from automatically resizing a window when others open or close?
Setting winfixwidth on a window tells Vim not to adjust its width when other windows are created, closed, or resized with =.
category:
buffers-windows
tags:
#buffers-windows
#config
#editing
#windows
How do I make buffer jumps prefer the last-used window that already shows the target buffer?
When jumps open the target buffer in an unexpected split, context switching gets expensive.
category:
buffers-windows
tags:
#buffers
#windows
#navigation
#config
How do you move between windows in Vim?
Use followed by a direction key: h (left), j (down), k (up), l (right) to move focus between split windows.
category:
buffers-windows
tags:
#windows
#navigate
#direction
How do I send commands from a Vim buffer to an embedded terminal?
:term then <C-w>N for normal mode
Vim 8+ and Neovim have a built-in terminal emulator that runs inside a buffer.
category:
command-line
tags:
#command-line
#terminal
#workflow
#productivity
How do I close the current window in Vim?
The c (Ctrl+w then c) command closes the current window without closing the buffer it contains.
category:
buffers-windows
tags:
#buffers-windows
#windows
#normal-mode
How do I use the leader key to create my own keyboard shortcuts?
let mapleader = ' ' then nnoremap <leader>key command
The leader key is a configurable prefix for your custom key mappings.
category:
config
tags:
#config
#mappings
#vimrc
#leader
#workflow
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 resize the current window to an exact number of lines from the command line?
The z{height} command simultaneously resizes the current window to exactly {height} lines, scrolls so the current line sits at the top of the window, and moves
category:
buffers-windows
tags:
#buffers-windows
#windows
#resize
#navigation
How do I prevent cursor movement in insert mode from splitting the undo block?
inoremap <Left> <C-g>U<Left>
In insert mode, any cursor movement — including arrow keys, Home, and End — causes Vim to split the undo block at that point.
category:
editing
tags:
#insert-mode
#undo-redo
#editing
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 use Vim's built-in file explorer netrw to browse and manage files?
Netrw is Vim's built-in file explorer plugin that comes with every Vim installation.
category:
plugins
tags:
#plugins
#navigation
#buffers
How do I join a wrapped paragraph into one line without manual cursor moves?
When text is hard-wrapped for readability in git diffs or markdown source, you sometimes need the paragraph as a single line for refactoring, search, or export.
category:
editing
tags:
#editing
#visual-mode
#formatting
#text-objects
How do I continuously record and restore sessions with vim-obsession?
If you routinely work across many files, tabs, and split layouts, rebuilding your workspace after a restart is costly.
category:
plugins
tags:
#plugins
#sessions
#workflow
#buffers-windows
#productivity
How do I hide or replace the ~ characters that appear at the end of a buffer?
By default, Vim fills empty lines after the end of a buffer with ~ characters.
category:
config
tags:
#config
#display
#visual
How do I keep the quickfix window height from resizing when splitting?
Quickfix windows are easy to disturb when you open, close, or rebalance other splits.
category:
buffers-windows
tags:
#buffers
#windows
#quickfix
#layout
How do I open a file in read-only mode so I cannot accidentally modify it?
:view opens a file with the readonly option set, preventing accidental writes.
category:
buffers-windows
tags:
#buffers
#ex-commands
#editing