How do I close all windows except the current one?
:only
The :only command closes every window in the current tab page except the one your cursor is in.
1024 results for "i" a""
:only
The :only command closes every window in the current tab page except the one your cursor is in.
<C-w><C-w>
The (Ctrl+w Ctrl+w) command cycles the cursor to the next window in the current tab.
:echo @%
Vim provides special read-only registers that hold the current and alternate filenames.
:cfdo %s/old/new/g | update
The :cfdo %s/old/new/g update command performs a search and replace across every file in the quickfix list and saves each one.
]]
The ]] motion jumps forward to the next line that starts with { in the first column, which is typically the beginning of a C-style function or section.
vim-polyglot
The vim-polyglot plugin is a curated collection of language packs for Vim that provides syntax highlighting, indentation, filetype detection, and compiler suppo
do (diffget) / dp (diffput)
How it works When you open two files in diff mode (using vim -d file1 file2 or :windo diffthis), Vim highlights the differences between them.
:%s/\<word\>/\u&/g
Vim's substitute command supports case conversion modifiers in the replacement string.
:/start/,/end/command
Vim allows pattern-based ranges in Ex commands, letting you operate on lines between two search matches.
autocmd FileType {lang} setlocal {options}
Vim's autocmd FileType lets you apply settings that only take effect when editing a specific file type.
:wviminfo / :rviminfo
Vim can persist register contents (including macros) across sessions using viminfo (Vim) or shada (Neovim).
ysiw)
The vim-surround plugin provides the ys (you surround) operator to wrap any Vim text object or motion with a delimiter pair.
plugins #plugins #surround #editing #text-objects #normal-mode
"%p
The % register in Vim always contains the name of the current file.
registers #registers #editing #insert-mode #productivity #filename
vim-repeat
The vim-repeat plugin by Tim Pope extends Vim's built-in .
plugins #plugins #repeat #dot-command #workflow #normal-mode
xp
The xp command swaps the character under the cursor with the character to its right.
:set undofile undodir=~/.vim/undodir
By default, Vim's undo history is lost when you close a file.
:filter /pattern/ command
The :filter command restricts the output of another Ex command to only lines matching a given pattern.
:set autoread | autocmd FocusGained * checktime
When working with Git, build tools, or collaborators, files may change outside Vim.
buffers-windows #buffers-windows #autoread #file-detection #external-changes
:set complete+=kspell
Vim's built-in completion ( / ) sources matches from buffers, included files, and tags by default.
g~iw
The g~iw command toggles the case of every character in the word under the cursor — uppercase letters become lowercase and vice versa.