* M-. should bring back last arg of prev cmd
@ 2002-03-20 6:16 Nick Croft
2002-03-20 7:53 ` John Buttery
2002-03-20 16:16 ` Bart Schaefer
0 siblings, 2 replies; 3+ messages in thread
From: Nick Croft @ 2002-03-20 6:16 UTC (permalink / raw)
To: zsh-users
Hi. Another question. You help has been much appreciated.
I learnt in an article by Dominic Mitchell "A Case for the Z Shell",
that M-. can be used as a shortcut for the last argument of the previous
command.
% cat /etc/networks
% ls -l /etc/hosts
% vi M-.
% vi /etc/hosts M-.M-.
% vi /etc/hosts /etc/networks
Question: Is this dependent on some setting in the .zshrc, or a setopt
command? I had it working a few days ago. I think it's the greatest
thing since sliced bread.
But it's gone, and I suspect I've overridden whatever it depended on.
Clues, anyone?
Nick
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: M-. should bring back last arg of prev cmd
2002-03-20 6:16 M-. should bring back last arg of prev cmd Nick Croft
@ 2002-03-20 7:53 ` John Buttery
2002-03-20 16:16 ` Bart Schaefer
1 sibling, 0 replies; 3+ messages in thread
From: John Buttery @ 2002-03-20 7:53 UTC (permalink / raw)
To: zsh-users
[-- Attachment #1: Type: text/plain, Size: 1389 bytes --]
* Nick Croft <nicko@acay.com.au> [2002-03-20 17:16:00 +1100]:
>Hi. Another question. You help has been much appreciated.
>
>I learnt in an article by Dominic Mitchell "A Case for the Z Shell",
>that M-. can be used as a shortcut for the last argument of the previous
>command.
[snip]
>Question: Is this dependent on some setting in the .zshrc, or a setopt
>command? I had it working a few days ago. I think it's the greatest
>thing since sliced bread.
>
>But it's gone, and I suspect I've overridden whatever it depended on.
Well, I'm pretty new to zsh, but I may be able to field this one.
% bindkey ^[.
"^[." insert-last-word
%
So it looks like you just need to run something like:
bindkey "^[." insert-last-word
Note that the ^[ represents an actual escape character. So before you
hit M-. you need to hit Ctrl-v so zsh inserts it literally.
By the way, thanks for pointing out this feature!
Oh, and while I'm posting anyway, is there a way to disable zsh's
reports that mail has been read in a mailbox? I don't want to disable
the reports of _new_ mail, just the ones where it says "the mail in xyz
has been read".
Hmm, looks like I managed to break my sig rotation script. Maybe I
shouldn't have switched interactive-use shell, scripting shell, and
editor at the same time. :)
--
This block should never execute. Bug!
[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: M-. should bring back last arg of prev cmd
2002-03-20 6:16 M-. should bring back last arg of prev cmd Nick Croft
2002-03-20 7:53 ` John Buttery
@ 2002-03-20 16:16 ` Bart Schaefer
1 sibling, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 2002-03-20 16:16 UTC (permalink / raw)
To: Nick Croft, zsh-users
On Mar 20, 5:16pm, Nick Croft wrote:
}
} [M-. is] gone, and I suspect I've overridden whatever it depended on.
Does M-x work? (Should give you an "execute: " prompt.) Do *any* of the
metafied keys work? Does ESC . do what you expect M-. to do?
The only thing that would affect M-. are `bindkey' commands. If ESC . is
working, you probably need to add `bindkey -m' to your .zshrc to enable
the meta key. If you already have a `bindkey -m' call, some later call to
`bindkey' must be turning it off again.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-05-17 10:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-20 6:16 M-. should bring back last arg of prev cmd Nick Croft
2002-03-20 7:53 ` John Buttery
2002-03-20 16:16 ` Bart Schaefer
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).