3

I would like to know how I can select text character by character, in visual mode, using a combination of shift+direction without using the mouse. Actually, with Shit + Left/Right gvim selects the text word by word.

For example, in the following screenshot, I am able to select the text std::cout using the mouse, left button click on the start of text and then shifting the mouse cursor to the right.

enter image description here

How can I replicate this behavior with just using the keyboard ?

1 Answer 1

5

short answer:

vW selects std::cout

If you really want to select character by character, just

v and then h / l

long answer:

v enters visual mode

W motion to select WORD

If you really want to select character by character, just

v enters visual mode

h / l motion by character

(The answer assumes, that you are not using any plugins and that they do not define additional motions)

Vimcasts has excellent videos, that basically explain everything.

1
  • Thanks. I thought I can do it using shift key with some combination ooff direction keys rather than pressing ESC and v, but it doesn't work.
    – xyx
    Commented Dec 11, 2017 at 0:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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