Questions tagged [tabexpansion]

7 questions
17
votes
2 answers

Example showing how to override TabExpansion2 in Windows PowerShell 3.0

Does anyone have an example showing how to override the TabExpansion2 function in Windows PowerShell 3.0? I know how to override the old TabExpansion function, but I want to provide a list of items for the intellisense in PowerShell ISE. I looked…
Michael Kelley
  • 3,579
  • 4
  • 37
  • 41
4
votes
2 answers

Use different values of expandtabs() in the same string - Python

How can we define several tab lengths in a python string? For example, we want to print the keys, value types and values of a dict nicely aligned (with varying sizes of keys and types): my_dict = { "short_key": 4, …
Julep
  • 760
  • 1
  • 6
  • 18
2
votes
1 answer

Can I affect quoting in a Powershell tab expansion function?

Powershell tab expansion functions take 2 parameters, the line so far, and the "current word". The function should return a replacement for the current word. From experiment, it seems to me that the current word is passed to the function without any…
Paul Moore
  • 6,569
  • 6
  • 40
  • 47
2
votes
2 answers

PowerShell - Parameter Value Tab Expansion for Enum types

Is it possible to implement parameter value tab expansion for enum parameter types? Creating a binary cmdlet with parameter definition: [Parameter] public SomeEnum Type {get;set;} Is there some way to type: Add-MyThing -Type S To get:…
Adam Driscoll
  • 9,395
  • 9
  • 61
  • 104
1
vote
1 answer

ZSH directory expansion ('..' into '../')

I've recently started to learn and use ZSH. The problem I'm facing is that ZSH won't auto-expand '..' in commands (like 'cd', 'cp' and so on) into '../'. Bash does this. This wouldn't be such an big issue if I were using keyboard with US-layout...…
amjr
  • 301
  • 3
  • 5
1
vote
1 answer

Tab completion for array not shows after first selection

This is a script for VS PowerShell. function global:Add-Shape { param([string]$Shape, [string[]]$Colors) Write-Host "Shape Name:$Shape" foreach ($i in $Colors) { Write-Host "Color Name:$i" } } Register-TabExpansion 'Add-Shape'…
Ali.Asadi
  • 643
  • 10
  • 16
0
votes
1 answer

Formatting tab argument completion powershell

I'm using TabExpansion2 in PowerShell 3 and when I tab to complete an argument it brings up the string I want but wrapped in syntax I don't want. For instance when I hit tab after -binName: Use-Bin -binName @{Name=5.0} what I need is: Use-Bin…
johann_dev
  • 43
  • 4