Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
684 views
in Technique[技术] by (71.8m points)

vim - How to replace a single word under cursor?

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...