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.

I am using vi mode in a bash shell.

If I enter insert command mode and type a number from 1-9 (eg: 5, in the example below), I get the following prompt:

(arg: 5) <cursor>

What does this mean? I can't seem to do anything useful with this prompt, and I don't know what its purpose is.

I even poked into the bash sources, which in turn gets into the GNU Readline sources.

The function that ends up being called is rl_vi_arg_digit, which then calls rl_digit_argument, which displays the (arg: N) prompt. But I can't see from comments or related code what it's actually used for.

Anyone know?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

You actually exited insert mode and are in command mode. The number is an argument that can be used with motion keys, just as in vi: e.g. 5h moves left 5 characters. Likewise you can say 5s to delete the next 5 characters and go into insert mode (substitute for 5 characters).

share|improve this answer
    
whoops, you're right about command mode - i'll fix the question –  jwd May 11 '11 at 19:12

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.