Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 3 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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .