6

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?

1 Answer 1

6

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).

1
  • whoops, you're right about command mode - i'll fix the question
    – jwd
    Commented May 11, 2011 at 19:12

You must log in to answer this question.

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