How do I group part of a Vim regex pattern without creating a numbered capture group?
\%(...\)
Vim's standard grouping syntax \(.
415 results for "n N"
\%(...\)
Vim's standard grouping syntax \(.
:set colorcolumn=80,120
colorcolumn highlights one or more screen columns to serve as a visual ruler.
systemlist()
systemlist({cmd}) runs a shell command and returns the output as a list of strings, one per line — unlike system() which returns everything as a single string
:%!command
:%!{command} replaces the entire buffer contents with the output of piping them through a shell command.
qa/pattern<CR>dd@aq
By starting a macro with a search command, the macro becomes conditional — it jumps to the next match before acting, and terminates when no more matches are f
crs / crc / crm / cru
The vim-abolish plugin adds coercion operators that instantly convert the word under the cursor between common naming conventions.
plugins #editing #text-objects #plugins #normal-mode #formatting
:keepjumps keeppatterns %s/\s\+$//e<CR>
Bulk whitespace cleanup is common, but a plain substitution can leave side effects: your last search pattern changes and jump navigation gets noisy.
:let &t_SI = "\e[6 q"
Modern terminals support cursor shape changes via escape sequences.
]# and [#
Vim provides the ]# and [# motions specifically for navigating C preprocessor conditionals.
:set shortmess+=I
The shortmess option is a string of single-character flags that tell Vim which messages to suppress or abbreviate.
:pedit +/TODO %
When you need a second read-only view of the same file, opening more normal splits can disrupt your working layout.
/foo\|bar
How it works The \ operator in Vim's search pattern works like a logical OR, letting you match any one of several alternatives.
:terminal ++curwin
By default, :terminal opens a new split window for the terminal emulator.
buffers-windows #terminal #buffers #windows #shell #ex-commands
:Telescope resume
The :Telescope resume command reopens the most recent Telescope picker, restoring the exact query string, filtered results, and cursor position from the last ti
:argdo if search('\s\+$', 'nw') | echo expand('%') | endif
Before running destructive cleanup across many files, it helps to know which files will actually change.
command-line #command-line #search #whitespace #arglist #refactoring
##
The ## special token expands to the names of all files currently in Vim's argument list.
<C-x>s
When spell checking is enabled (:set spell), s in insert mode opens a popup menu of suggested corrections for the most recently flagged misspelled word — with
cr{s/m/c/k/u}
The vim-abolish plugin provides cr{type} coercions that instantly convert the word under the cursor to a different naming convention.
:map <unique> {key} {rhs}
The modifier causes Vim to fail with an error if you try to create a mapping for a key that is already mapped in that mode.
:command
:command lets you define new Ex (colon-prefixed) commands with custom names, optional argument handling, and completion.
command-line #command-line #ex-commands #config #normal-mode