How do I export my syntax-highlighted Vim buffer to an HTML file?
:TOhtml
The :TOhtml command converts the current buffer — complete with its syntax highlighting colors — into a standalone HTML file.
:TOhtml
The :TOhtml command converts the current buffer — complete with its syntax highlighting colors — into a standalone HTML file.
:g/pattern/join
The :g/pattern/join command combines the :global command with :join to merge every line matching a pattern with the line immediately following it.
command-line #ex-commands #editing #command-line #search #normal-mode
:update
The :update command (abbreviated :up) writes the buffer to disk only if it has been modified since the last save.
:norm! {cmd}
Both :norm and :norm! execute a sequence of Normal mode keystrokes from the command line or a script, but they differ in how they handle user-defined mappings.
:g/pattern1/s/pattern2/replacement/g
Combining :g with :s lets you apply a substitution using two independent patterns: :g selects which lines to act on, and :s controls what gets replaced within t
feedkeys()
The feedkeys({keys}, {flags}) function inserts a string of keystrokes into Vim's input queue as if the user had typed them.
setqflist()
setqflist() lets you build the quickfix list from a Vimscript list of dictionaries rather than relying on compiler output or :vimgrep.
:earlier 1h
Vim's undo history is annotated with timestamps, allowing you to travel back to any point in time using :earlier and forward using :later.
:g/./,/^$/join
Hard-wrapped text (where each sentence is on its own line) is common in commit messages, email threads, and older documentation.
:file {newname}
:file {newname} (short form: :f {newname}) changes the filename Vim associates with the current buffer.
:norm! {command}
:normal {command} runs a sequence of Normal mode keystrokes from the command line (or a range of lines with :%normal), but it applies your custom key mappings.
command-line #ex-commands #macros #normal-mode #command-line
:g/^$/,/./-j
The command :g/^$/,/.
g<
Pressing g or q to dismiss it again Example Tips :messages also shows recent messages (and those accumulate across the session), while g< only shows the last pa
:set wildmode=list:longest,full
Vim's default Tab completion in the command-line cycles through matches one at a time, making it hard to see all available options at once.
:[range]right {width}
Vim has built-in Ex commands for text alignment — :right, :left, and :center — that work over any line range without plugins.
command-line #formatting #indentation #command-line #ex-commands
:ldo {cmd}
Vim maintains two parallel systems for collections of file positions: the quickfix list (global, one per Vim session) and the location list (local to each windo
:set wildignorecase
:set wildignorecase makes Vim's command-line tab completion treat uppercase and lowercase letters as equivalent when completing file names, buffer names, and ot
:sort r /\w\+$/
The :sort r /{pattern}/ command sorts lines using the text that matches the pattern as the sort key.
:set wildoptions=fuzzy
Enables fuzzy matching for Neovim's command-line tab completion (wildmenu), so you can match any part of a filename, command, or option — not just from the be
command-line #completion #command-line #neovim #config #wildmenu
:[range]center / :[range]right / :[range]left
Vim has built-in Ex commands for text alignment: :center, :right, and :left.