By registering with us, you'll be able to discuss, share and private message with other members of our community.
SignUp Now!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?
v:\> alias @@f2 dir
v:\> p:\4Utils\ [F2]
TCC: Unknown command "p:\4Utils\dir"
Rex, would a plugin keystroke handled be called before the built-in automatic keystroke alias mechanism kicked in?
line in> 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
That's> progress, at the cursor position, and then execute that command line.
> how it behaves.
followed> 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
> by a space.
>
>
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.
v:\> alias @@Alt-F4
exit
v:\> foo[Alt-F4]
TCC: Unknown command "fooexit"
v:\> alias @@Ctrl-F10
@exit
It'd be easy enough to do in a keystroke plugin, though....
int F[13] = {0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12};
for ( INT i=1; i<=12; i++ )
{
if ( lpKeyInfo->nKey == F[i] )
{
WCHAR szAliasName[8], szSave[4096], *pszAlias;
Sprintf(szAliasName, L"@@F%d", i);
pszAlias = GetAlias(szAliasName);
if ( pszAlias != NULL )
{
lstrcpy(szSave, lpKeyInfo->pszLine);
Sprintf(lpKeyInfo->pszLine, L"%s %s", pszAlias, szSave);
lpKeyInfo->nKey = 13;
return 0;
}
}
}
> 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?
Does anyone use an @@key alias with a command line in progress? ... have a good example?