How to replace a single word under cursor?

sayth picture sayth · Jan 9, 2013 · Viewed 73.7k times · Source

How do I replace a word under the cursor in Vim.

So instead of using dw then i then the word and then Esc, is there a simpler combination to replace the word under the cursor?

Answer

Brian Agnew picture Brian Agnew · Jan 9, 2013
ciw

(change inner word) will change the whole word under the cursor. Compare with

cw

which will only change the word from the current cursor position. For more info see this SO question/answer.