Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: retrieving the results of last command?



On Friday 20 May 2005 16:49, Bart Schaefer wrote:

> On May 20, 2:18pm, Francisco Borges wrote:

> }

> } Often I'm in the situation of using say:

> }

> } % locate a-file

> } /usr/share/prog/a-file

> } %

> }

> } Then I want to use the pathname to copy the file.

>

> [snip]

>

> I also have

>

> bindkey -s '\ev' '\e`vi '

>

> so that ESC-v leaves me with "vi $( ... )" but I don't use that one much

> any more, for some reason.

I have something similar that I use for purposes mentioned in the original posting:

bindkey -s '\ei' '^U\e>`^Y`'

In the example it would work like this:

% locate a-file

/usr/share/prog/a-file

% cp [now I go to the history entry I want and press ESC-i]

% cp `locate a-file`

I guess it's not very elegant, since it depends on the default keybindings ^U, ESC-> and ^Y, but I hope it may be of use to someone.

Christian



Messages sorted by: Reverse Date, Date, Thread, Author