Last active
March 26, 2023 15:27
-
-
Save dashaw92/33740a8c18a84d6f8dbc31c8f0ff0421 to your computer and use it in GitHub Desktop.
My PowerShell Profile
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Ansi 0 Color</key> | |
<dict> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Blue Component</key> | |
<real>0.12941176470588237</real> | |
<key>Green Component</key> | |
<real>0.12156862745098039</real> | |
<key>Red Component</key> | |
<real>0.11372549019607843</real> | |
</dict> | |
<key>Ansi 1 Color</key> | |
<dict> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Blue Component</key> | |
<real>0.16862745098039217</real> | |
<key>Green Component</key> | |
<real>0.20392156862745098</real> | |
<key>Red Component</key> | |
<real>0.8</real> | |
</dict> | |
<key>Ansi 10 Color</key> | |
<dict> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Blue Component</key> | |
<real>0.26666666666666666</real> | |
<key>Green Component</key> | |
<real>0.5333333333333333</real> | |
<key>Red Component</key> | |
<real>0.09803921568627451</real> | |
</dict> | |
<key>Ansi 11 Color</key> | |
<dict> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Blue Component</key> | |
<real>0.13333333333333333</real> | |
<key>Green Component</key> | |
<real>0.6627450980392157</real> | |
<key>Red Component</key> | |
<real>0.984313725490196</real> | |
</dict> | |
<key>Ansi 12 Color</key> | |
<dict> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Blue Component</key> | |
<real>0.9294117647058824</real> | |
<key>Green Component</key> | |
<real>0.44313725490196076</real> | |
<key>Red Component</key> | |
<real>0.2235294117647059</real> | |
</dict> | |
<key>Ansi 13 Color</key> | |
<dict> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Blue Component</key> | |
<real>0.7803921568627451</real> | |
<key>Green Component</key> | |
<real>0.41568627450980394</real> | |
<key>Red Component</key> | |
<real>0.6392156862745098</real> | |
</dict> | |
<key>Ansi 14 Color</key> | |
<dict> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Blue Component</key> | |
<real>0.9294117647058824</real> | |
<key>Green Component</key> | |
<real>0.44313725490196076</real> | |
<key>Red Component</key> | |
<real>0.2235294117647059</real> | |
</dict> | |
<key>Ansi 15 Color</key> | |
<dict> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Blue Component</key> | |
<real>1</real> | |
<key>Green Component</key> | |
<real>1</real> | |
<key>Red Component</key> | |
<real>1</real> | |
</dict> | |
<key>Ansi 2 Color</key> | |
<dict> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Blue Component</key> | |
<real>0.26666666666666666</real> | |
<key>Green Component</key> | |
<real>0.5333333333333333</real> | |
<key>Red Component</key> | |
<real>0.09803921568627451</real> | |
</dict> | |
<key>Ansi 3 Color</key> | |
<dict> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Blue Component</key> | |
<real>0.13333333333333333</real> | |
<key>Green Component</key> | |
<real>0.6627450980392157</real> | |
<key>Red Component</key> | |
<real>0.984313725490196</real> | |
</dict> | |
<key>Ansi 4 Color</key> | |
<dict> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Blue Component</key> | |
<real>0.9294117647058824</real> | |
<key>Green Component</key> | |
<real>0.44313725490196076</real> | |
<key>Red Component</key> | |
<real>0.2235294117647059</real> | |
</dict> | |
<key>Ansi 5 Color</key> | |
<dict> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Blue Component</key> | |
<real>0.7803921568627451</real> | |
<key>Green Component</key> | |
<real>0.41568627450980394</real> | |
<key>Red Component</key> | |
<real>0.6392156862745098</real> | |
</dict> | |
<key>Ansi 6 Color</key> | |
<dict> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Blue Component</key> | |
<real>0.9294117647058824</real> | |
<key>Green Component</key> | |
<real>0.44313725490196076</real> | |
<key>Red Component</key> | |
<real>0.2235294117647059</real> | |
</dict> | |
<key>Ansi 7 Color</key> | |
<dict> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Blue Component</key> | |
<real>0.7764705882352941</real> | |
<key>Green Component</key> | |
<real>0.7843137254901961</real> | |
<key>Red Component</key> | |
<real>0.7725490196078432</real> | |
</dict> | |
<key>Ansi 8 Color</key> | |
<dict> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Blue Component</key> | |
<real>0.5882352941176471</real> | |
<key>Green Component</key> | |
<real>0.596078431372549</real> | |
<key>Red Component</key> | |
<real>0.5882352941176471</real> | |
</dict> | |
<key>Ansi 9 Color</key> | |
<dict> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Blue Component</key> | |
<real>0.16862745098039217</real> | |
<key>Green Component</key> | |
<real>0.20392156862745098</real> | |
<key>Red Component</key> | |
<real>0.8</real> | |
</dict> | |
<key>Background Color</key> | |
<dict> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Blue Component</key> | |
<real>0.12941176470588237</real> | |
<key>Green Component</key> | |
<real>0.12156862745098039</real> | |
<key>Red Component</key> | |
<real>0.11372549019607843</real> | |
</dict> | |
<key>Bold Color</key> | |
<dict> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Blue Component</key> | |
<real>0.7764705882352941</real> | |
<key>Green Component</key> | |
<real>0.7843137254901961</real> | |
<key>Red Component</key> | |
<real>0.7725490196078432</real> | |
</dict> | |
<key>Cursor Color</key> | |
<dict> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Blue Component</key> | |
<real>0.7764705882352941</real> | |
<key>Green Component</key> | |
<real>0.7843137254901961</real> | |
<key>Red Component</key> | |
<real>0.7725490196078432</real> | |
</dict> | |
<key>Cursor Text Color</key> | |
<dict> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Blue Component</key> | |
<real>0.12941176470588237</real> | |
<key>Green Component</key> | |
<real>0.12156862745098039</real> | |
<key>Red Component</key> | |
<real>0.11372549019607843</real> | |
</dict> | |
<key>Foreground Color</key> | |
<dict> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Blue Component</key> | |
<real>0.7764705882352941</real> | |
<key>Green Component</key> | |
<real>0.7843137254901961</real> | |
<key>Red Component</key> | |
<real>0.7725490196078432</real> | |
</dict> | |
<key>Selected Text Color</key> | |
<dict> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Blue Component</key> | |
<real>0.7764705882352941</real> | |
<key>Green Component</key> | |
<real>0.7843137254901961</real> | |
<key>Red Component</key> | |
<real>0.7725490196078432</real> | |
</dict> | |
<key>Selection Color</key> | |
<dict> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Blue Component</key> | |
<real>0.12941176470588237</real> | |
<key>Green Component</key> | |
<real>0.12156862745098039</real> | |
<key>Red Component</key> | |
<real>0.11372549019607843</real> | |
</dict> | |
</dict> | |
</plist> |
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
Import-Module PSConsoleTheme | |
# Custom prompt to show nested prompt level | |
# | |
Function Prompt { | |
Write-Host "PS" -NoNewLine | |
Write-Host -Fore DarkGreen "[$NestedPromptLevel]" -NoNewLine | |
Write-Host " $(Get-Location)>" -NoNewLine | |
return " " | |
} | |
Remove-Alias nv -Force | |
New-Alias nv nvim-qt | |
New-Alias vi nvim | |
New-Alias vim nvim | |
# Remove audible bell | |
Set-PSReadlineOption -BellStyle None | |
# UNIX style readline ^W and ^D | |
Set-PSReadlineKeyHandler -Chord Ctrl+w -Function BackwardKillWord | |
Set-PSReadlineKeyHandler -Key Ctrl+d -Function DeleteCharOrExit | |
# PSAnsiRenderingFileInfo customization (Enable-ExperimentalFeature) | |
$PSStyle.FileInfo.Directory = $PSStyle.Foreground.Yellow # defaults to "`e[44;1m" | |
$PSStyle.FileInfo.SymbolicLink = $PSStyle.Foreground.Magenta # defaults to "`e[36;1m" | |
$PSStyle.FileInfo.Executable = $PSStyle.Foreground.Blue | |
# Make command line readable (base16-googledark) | |
Set-PSReadLineOption -Color @{ | |
Keyword = 'Yellow' | |
Command = 'DarkYellow' | |
Variable = 'White' | |
Parameter = 'Red' | |
Number = 'DarkBlue' | |
Operator = 'DarkYellow' | |
Comment = 'Gray' | |
String = 'Blue' | |
} | |
# Set-PSReadLineOption -Color @{ | |
# Keyword = 'DarkRed' | |
# Command = 'DarkYellow' | |
# Variable = 'Cyan' | |
# Parameter = 'Red' | |
# Number = 'DarkGreen' | |
# } | |
Set-PSReadLineOption -ShowTooltips | |
Set-PSReadLineOption -PredictionSource HistoryAndPlugin | |
#Set-PSReadLineOption -PredictionViewStyle ListView | |
### September 20, 2018 | |
# Overcome Windows' inability to remove a directory and all child items in one command easily (sigh) | |
Function rmdir! { | |
rmdir -Recurse -Force $args | |
} | |
# Macro for editing this file | |
Function rc! { | |
vi $PROFILE | |
} | |
# Macro for editing alacritty config | |
# Function arc! { | |
# vi "C:\Users\dasha\AppData\Roaming\alacritty\alacritty.yml" | |
# } | |
Function nvimrc! { | |
Set-Location $env:APPDATA\..\Local\nvim\ | |
} | |
# Macro for cloning repos from GitHub | |
Function gh! { | |
git clone git@github.com:$args | |
if ($?) { | |
$_dir = ($args -split '/')[1] | |
cd $_dir | |
} | |
} | |
# Disables cursor blinking | |
Write-Host -NoNewline "`e[2 q" | |
Function .. { | |
Set-Location .. | |
} | |
Function ... { | |
Set-Location ../.. | |
} | |
Function rl! { | |
taskkill /f /im $args 2>&1 > $null | |
if($?) { | |
& $args | |
if($?) { | |
Write-Host -Fore DarkGreen -Back Black "Process restarted." | |
} else { | |
Write-Host -Fore DarkRed -Back Black "Failed to restart process. Is it on your path?" | |
} | |
} else { | |
Write-Host -Fore DarkRed -Back Black "Process not found. Not starting." | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment