How do I make keyword completion preserve the capitalization style I started typing?
The infercase option makes Vim's keyword completion smart about capitalization: it adapts each match to reflect the casing of the characters you've already type
category:
config
tags:
#completion
#insert-mode
#config
How do I re-insert the text from my last insert session and immediately return to normal mode?
Pressing (Ctrl + @, which is the NUL character) in insert mode inserts the same text that was typed during the most recent insert session, then immediately retu
category:
editing
tags:
#insert-mode
#editing
#undo-redo
How do I paste a register in insert mode without triggering auto-indent?
When you use a in insert mode to paste register a, Vim inserts the text as if you typed it character by character.
category:
registers
tags:
#registers
#insert-mode
#indentation
#editing
How do I search files on 'path' and open the first match in the preview window instead of replacing my current buffer?
When you need quick context from another file but do not want to disturb your current editing window, :psearch gives you a clean workflow.
category:
buffers-windows
tags:
#buffers
#windows
#preview-window
#search
#navigation
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 move a line or range of lines to a different location in the file?
How it works The :m command (short for :move) moves one or more lines to after the specified address.
category:
editing
tags:
#editing
#ex-commands
#normal-mode
How do I choose between multiple tag definitions when jumping to a symbol in Vim?
When a symbol (function, class, variable) is defined in multiple places, CTRL-] blindly jumps to the first match.
category:
navigation
tags:
#navigation
#tags
#normal-mode
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 delete text from the cursor to the next occurrence of a pattern?
Vim lets you use a / search as a motion for any operator.
category:
editing
tags:
#editing
#search
#motions
#delete
#normal-mode
How do I read from and write to files directly in Vimscript without shelling out to external commands?
readfile() and writefile()
readfile({path}) reads a file and returns its contents as a list of lines, and writefile({list}, {path}) writes a list of lines back to disk.
category:
config
tags:
#vimscript
#ex-commands
#config
How do I limit the height of Vim's insert-mode completion popup menu?
By default, Vim's completion popup menu (the PUM — Pop-Up Menu) can expand to fill the entire screen if there are many candidates.
category:
config
tags:
#config
#completion
How do I apply or reverse a diff change from one side to the other when using Vim's built-in diff mode?
When comparing files with :vimdiff or :diffthis, Vim highlights each difference as a hunk.
category:
buffers-windows
tags:
#buffers-windows
#diff
#editing
#vimdiff
How do I automatically fill a new file with a boilerplate template when creating it in Vim?
autocmd BufNewFile *.py 0r ~/.vim/templates/python.py
When you create a new file in Vim (e.
category:
config
tags:
#config
#autocmd
#editing
#ex-commands
How do I use Vim as an inline calculator with the expression register?
The expression register ("=) evaluates Vimscript expressions and returns the result.
category:
registers
tags:
#registers
#insert-mode
#expression
#calculator
#vimscript
How do I do a live fuzzy search across all files with Telescope in Neovim?
Telescope's livegrep picker provides real-time regex search across your entire project as you type.
category:
plugins
tags:
#plugins
#search
#fuzzy-finder
#neovim
#telescope
How do I copy lines to a different location in the file without overwriting my yank register?
The :t command (short for :copy) copies addressed lines to a destination line number, leaving the unnamed register untouched.
category:
command-line
tags:
#ex-commands
#editing
#normal-mode
#registers
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 run shell commands without leaving Vim?
Vim lets you execute any shell command directly from within the editor using the :! (bang) command.
category:
command-line
tags:
#ex-commands
#editing
#buffers
How do I use keyword completion that searches included files and headers in Vim?
Vim's completion mode searches for keyword matches not just in the current buffer, but also in all files reachable via include directives (e.
category:
editing
tags:
#completion
#insert-mode
#editing
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