How do I create custom fold regions with markers in my code?
:set foldmethod=marker
Setting foldmethod=marker lets you define fold boundaries using special comment markers — {{{ to start a fold and }}} to end it.
488 results for ":e!"
:set foldmethod=marker
Setting foldmethod=marker lets you define fold boundaries using special comment markers — {{{ to start a fold and }}} to end it.
:noautocmd w
The :noautocmd modifier runs any Ex command while suppressing all autocmd events for its duration.
:%s/pattern/replacement/ig
The :s substitute command accepts /i and /I flags that override your global ignorecase and smartcase settings for that single substitution, letting you choose c
:cdo keeppatterns s/\<foo\>/bar/gec | update
When quickfix already contains precise targets, :cdo gives you a safer multi-file replace loop than broad project substitutions.
command-line #command-line #quickfix #substitute #refactoring
:set path^=./src
Vim's :set command supports three operators for modifying list-style options: += appends, -= removes, and ^= prepends.
:set list listchars=tab:>-,trail:~,eol:$
Enabling list mode makes Vim render normally invisible characters using configurable symbols defined in listchars.
:wall
When working across multiple files, you often have unsaved changes in several buffers.
:history
:history displays a numbered list of your recently entered Ex commands, giving you a full audit of what you have run in the current session (and across sessions
gh (in netrw)
When browsing files with Vim's built-in netrw file explorer (:Explore or :Ex), hidden files starting with a dot (.
:cdo keepjumps keeppatterns %s/\<OldSymbol\>/NewSymbol/ge | update
When you run :cdo over a large quickfix list, Vim can leave your jump list noisy and your last search pattern overwritten.
command-line #quickfix #ex-commands #search #editing #refactoring
:set shortmess+=I
The shortmess option is a string of single-character flags that tell Vim which messages to suppress or abbreviate.
:reg {name}
The :reg {name} command displays the current contents of one or more named registers in a formatted listing.
<C-a> (in insert mode)
While in insert mode, pressing re-inserts whatever text you typed during your previous insert session.
: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
:set noexpandtab | retab!
When you inherit space-indented code and need to switch to tabs, :retab! (with the bang) converts groups of spaces into tabs throughout the file.
:g/BEGIN/+1,/END/-1 delete
By combining the :global command with a relative address range, you can delete the content between repeating delimiter pairs while leaving the delimiters intact
{count}n
Like most Vim motions, the n and N search repeat commands accept a count prefix.
: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
"#p or <C-r># in insert mode
The # register always contains the name of the alternate file — typically the file you were editing just before the current one.
:setlocal statusline=%f\ %m\ %y\ [%l/%L]
The :setlocal statusline command lets you override the global statusline for a specific window.