Created
June 3, 2022 12:44
-
-
Save meetmistry0/70ac39877ed81e10144466b84d485c4d to your computer and use it in GitHub Desktop.
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
# PS-Readline | |
Import-Module PSReadLine | |
Set-PSReadLineOption -PredictionSource History | |
Set-PSReadLineOption -EditMode Windows | |
# Lists all available options in block form instead of just autocompleting (Going one by one). | |
Set-PSReadlineKeyHandler -Chord Tab -Function MenuComplete | |
# Terminal Icons | |
Import-Module -Name Terminal-Icons | |
# Unix aliases. | |
Set-Alias -Name c -Value clear | |
Set-Alias -Name touch -Value New-Item | |
Set-Alias -Name rm -Value del | |
# Alias for opening explorer.exe | |
Set-Alias -Name open -Value explorer | |
# Alias for hidden files/directories. | |
Function lsa {ls -Hidden} | |
# Alias for exit. | |
Function x {exit} | |
# Function to create a new directory and cd into it. | |
function mkcd($new_dir) { | |
mkdir ($new_dir) | cd | |
} | |
# Traverse back a directory. | |
Function .. {cd ..} | |
# Traverse back 2 directories. | |
Function c2 {cd ../..} | |
# Location of the searched program's executable. | |
function which ($param) { | |
Get-Command -Name $param -ErrorAction SilentlyContinue | | |
Select-Object -ExpandProperty Path -ErrorAction SilentlyContinue | |
} | |
# Invokes starship for prompt. | |
Invoke-Expression (&starship init powershell) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment