Wednesday, January 18, 2012

Re: Retrieve the argument of a prior Ex mode command

On Wed, Jan 18, 2012 at 12:34:03PM EST, Andy Wokula wrote:
> Am 18.01.2012 03:04, schrieb Chris Jones:
>> At the bash prompt, I often use the [Alt+.]¹ keyboard action to retrieve
>> the argument of a prior command from the bash history list.

[..]

> I think you just want to press <Up> in the cmdline:
> :h c_<Up>

Thanks,

But.. wouldn't this retrieve the last argument of the same command only?

Contrived example.. here's my Vim command history:

| :cd /home/user/.vim/plugins
| :e plugin1
| :cd /home/user
| :e .bashrc
| :e .vimrc

Now I want to generate:

| :e /home/user/.vim/plugins/plugin2

So I type ':e ' and to save myself some typing, I want to retrieve the
last argument of the last-but-one 'cd' command (and complete it by
typing '/plugin2')

But if I type:

| :e <Up arrow>

in my setup, I will be presented with:

| :e .vimrc
| :e .bashrc
| :e plugin1

... but not with the last argument of the 'cd' commands?

Vim 7.1 here, but I don't see this behavior having changed (?)

CJ

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: