How to replace a single word under cursor?

后端 未结 5 1518
广开言路
广开言路 2021-01-29 18:38

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 com

5条回答
  •  深忆病人
    2021-01-29 19:19

    ciw

    c   change
    iw  inner word
    

    This will delete the word under the cursor (even if the cursor is somewhere in the middle of the word) and enter insert mode.


    Also see Vim's documentation for reference:

    :help c
    :help text-objects
    

提交回复
热议问题