Is there a way to append the current command line to an @@key alias (instead of the default insert/overwrite behavior)? For example, alias @@F2=command (?) in such a way that if I type "foo" and then press F2, "command foo" is executed?
Is there a way to append the current command line to an @@key alias (instead of the default insert/overwrite behavior)? For example, alias @@F2=command (?) in such a way that if I type "foo" and then press F2, "command foo" is executed?
On Wed, 18 May 2011 13:52:46 -0400, rconn <> wrote:
|No. There isn't any variable substitution in key aliases.
It could be just my lack of imagination, but I can't think of a situation where
I'd use an automatic key alias (@@) to insert something into a command line in
progress, at the cursor position, and then execute that command line. That's
how it behaves.
Code:
v:\> alias @@f2 dir
v:\> p:\4Utils\ [F2]
TCC: Unknown command "p:\4Utils\dir"
Does anyone use an @@key alias with a command line in progress? ... have a good
example?
It would seem much more useful to insert at the beginning of the line followed
by a space.
On Wed, 18 May 2011 14:25:26 -0400, vefatica <> wrote:
|On Wed, 18 May 2011 13:52:46 -0400, rconn <> wrote:
|
||No. There isn't any variable substitution in key aliases.
|
|It could be just my lack of imagination, but I can't think of a situation where
|I'd use an automatic key alias (@@) to insert something into a command line in
|progress, at the cursor position, and then execute that command line. That's
|how it behaves.
|
|
|Code:
|---------
|v:\> alias @@f2 dir
|
|v:\> p:\4Utils\ [F2]
|TCC: Unknown command "p:\4Utils\dir"
|---------
|Does anyone use an @@key alias with a command line in progress? ... have a good
|example?
|
|It would seem much more useful to insert at the beginning of the line followed
|by a space.
Even better ... insertion at the beginning plus full-blown parameter
substitution from the command line in progress.
> It could be just my lack of imagination, but I can't think of a
> situation where
> I'd use an automatic key alias (@@) to insert something into a command
> Code:
> v:\> alias @@f2 dir
>
> v:\> p:\4Utils\ [F2]
> TCC: Unknown command "p:\4Utils\dir"
> Does anyone use an @@key alias with a command line in progress? ...
> have a good
> example?
>
> It would seem much more useful to insert at the beginning of the line
It could be just my lack of imagination, but I can't think of a situation where I'd use an automatic key alias (@@) to insert something into a command line in progress, at the cursor position, and then execute that command line. That's how it behaves.
On Wed, 18 May 2011 17:05:47 -0400, rconn <> wrote:
|---Quote (Originally by vefatica)---
|It could be just my lack of imagination, but I can't think of a situation where I'd use an automatic key alias (@@) to insert something into a command line in progress, at the cursor position, and then execute that command line. That's how it behaves.
|---End Quote---
|
|That's how it's always behaved, and that's how people wanted it. It will definitely NOT be changed now!
I never dreamed you'd change it. I was just wondering about uses for it in a
command line in progress.
Not hard to do for just the unmodified F keys (code below).
Rex, how does TCC handle checking if a keystroke corresponds to a keystroke alias? ... some kind of a hash table I imagine ... could I kludge access to it?
A common situation is when you have a command calling a batch file:
xxx p1 p2 ...
and you want to run the debugger, so you want to convert it to:
bdebugger %@search[xxx] p1 p2 ...
This requires a complicated operation, consisting of the following steps:
1/ change edit mode to INSERT
2/ go to beginning of line
3/ insert the string "bdebugger %@search["
4/ go to the end of the first word
5/ insert "]"
6/ go to end of line
7/ insert "<enter>"
Step 6 may not be needed.
It would be nice to have a keystroke alias, or a plugin command invoked by a keystroke alias, to do all this automatically. For now I have a keystroke alias which does step 3 - all else must be done manually.
--
Steve
> Is there a way to append the current command line to an @@key alias
> (instead of the default insert/overwrite behavior)? For example,
> alias @@F2=command (?) in such a way that if I type "foo" and then
> press F2, "command foo" is executed?
There's something that, while it's not the exact same thing, it's technically close:
On Unix shells, typing ^L will clear the screen while keeping in the command line whatever has been typed. I have an @@^L=cls alias, but it doesn't work the same way (something that drives me, the detailed-obsessed maniac, nuts).
I'd love to be able to clear the screen in this manner in TCC.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.