normal·mode
~ / ex / word-under-cursorlesson 7/7

Grab the word under the cursor: <C-r><C-w>

Insert the word (or WORD) under the cursor into the command line.

3 drills

  1. Rename the word under the cursor: The cursor is on a name that has to change everywhere. Rename it with :%s/, <C-r><C-w> for the old name, and the new name from the target.
  2. Use the word as the replacement: The cursor is on the new name. Replace the old name with it using <C-r><C-w> in the replacement part of :s (look at the target for which lines change).
  3. Names with dashes: <C-r><C-a>: This name has dashes in it, so <C-r><C-w> would only grab part of it. Rename it everywhere with :%s/<C-r><C-a>/…/g.

The drill editor loads in your browser.

outside the editor the page is in normal mode: ? keymaps · / find · : commandsfound this useful? ☕ support it ·credits · source · not affiliated with Vim or Neovim