How do I encrypt a file directly in Vim?
:X
The :X command sets an encryption key for the current file.
command-line #command-line #security #file-management #ex-commands
2125 results for "i" a""
:X
The :X command sets an encryption key for the current file.
command-line #command-line #security #file-management #ex-commands
:keepalt sbuffer {bufnr}
The alternate-file register (#) is easy to disturb when jumping around buffers, and many advanced motions depend on it (, # expansions, quick two-file toggles).
input({prompt})
The built-in input() function pauses execution, displays a prompt at the bottom of the screen, and returns whatever the user types before pressing Enter.
:sort /regex/
The :sort /pattern/ command sorts lines by the text that appears after the first match of a pattern, not from the start of each line.
"/
Vim stores the last search pattern in the special / register.
/pattern1\_.{-}pattern2
Vim's regex engine normally treats .
U
In visual mode, pressing U converts all selected characters to uppercase and u converts them to lowercase.
<C-v>jj$A text<Esc>
Visual block mode combined with $A lets you append text to the end of multiple lines simultaneously, even when those lines have different lengths.
visual-mode #editing #visual-mode #block-mode #productivity #insert-mode
g<C-a>
The g command increments numbers across a visual selection so that each subsequent line gets a progressively higher value.
:'<,'>sort!
The sort! command sorts the selected lines in reverse (descending) order.
{count}J
The J command joins the current line with the line below, adding a space between them.
:let @a = '...'
When a recorded macro contains a typo or needs a small tweak, you can modify it directly via the :let command rather than re-recording the entire sequence.
"=
The expression register ("=) lets you evaluate any Vim expression and insert its result as text.
[* and ]*
The [ and ] motions (also written as [/ and ]/) let you jump directly to the opening / or closing / of a C-style block comment.
<C-w>F
F opens the filename under the cursor in a new horizontal split window and jumps to the line number that follows the filename.
buffers-windows #navigation #buffers-windows #windows #editing
\%'m
Vim's \%'m regex atom matches the exact position of mark m in a search pattern.
"Ayy
The "Ayy command appends the current line to register a instead of overwriting it.
:tabnew filename
The :tabnew filename command opens a file in a new tab page in Vim.
buffers-windows #buffers-windows #tabs #ex-commands #navigation
:Lexplore
:Lexplore opens Vim's built-in netrw file explorer as a persistent sidebar anchored to the left of the screen.
buffers-windows #netrw #file-explorer #buffers #windows #navigation
\%(pattern\)
In Vim's regex engine, \( and \) create a capturing group whose contents are stored in \1, \2, etc.