Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

From normal mode I select what's before the cursor with:

v<Home>

Is adding to the selection what's under the cursor possible?

Thanks!!

share|improve this question
1  
At least over here, both v<Home> and v^ select what's under the cursor as well. Do you want to select the character to the right of the cursor as well? If so, lv^ may suffice! –  Phoshi Aug 18 '12 at 19:30

1 Answer 1

up vote 5 down vote accepted

edit

You want to change the direction of the selection, right? Just type o and extend your selection as you need.

lorem ipsum dolor sit amet
        #                  " starting point
<########                  " v^
########>                  " o
##########>                " e

endedit

I'm not exactly sure about what you want so here are a bunch of selection combos.

Select from cursor to first column of the line:

v0

Select from cursor to first printable character of the line:

v^

Select from cursor to end of the line:

v$

Select from cursor to end of the word:

ve

Select from cursor to beginning of the word:

vb

Select from cursor to the next opening parenthesis on the line (inclusive):

vf(

Select from cursor to the previous double quote on the line (exclusive):

vT"

Select from cursor to the next occurence of foo in the buffer (always exclusive):

v/foo<CR>

Select from cursor to previous occurence of bar in the buffer (always exclusive):

v?bar<CR>

Select the whole word under cursor:

viw

Select everything between a pair of parenthesis:

vi( (or vib)

Select the body of a function:

vi{ (or viB)

Select a whole sentence:

vis

Select a whole paragraph:

vip

For even more, see :help motion.txt.

share|improve this answer
    
Whoo, problem solved. Thanks a million! –  dan Aug 19 '12 at 16:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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