How do I sort lines by a field in the middle or end of each line using a pattern?
:sort r /\w\+$/
The :sort r /{pattern}/ command sorts lines using the text that matches the pattern as the sort key.
366 results for ":w"
:sort r /\w\+$/
The :sort r /{pattern}/ command sorts lines using the text that matches the pattern as the sort key.
:s/\v\w+/\U&/g
Vim's substitute command supports special case-conversion sequences in the replacement string, letting you transform matched text to upper or lower case without
:%s/\(\w\+\)/\u\L\1/g
Vim's substitute command supports case-conversion escape sequences in the replacement string.
:%s/\v(\w+)/\u\L\1/g
Vim's substitution engine supports case-modifier sequences in the replacement string, making it possible to convert text to title case in a single command.
search #search #substitution #regex #editing #case #formatting
:%s/\v(\w+)/\u\1/g
Vim's substitute command supports case-modifier escapes in the replacement string: \u uppercases the next character, \U uppercases all text until \E or end of r
b: w: t: s:
Vimscript variables are prefixed with a one-letter scope identifier followed by a colon.
/\(function\s\+\)\zs\w\+
Vim's \zs and \ze atoms let you control which part of a matched pattern gets highlighted and operated on.
<C-w>g]
g] splits the window and then runs :tselect for the identifier under the cursor, displaying a numbered list of all matching tags so you can pick the exact defin
:wincmd
:wincmd {key} executes any {key} window command from the Ex command line or from inside a Vimscript function.
:vimgrep /\V<C-r><C-w>/gj **/*
When you need a project-wide search for the exact word under your cursor, this pattern avoids regex surprises and immediately populates quickfix.
<C-w>
Pressing in insert mode deletes the word before the cursor instantly, without requiring you to switch to normal mode.
set complete=.,w,b,u,t
The complete option controls which sources Vim scans when you press or for generic keyword completion.
<C-w>T
The T (Ctrl+w then Shift+t) command moves the current split window into a new tab page.
buffers-windows #buffers-windows #windows #tabs #normal-mode
:set statusline=%f\ %m%r%h%w\ %=%l/%L\ %p%%
Vim's statusline option accepts printf-style format codes that display file info, position, mode, and any custom expression.
:cnoreabbrev {lhs} {rhs}
:cnoreabbrev defines a non-recursive command-line abbreviation — like noremap but for Ex commands.
:argdo %s/old/new/g | w
:argdo {cmd} executes an Ex command against every file in the argument list—the set of files you opened Vim with or set explicitly with :args.
:split
The :split command (or s) splits the current window horizontally, creating a new window above with the same file.
:set iskeyword+=-
By default, Vim treats hyphens, dots, and many punctuation characters as word boundaries.
:%s/foo/bar/g | %s/baz/qux/g | w
The (bar) character in Vim's command line acts as a command separator, allowing you to chain multiple ex commands together on a single line.
:set tildeop
By default, ~ toggles the case of a single character and advances the cursor.