How do I sort lines in reverse numerical order in Vim?
:sort! n
The :sort! n command sorts the lines of a buffer (or a range) by their numeric value in descending order.
2277 results for "@a"
:sort! n
The :sort! n command sorts the lines of a buffer (or a range) by their numeric value in descending order.
:%s/old/new/gc
Adding the c flag to a substitute command makes Vim pause at every match and ask you whether to replace it.
:mksession
:mksession saves a snapshot of the current Vim session — all open buffers, window splits, tab pages, cursor positions, and folds — to a file called Session.
:cd -
The :cd - command switches Vim's global working directory back to the previous one, just like cd - in the shell.
:set concealcursor=nvi
When 'conceallevel' is 2 or higher, Vim hides syntax markers—turning raw Markdown like bold into visual bold or collapsing LaTeX commands.
<C-u> (command line)
When you are typing a long Ex command on the : prompt and realise you've made a mistake, pressing erases everything from the cursor back to the beginning of the
command-line #command-line #ex-commands #editing #insert-mode
<C-w>h / <C-w>j / <C-w>k / <C-w>l
How it works Vim lets you navigate between split windows using followed by a direction key.
z.
Vim has two flavors of each screen-repositioning command: one that only moves the view and one that also repositions the cursor.
:ALEToggle
The ALE (Asynchronous Lint Engine) plugin provides real-time linting and automatic fixing for dozens of languages without blocking your editor.
:set nomore
When a Vim command produces output that exceeds the terminal height, Vim pauses and displays a -- More -- prompt, requiring you to press a key to continue.
g~~
Vim has three case-change operators that work like any other operator — you can combine them with motions, text objects, or double them to act on the whole li
visual-mode #editing #visual-mode #normal-mode #text-objects
:g/pattern/z#.5
The :global command is great for finding lines matching a pattern, but by default it only shows the matching lines themselves.
:m.+1 and :m.-2
The :move (:m) command relocates a line to a new position without cutting and pasting.
<C-x><C-l>
The command triggers whole-line completion in insert mode.
:set textwidth=80
The textwidth option sets the maximum width for text.
<C-w>P
The preview window is a special auxiliary split — usually at the top — opened by commands like :ptag, :pedit, and omni-completion to display reference infor
:set title
Enabling title tells Vim to update the terminal window's title bar with information about the current file.
:set path+=**
Adding to the path option tells Vim to search recursively through all subdirectories when using :find, gf, and other path-related commands.
:Git log --oneline --graph
Tim Pope's vim-fugitive provides a complete Git interface inside Vim.
b
The b command moves the cursor backward to the beginning of the previous word.