Skip to content

Instantly share code, notes, and snippets.

@LePichu
Created August 19, 2025 21:07
Show Gist options
  • Select an option

  • Save LePichu/441e78ec847ea9b0af318b53809206a4 to your computer and use it in GitHub Desktop.

Select an option

Save LePichu/441e78ec847ea9b0af318b53809206a4 to your computer and use it in GitHub Desktop.
Set-PSReadLineOption -EditMode Windows
Set-PSReadLineOption -PredictionViewStyle ListView
Set-PSReadLineOption -Colors @{ "Parameter" = $PSStyle.Foreground.FromRgb(127, 127, 127) }
Set-PSReadlineKeyHandler -Key ctrl+d -Function DeleteCharOrExit
Set-PSReadLineKeyHandler -Key ctrl+e -ScriptBlock {
[System.Console]::Clear()
$global:COLDBOOT = $true
[Microsoft.PowerShell.PSConsoleReadLine]::BeginningOfLine()
}
Set-PSReadLineKeyHandler -Key ctrl+l -Function AddLine
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
clear
Function mkdir($name) {
New-Item -Type Directory $name
}
$global:COLDBOOT = $true
$NAME = "$Env:USER@$Env:HOSTNAME"
Function Prompt {
if($global:COLDBOOT -eq $false) {
Write-Host " "
}
if($global:COLDBOOT) {
$global:COLDBOOT = $false
}
$ARR = @()
$MAP = [Ordered]@{
"Cargo.toml" = "🦀"
"CMakeLists.txt" = "🔺"
"deno.json" = "🦕"
"deno.jsonc" = "🦕"
"gleam.toml" = "✨"
"mix.exs" = '🩸'
"rebar.config" = '☎'
"pubspec.yaml" = '🎯'
"pubspec.yml" = '🎯'
"$(Split-Path -Leaf (Get-Location)).fsproj" = '🤖'
"$(Split-Path -Leaf (Get-Location)).csproj" = '🤖'
"go.mod" = "🐹"
"pyproject.toml" = "🐍"
"shard.yaml" = '🔮'
"shard.yml" = '🔮'
"Gemfile" = '💎'
"package.json" = '📦'
"yarn.lock" = '📦'
# Language by @TheNachoBIT
"Nucleus.toml" = '☢️'
}
ForEach ($KEY in $MAP.Keys) {
If (Test-Path "./$KEY") {
$ARR += $MAP[$KEY]
}
}
$ARR = $ARR | Select-Object -Unique
$LANGS = ""
if($ARR.Count -gt 0) {
$LANGS += " via "
if($ARR.Count -eq 1) {
$LANGS += $ARR
}
if($ARR.Count -eq 2) {
$LANGS += $ARR[0] + " & " + $ARR[1]
}
if($ARR.Count -eq 3) {
$LANGS += $ARR[0] + ", " + $ARR[1] + " & " + $ARR[2]
}
}
Write-Host "$NAME " -NoNewLine -ForegroundColor DarkCyan
Write-Host "in " -NoNewLine
Write-Host "$(Split-Path -Leaf (Get-Location))" -NoNewLine -ForegroundColor Blue
Write-Host $LANGS
Write-Host "$>" -NoNewline -ForegroundColor Blue
" "
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment