How do I preview a fuzzy tag match in the preview window without immediately switching buffers?
When a symbol name is ambiguous, jumping directly with :tag can bounce you around the codebase and disrupt your working context.
category:
navigation
tags:
#navigation
#tags
#windows
#code-navigation
#command-line
How do I open the current buffer in a new tab so I can view it independently?
:tab split opens the current buffer in a brand new tab page, giving you a second independent view of the same file.
category:
buffers-windows
tags:
#tabs
#buffers
#windows
#normal-mode
How do I make Vim preserve the cursor column when jumping between lines?
By default, many Vim movement commands — gg, G, Ctrl-d, Ctrl-u, Ctrl-f, Ctrl-b, and others — snap the cursor to the first non-blank character of the destina
category:
config
tags:
#navigation
#config
#motions
#normal-mode
How do I configure Vim to share the clipboard with my system?
:set clipboard=unnamedplus
Setting clipboard=unnamedplus makes Vim's default yank and paste use the system clipboard.
category:
config
tags:
#config
#clipboard
#system-integration
#vimrc
How do I evaluate a Vimscript expression and use the result as my command-line input?
Pressing e on the command line opens a special prompt that lets you type a Vimscript expression.
category:
command-line
tags:
#command-line
#ex-commands
#vimscript
#insert-mode
How do I remove a word I accidentally added to my Vim spell dictionary?
When spell checking is active, pressing zg over a word adds it to your personal word list so Vim stops flagging it.
category:
config
tags:
#config
#editing
How do I move to the first or last non-blank character of a soft-wrapped display line?
When wrap is on, long lines wrap visually across multiple screen lines.
category:
navigation
tags:
#navigation
#normal-mode
#motions
How do I save and restore the cursor position and scroll state in a Vimscript function?
winsaveview() and winrestview()
When writing Vimscript functions or complex mappings that move the cursor, it is essential to restore the original view afterward so the user does not notice an
category:
config
tags:
#ex-commands
#normal-mode
How do I insert the entire current line into the command line without typing it?
Pressing on the command line inserts the full text of the current buffer line (the line the cursor is on when you pressed :) directly at the command-line cursor
category:
command-line
tags:
#command-line
#editing
#navigation
How do I control which actions automatically open folds in Vim?
The foldopen option lets you specify exactly which cursor movements and commands will automatically open a closed fold.
category:
config
tags:
#folding
#config
#ex-commands
How do I swap two words in Vim using visual paste without any plugins?
When you paste over a visual selection in Vim, the displaced text is moved into the unnamed register "".
category:
registers
tags:
#registers
#visual-mode
#editing
#text-objects
#normal-mode
How do I jump back and forth between my two most recent cursor positions?
Vim maintains a jumplist — a history of every "jump" you make (searches, marks, gg, G, %, etc.
category:
navigation
tags:
#navigation
#jumplist
#motions
#workflow
How do I rename, move, or delete the current file from inside Vim using vim-eunuch?
vim-eunuch (by Tim Pope) adds Unix shell operations as first-class Vim commands.
category:
plugins
tags:
#plugins
#ex-commands
#editing
How do I insert the filename under the cursor directly into the command line?
While typing a command, inserts the filename under the cursor in the buffer at the command-line prompt.
category:
command-line
tags:
#command-line
#navigation
#editing
How do I make a macro repeat itself until it reaches the end of the file?
A recursive macro calls itself at the end of its recording, causing it to repeat automatically until a motion fails (like j at the last line).
category:
macros
tags:
#macros
#editing
#normal-mode
#registers
How do I configure Vim to auto-save files when I switch away?
:set autowriteall and autocmd FocusLost * silent! wa
How it works Vim can be configured to automatically save your files when you switch to another window or application.
category:
config
tags:
#editing
#buffers
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 toggle the case of a character in Vim?
The ~ command toggles the case of the character under the cursor — uppercase becomes lowercase and vice versa — then advances the cursor one position to the
category:
editing
tags:
#editing
#normal-mode
#formatting
How do I make a macro that finds and operates on specific patterns?
qq /pattern<CR> {commands} q
By incorporating a search command inside a macro, you can make it jump to the next occurrence of a pattern before performing its edits.
category:
macros
tags:
#macros
#search
#recording
#workflow
#advanced
How do I run Lua code in the context of a specific buffer without switching to it in Neovim?
vim.
category:
config
tags:
#ex-commands
#vimscript
#buffers
#config