Giter Club home page Giter Club logo

ps-tabcompletions's Introduction

PowerShell Tab-Completions

Description

This repository provides tab-completion functionality to a suite of CLI programs in PowerShell. Many of these leverage the HelpParser module to parse a command's help documentation for options and flags, while others may simply hook into the command's built-in tab-completion interfaces.

Installation

Clone the repo:

git clone git@github.com:jjcarrier/PSTabCompletions.git
cd PSTabCompletions

Install dependencies from PSGallery:

Install-Module -Name "posh-git" -Repository PSGallery
Install-Module -Name "HelpParser" -Repository PSGallery

On Windows, another module is required for the wsl command.

Install-Module -Name "WSLTabCompletion" -Repository PSGallery

Note While HelpParser could provide tab completion for these commands, these dedicated solutions offer a more complete (command/parameter) experience and is recommended over the more general purpose HelpParser tab completion functionality.

Add the module to your $PROFILE:

Import-Module ./TabCompletions.psm1

PSReadLine

For full featured (tab)completion it is recommended to enable PSReadLine, this may already be installed on the system, but it can be installed/updated from PSGallery.

Install-Module -Name "PSReadLine" -Repository PSGallery

The following is a recommended configuration that can be added to $PROFILE. The last line being the most essential setting.

Set-PSReadLineOption -HistoryNoDuplicates:$true
Set-PSReadLineOption -PredictionSource HistoryAndPlugin
Set-PSReadLineKeyHandler -Function AcceptNextSuggestionWord -Chord Ctrl+Shift+RightArrow
Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete

Examples

An example using parameter value completion: CMake Example

An example using a program that uses Win32/MS-DOS style arguments: IPConfig Example

Other examples of popular tools (one showing available options another showing available flags): FuzzyFinder Example RipGrep Example

Additional Notes

The HelpParser module is still in an experimental state and thus there are some known issues, but in most cases, these are minor. Please see this repository's documentation for more information on its limitations and known issues.

ps-tabcompletions's People

Contributors

jjcarrier avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.