How do I navigate all undo states including branches that u and Ctrl+r can't reach?
g+ and g-
Vim's undo history is a tree, not a linear stack.
795 results for "G"
g+ and g-
Vim's undo history is a tree, not a linear stack.
g?
Vim has a built-in ROT13 encoding operator accessible via g?.
visual-mode #visual-mode #encoding #rot13 #text-transformation
g; and g,
Vim tracks every position where you made a change in the changelist.
let g:netrw_liststyle=3 and let g:netrw_banner=0
How it works Vim ships with a built-in file explorer called netrw that you can access with :Explore (or :Ex).
g;
The g; command moves backward through the change list, jumping to positions where edits were made.
g??
Vim has a built-in ROT13 operator g? that encodes text by rotating each letter 13 positions in the alphabet.
:%S/old/new/g (vim-abolish)
vim-abolish by Tim Pope provides :%S (Subvert), a substitute command that preserves the case pattern of the original text.
:g/^\s*$/d
The global command :g/^\s$/d removes every line that is empty or contains only whitespace — a common cleanup task when tidying up code, configuration files, o
g&
The g& command repeats the last substitute command across the entire file.
:%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.
:%s/old/new/g
The :%s/old/new/g command replaces all occurrences of old with new across every line in the file.
:g/pattern/norm @a
The :g/pattern/norm @a command combines the global command with macro execution.
>G
The >G command applies a right-indent shift to every line from the cursor through the last line of the buffer.
:g//d
:g//d uses an empty pattern in the global command, which instructs Vim to reuse the last search pattern.
:g/pattern/m$
The :g (global) command combined with :m (move) relocates all matching lines to a specified destination.
command-line #command-line #ex-commands #global #editing #organization
g?iw
g? is Vim’s built-in ROT13 operator.
:%s/\(group\)/\1/g
Capture groups in Vim substitute let you match parts of a pattern and reuse them in the replacement.
:g/pattern/d
The :g/pattern/d command deletes every line in the file that matches the given pattern.
G
The G command moves the cursor to the last line of the file.
:%s/\V literal.text/replacement/g
The \V (very nomagic) flag treats all characters as literal except for \.