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 ?

Martin Tournoij
  • 62,054
  • 25
  • 192
  • 271
xyx
  • 464
  • 3
  • 11

1 Answers1

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.

mike
  • 949
  • 7
  • 17
  • 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 Dec 11 '17 at 00:23