for one single word, the job is quite easy: we just do a 'cw'

what if I select a certain text and I want to replace this block with one word?

obviously I can do a 'x' and then 'i', is there a one key-stoke solution?

in other words, after I select the block in visual mode, what is the fastest way to do 'delete' and then enter insert mode?

any idea?


You can do exactly this with c. From :help v_c:

{Visual}["x]c   or                  *v_c* *v_s*
{Visual}["x]s       Delete the highlighted text [into register x] and
            start insert (for {Visual} see |Visual-mode|).  {not
            in Vi}

In general, most commands that work in normal mode will work the same way in visual mode. So since you can do cw, you can do c in visual mode and it will have the same effect. Same for d, y, gu, etc.


You can do the selection using visual mode and then hit s or c to remove the selected text and directly enter insert mode.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.