1

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?

4

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.

3

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 acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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