What is the difference between word and WORD motions in Vim?
w vs W, b vs B, e vs E
Vim distinguishes between "words" (sequences of keyword characters) and "WORDS" (sequences of non-blank characters).
21 results for "W B E"
w vs W, b vs B, e vs E
Vim distinguishes between "words" (sequences of keyword characters) and "WORDS" (sequences of non-blank characters).
W, B, and E
How it works Vim distinguishes between two types of word objects: A word (lowercase w, b, e) is a sequence of letters, digits, and underscores, or a sequence of
:set iskeyword+=-
By default, Vim treats hyphens, dots, and many punctuation characters as word boundaries.
b
The b command moves the cursor backward to the beginning of the previous word.
w
The w command moves the cursor forward to the beginning of the next word.
:setlocal iskeyword+=-
The iskeyword option defines which characters are part of a "word" for motions like w, b, e, , and text objects like iw.
qabi"<Esc>ea"<Esc>wq
How it works This macro wraps the current word in double quotes and moves to the next word, making it easy to repeat across a line or file.
<leader><leader>w
vim-easymotion lets you jump to any visible position by highlighting targets with unique letters.
<Leader><Leader>w
The vim-easymotion plugin replaces Vim's default motion commands with a visual overlay system that lets you jump to any visible position on screen in just two o
e
The e command moves the cursor to the last character of the current word.
ge
The ge motion moves the cursor backward to the end of the previous word.
:set iskeyword+={char}
iskeyword defines which characters are considered word characters in Vim.
:set hidden
By default, Vim refuses to let you switch away from a buffer that has unsaved changes, forcing you to save or discard with :w or :e! before moving on.
<C-^>
Pressing (Ctrl-6 on most keyboards) instantly toggles between the current buffer and the alternate file — the last file you were editing.
buffers-windows #navigation #buffers #normal-mode #productivity #windows
:{range}command
Every Ex command in Vim can be preceded by a range that specifies which lines it should operate on.
command-line #command-line #ex-commands #ranges #editing #productivity
<C-o> / <C-i>
Vim maintains a jumplist — a history of every "jump" you make (searches, marks, gg, G, %, etc.
<C-o>
The (Ctrl+o) command jumps the cursor backward through the jump list, returning you to previous cursor positions.
<C-i>
Every time you make a "jump" — using G, /, %, :tag, , or similar commands — Vim records your position in the jump list.
cw vs ciw
The cw and ciw commands both change a word, but they behave differently depending on cursor position.
editing #editing #text-objects #motions #normal-mode #productivity
<C-x><C-l>
The command triggers whole-line completion in insert mode.