Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Keyboard Macro?
- X-seq: zsh-users 11430
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Keyboard Macro?
- Date: Wed, 18 Apr 2007 19:51:55 -0700
- In-reply-to: <20070418202655.GF23011@xxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <Xns9916D30A85EE9zzappergmailcom@xxxxxxxxxxx> <20070418202655.GF23011@xxxxxxxxxxxxxxx>
On Apr 18, 10:26pm, Frank Terbeck wrote:
} Subject: Re: Keyboard Macro?
}
} zzapper <david@xxxxxxxxxx>:
} > I guess I could write a script, but what I'd really like is some kind of
} > keyboard macro which would spit out the above if I typed say cpfl (copy
} > first to last)
} >
} > Ideas? I'd use Shortkeys but that doesn't work on De-Vista-ted
}
} Maybe:
}
} bindkey -s '^xC' 'cp _!\^ _!$'
or
bindkey -s 'cpfl' 'cp _!\^ _!$'
Gotta type it fast, though.
Why not e.g.
cpfl() {
emulate -L zsh
local -a last
last=( ${(z)history[$[HISTCMD-1]]} )
cp -iv $last[2] $last[-1]
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author