-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add wildcard search to match any portion of command
Update readme
- Loading branch information
Showing
3 changed files
with
29 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "PowerShell: Attach to PowerShell Host Process", | ||
"type": "PowerShell", | ||
"request": "attach", | ||
"runspaceId": 1 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,27 @@ | ||
# Autocomplete script for sfdx on windows powershell | ||
|
||
### Also works on powershell core | ||
### Also works in powershell core | ||
|
||
![](media/autocomplete.gif) | ||
|
||
### Requirements | ||
|
||
- sfdx | ||
- powershell (regular or powershell core) | ||
|
||
### Copy this script file (sfdx-autocomplete.ps1) to any directory on your machine. Add a reference to the script in your profile.ps1. Refer to the link below for instructions on how to create your custom powershell profile | ||
### Copy this script file (sfdx-autocomplete.ps1) to any directory on your machine. Add a reference to the script in your profile.ps1. Refer to the link below for instructions on how to create your custom powershell profile | ||
|
||
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles?view=powershell-7 | ||
|
||
### Working | ||
### Type in 'sfdx' followed by any portion of the command you're looking for in part or full. It will cycle through all commands that contain the string, in alphabetical order | ||
### How to use | ||
|
||
- Type in 'sfdx' followed by any portion of the command you're looking for. For eg: Type in `sfdx` followed by a space and `lightning` to see all `force:lightning` commands, or `test` to see all commands associated with running tests. | ||
- After you type in a command, add double hyphens (`--`) followed by `<TAB><TAB>` to see the list of flags associated with the command, that you can then tab through. | ||
|
||
### Note: | ||
|
||
<sup><sub>The script creates a 'command.sfdx' file in your home directory each time a powershell session is started. This file contains all the sfdx commands. It is created in the background to avoid blocking the user. So, you might experience a slight delay in autocomplete to start working the very first time</sup></sub> | ||
- For the autocomplete effect seen in the gif above, add the following line to your powershell profile | ||
```js | ||
Set-PSReadLineKeyHandler -Key Tab -Function MenuComplete | ||
``` | ||
- The script creates a '.sfdxcommands.json' file in your home directory each time a powershell session is started. This file contains all the sfdx commands. It is created in the background to avoid blocking the user. So, you might experience a slight delay in autocomplete to start working the very first time you install this script. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters