Powertab optional

Aug 11, 2010 at 6:22 PM

Hi all, i have an idea but i don't know if it is possible, can we have both types of tabexpansion in the same session and use one of the both depending on the key pressed, i mean, for example Press TAB -> standard tabexpansion, press Shift+Tab ->PowerTab tabexpansion. At least for me would be a great addition.

Greetings.

Michael Soza.

Coordinator
Aug 12, 2010 at 5:20 AM
Edited Aug 12, 2010 at 5:23 AM

The functionality of PowerTab is much better than the built-in tab expansion. But you can make PowerTab act like the built-in tab expansion with the DoubleTab feature, which allows you to have two different item selectors for single and double tapping the TAB key. In your case, you would follow these steps:

1) Make sure DoubleTab is on: $PowerTabConfig.DoubleTab = $true

2) Set default item selector to "Default": $PowerTabConfig.DefaultHandler = "Default"

3) Set alternate item selector to "Dynamic": $PowerTabConfig.AlternateHandler = "Dynamic"

And remember to run {{Export-TabExpansionConfig}}.

Now when you press TAB once, you will be presented with the first option, and you can scroll through them by pressing TAB or SHIFT-TAB. Or you can double tap the TAB key and get the standard PowerTab look. But, this will only make a difference in PowerShell.exe (ConsoleHost) and PowerShell Plus, because PowerTab does not have any special item selectors that work on those hosts.

Aug 12, 2010 at 5:46 PM

Thank you, it works ok, but isn't what i need. Reason: the problem that i comment in other discussion about the functions with short names that are not suggested. Also the problems with executables, for example with powertab if a write "msp[TAB]" i dont get anything, in standard i get the suggestion about mspaint.exe located in %windir%\system32

Coordinator
Aug 13, 2010 at 8:59 PM

Oh, PowerTab can do that, you just have to tell it what you want.  Use "!" to look for applications, or use "%" at the end to look for any commands:

msp!<TAB>

msp%<TAB>

Aug 16, 2010 at 1:06 AM

wuau nice!....one last question are those modifiers documented somewhere?.......i didn't knew about !, @, %, there exists others?  It seems that they provide almost everything that i dont like about powertab, so the problem isn't that some expansions aren't implemented, the problem is how can i know if they are not documented?.........man about_PowerTab is just an introduction of what really is your extension.

 

Coordinator
Aug 16, 2010 at 7:58 PM

Yes, I am really behind on documentation.  Features are just so much more fun.  :)

I started writing a cheat sheet to go over the contexts that PowerTab can handle.  A (very) rough draft is available here:  http://cid-773dd79077a6cdde.office.live.com/view.aspx/.Public/PowerTab/PowerTab%20Cheat%20Sheet.doc

It covers the basics except for the new parameter handling.

Aug 17, 2010 at 6:52 PM
The cheat sheet is a nice start. PowerTab does some things I didn't know about and like. It would be great if we could get that into the about_PowerTab documentation. Even with the information you have there, it would be a big help to people.