> At the bash prompt, I often use the [Alt+.]¹ keyboard action to retrieve
> the argument of a prior command from the bash history list.
>
> To illustrate:
>
> | $ mkdir -p long/directory/name/I/would/rather/not/type/again
> | $ cd [Alt+.]
>
> Bash expands the [Alt+.] giving me:
>
> | $ cd long/directory/name/I/would/rather/not/type/again
>
> So I just have to hit enter.
>
> Naturally, this is not limited to the last command: I can hit [Alt+.]
> twice to retrieve the argument of the last-but-one command.. etc.
>
> I'm used to doing this in bash and I find it a lot more effective than
> retrieving entire commands and editing them (in this case, retrieving
> the mkdir command& replacing 'mkdir -p' by 'cd').
>
> Is there any way I could do this in Vim's ex-mode?
>
> CJ
>
> ¹ means.. holding down the Alt key and hitting the dot key ('.'). The
> braces are only added for legibility..
I think you just want to press <Up> in the cmdline:
:h c_<Up>
Example: complete older file names:
:e <Up>
There is also Ctrl-P, but it ignores what you have typed so far.
--
Andy
--
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:
Post a Comment