Skip to content

Instantly share code, notes, and snippets.

@tomshaw
Created April 3, 2025 01:15
Show Gist options
  • Save tomshaw/519bf9d9cb3279e1fad931daf824d285 to your computer and use it in GitHub Desktop.
Save tomshaw/519bf9d9cb3279e1fad931daf824d285 to your computer and use it in GitHub Desktop.
PSReadLine PowerShell configuration with well-organized comments and grouped settings.
# Import PSReadLine for enhanced command-line experience
Import-Module PSReadLine
# Prediction settings
Set-PSReadLineOption -PredictionSource HistoryAndPlugin
Set-PSReadLineOption -PredictionViewStyle ListView
# Alternate prediction style:
# Set-PSReadLineOption -PredictionViewStyle InlineView
# Optional bell settings (uncomment to enable audio feedback)
# Set-PSReadLineOption -BellStyle Audible -DingTone 1221 -DingDuration 60
# Optional history save count (default is 4096)
# Set-PSReadLineOption -HistorySaveCount 15
# Optional custom comment color (example)
# Set-PSReadLineOption -Colors @{ "Comment" = "`e[32;47m" }
# Custom syntax highlighting colors
Set-PSReadLineOption -Colors @{
Command = '#8be9fd' # Cyan
Parameter = '#50fa7b' # Bright Green
Variable = '#f1fa8c' # Yellow
Number = '#bd93f9' # Purple
String = '#ff79c6' # Pink
Operator = '#6272a4' # Grayish blue
Type = '#ffb86c' # Orange
Member = '#8be9fd' # Cyan again
Comment = '#6272a4' # Soft gray
Keyword = '#ff5555' # Red
ContinuationPrompt = '#44475a' # Dark gray
Default = '#f8f8f2' # Light foreground
Error = '#ff5555' # Bright red
InlinePrediction = '#5f5f87' # Dim bluish prediction text
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment