How do I change the case of matched text in a substitute?
:%s/\(\w\+\)/\u\1/g
Vim provides case-conversion atoms in substitute replacements: \u uppercases the next character, \l lowercases it, \U uppercases until \e, and \L lowercases unt
366 results for ":w"
:%s/\(\w\+\)/\u\1/g
Vim provides case-conversion atoms in substitute replacements: \u uppercases the next character, \l lowercases it, \U uppercases until \e, and \L lowercases unt
:'<,'>w filename
How it works Vim's :w command can take a range, and when used with a visual selection, it writes only the selected lines to a file.
<leader><leader>w
vim-easymotion lets you jump to any visible position by highlighting targets with unique letters.
<C-w>gf
gf reads the filename under the cursor and opens it in a new tab page, keeping your current buffer untouched.
<C-w>P
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
:[range]w !{cmd}
The :[range]w !{cmd} command writes a range of lines to the standard input of a shell command, leaving the buffer completely unchanged.
:'<,'>w {filename}
After making a visual selection, you can write only those lines to a new file using :'w {filename}.
:'<,'>w !{cmd}
The :'w !{cmd} command writes the visually selected lines to the stdin of an external shell command — without modifying the buffer.
<C-w>z or :pclose
The preview window shows file contents temporarily without switching your editing context.
buffers-windows #buffers-windows #quickfix #preview #navigation
:noautocmd w
The :noautocmd modifier runs any Ex command while suppressing all autocmd events for its duration.
<C-w>F
F opens the filename under the cursor in a new horizontal split window and jumps to the line number that follows the filename.
buffers-windows #navigation #buffers-windows #windows #editing
:w !{cmd}
The :w !{cmd} command writes the buffer contents to the stdin of an external shell command without modifying the buffer or saving to disk.
command-line #command-line #ex-commands #shell #editing #productivity
<C-w>^
Vim tracks the alternate buffer — the last file you were editing before the current one.
<C-w>c
The c (Ctrl+w then c) command closes the current window without closing the buffer it contains.
<C-w>n
n creates a new empty buffer and opens it in a horizontal split above the current window.
<C-h> / <C-w> / <C-u>
Vim provides three levels of deletion directly in insert mode, so you don't need to switch to normal mode for small corrections.
<C-r><C-w>
When typing a command on the Vim command line, pressing inserts the word currently under the cursor.
<C-w>}
How it works The } command opens a preview window showing the tag definition of the word under your cursor.
:%s/\w\+/(&)/g
In a Vim substitution, & in the replacement string expands to the entire matched text.
<C-w>g<C-]>
Pressing g jumps to the definition of the tag under the cursor — just like — but opens the destination in a new horizontal split window.