How do I toggle the case of a character in Vim?
~
The ~ command toggles the case of the character under the cursor — uppercase becomes lowercase and vice versa — then advances the cursor one position to the
432 results for "visual mode"
~
The ~ command toggles the case of the character under the cursor — uppercase becomes lowercase and vice versa — then advances the cursor one position to the
<C-f> (in command-line mode)
When you're already on the Vim command line and realize you need complex edits — inserting text from multiple positions, reordering arguments, or referencing
:set showmatch
How it works The :set showmatch option makes Vim briefly jump the cursor to the matching opening bracket when you type a closing bracket.
:'<,'>!sort -t',' -k2 -n
Vim does not have a built-in multi-column sort, but you can leverage the external sort command to sort selected lines by any field.
editing #editing #sorting #ex-commands #external-commands #command-line
:set virtualedit=onemore
By default, Vim's cursor cannot go past the last character of a line in normal mode — pressing $ lands on the final character, not after it.
X
The X command deletes the character to the left of the cursor (before it).
onoremap ih :<C-u>execute "normal! ?^==\+$\r:noh\rkvg_"<CR>
Vim lets you define custom text objects using operator-pending mode mappings (onoremap) and visual mode mappings (vnoremap).
:let i=1 then use <C-r>=i<CR> in macro
By combining a Vimscript variable with the expression register inside a macro, you can create a counter that increments on each replay.
==
The == command auto-indents the current line based on the surrounding context.
cs"' (change), ds" (delete), ys iw" (add)
The vim-surround plugin by Tim Pope adds commands for working with surrounding characters like quotes, brackets, and tags.
ddp
The ddp sequence swaps the current line with the line below it.
dip
The dip command deletes the inner paragraph — all contiguous non-blank lines surrounding the cursor.
<C-a>
The command increments the number under or after the cursor by 1.
:help topic
Vim has an extensive built-in help system.
gcc (toggle line), gc{motion} (toggle range)
vim-commentary by Tim Pope provides a simple way to toggle comments.
Plug 'vim-airline/vim-airline'
vim-airline provides a beautiful, feature-rich status line that shows file info, git branch, diagnostics, and more with minimal configuration.
L
The L command moves the cursor to the last line visible in the current window.
gn
The gn motion searches forward for the next match of the last search pattern and visually selects it.
search #navigation #search #motions #normal-mode #repeat #editing
:nnoremap key command
The :nnoremap command creates a non-recursive normal mode mapping.
qaI// <Esc>jq
This macro adds a // comment prefix to the beginning of the current line and moves down.