This project is inspired by the zsh-syntax-highlighting project.
Requirement: pwsh 5.1+
This package provides syntax highlighting for PowerShell. It enables highlighting of commands whilst they are typed at a PowerShell prompt into an interactive terminal. This helps in reviewing commands before running them, particularly in catching syntax errors.
demo.mp4
-
Run PowerShell as Administrator.
-
Execute the following command:
Install-Module syntax-highlighting
-
Run the following and restart PowerShell:
echo "Import-Module syntax-highlighting" >> $profile
so you don't have to import the module every time you open PowerShell.
- If you are bothered with the validation lag you can increase the throttle(default: 50) by running
syntax-highlighting {Throttle(in ms)}eg.
syntax-highlighting 100Update-Module syntax-highlighting- Commands after a semicolon and second line commands will not be validated
- If you are using macOS/Linux, check this out
Rajeswar Khan |