Change "TAB" behaviour only when the command line is not empty
Change "TAB" behaviour only when the command line is not empty
Hi, I want to change "TAB" behavior in the bottom prompt.
I am used to "TAB" in command line for the auto-completion. I want the same behavoir in Far manager.
I can remap the "TAB" key to "Down" but I just want to apply this macro when the command line is not empty.
Is it possible ?
I am used to "TAB" in command line for the auto-completion. I want the same behavoir in Far manager.
I can remap the "TAB" key to "Down" but I just want to apply this macro when the command line is not empty.
Is it possible ?
-
- Posts: 6836
- Joined: Thu 23 Mar, 2006 21:36
- Location: Israel
- Has thanked: 41 times
- Been thanked: 530 times
Change "TAB" behaviour only when the command line is not empty
Specify
flags="NotEmptyCommandLine";
in your macro definition.Change "TAB" behaviour only when the command line is not empty
I try but it does'nt work.
When i push "tab", i lose the focus in the prompt, and the cursor goes down in the active panel
Code: Select all
Macro {
description="auto-complete in command line";
area="Shell"; key="Tab";
flags="NoSendKeysToPlugins NotEmptyCommandLine";
code="Keys(\"Down\")";
}
Change "TAB" behaviour only when the command line is not empty
Code: Select all
Macro {
description="auto-complete in command line";
area="Shell"; key="Tab";
flags="NoSendKeysToPlugins NotEmptyCommandLine";
action = function()
Keys("CtrlSpace")
end;
}
Change "TAB" behaviour only when the command line is not empty
Thanks, but it doesn't work either.
I don't lose the focus but the cursor doesn't go down on each possible choice.
I don't lose the focus but the cursor doesn't go down on each possible choice.
Change "TAB" behaviour only when the command line is not empty
Code: Select all
Macro {
description="auto-complete in command line";
area="ShellAutoCompletion"; key="Tab";
flags="NoSendKeysToPlugins NotEmptyCommandLine";
action = function()
Keys("Down")
end;
}
Updated: area fixed.
Change "TAB" behaviour only when the command line is not empty
Thank you for your help however it doesn't work :'(
Even if I saw the history/autocompletion screen when I press "Tab" It change the actif panel.
I try to put back CtrlSpace but I obtain the same result.
Even if I saw the history/autocompletion screen when I press "Tab" It change the actif panel.
I try to put back CtrlSpace but I obtain the same result.
Change "TAB" behaviour only when the command line is not empty
Code: Select all
Macro {
description="auto-complete start"; area="Shell"; key="Tab"; flags="NoSendKeysToPlugins NotEmptyCommandLine";
action = function() Keys("CtrlSpace") end;
}
Macro {
description="auto-complete navigation"; area="ShellAutoCompletion"; key="Tab"; flags="NoSendKeysToPlugins";
action = function() Keys("Down") end;
}
Change "TAB" behaviour only when the command line is not empty
And then surely we need one more macro:
Code: Select all
Macro {
description="auto-complete navigation"; area="ShellAutoCompletion"; key="ShiftTab"; flags="NoSendKeysToPlugins";
action = function() Keys("Up") end;
}
Change "TAB" behaviour only when the command line is not empty
The macro doesn't work. Tab do nothing.
Change "TAB" behaviour only when the command line is not empty
The macro works fine for me.
It should be your environment specific.
Can you test it in clean environment?
1) Extract far archive (x64 or x86, last nightly or stable) to separate direcory (C:\Test_Far\ for example).
2) Rename C:\Test_Far\far.exe.example.ini to C:\Test_Far\far.exe.ini
3) Uncomment and correct line:
UseSystemProfiles=0
4) Write my macro content to C:\Test_Far\Profile\Macros\scripts\TabAutoComplete.lua
5) Run C:\Test_Far\Far.exe
PS: Tab does nothing when entered commandline text can't be auto-completed.
It should be your environment specific.
Can you test it in clean environment?
1) Extract far archive (x64 or x86, last nightly or stable) to separate direcory (C:\Test_Far\ for example).
2) Rename C:\Test_Far\far.exe.example.ini to C:\Test_Far\far.exe.ini
3) Uncomment and correct line:
UseSystemProfiles=0
4) Write my macro content to C:\Test_Far\Profile\Macros\scripts\TabAutoComplete.lua
5) Run C:\Test_Far\Far.exe
PS: Tab does nothing when entered commandline text can't be auto-completed.
- Attachments
-
- TabAutoComplete.lua
- (501 Bytes) Downloaded 271 times
Change "TAB" behaviour only when the command line is not empty
Sorry, It doesn't work for me because I copy the script in ...\Far Manager\Profile\Macros\internal with my other scripts.
When I change the directory to ..\Far Manager\Profile\Macros\scripts, it works. Thank you and sorry again.
When I change the directory to ..\Far Manager\Profile\Macros\scripts, it works. Thank you and sorry again.