Skip to content

Instantly share code, notes, and snippets.

@shmup
Created May 19, 2023 14:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shmup/e505c373f28d5f356b4ec21e435f1394 to your computer and use it in GitHub Desktop.
Save shmup/e505c373f28d5f356b4ec21e435f1394 to your computer and use it in GitHub Desktop.
Powershell profile
set-alias -name fennel -value fennel-1.0.0-windows32.exe
set-alias -name love -value $HOME\Games\love\love.exe
set-alias which -value get-command
set-alias g -value git
function gco {
$branches = git branch --sort=-committerdate
$selectedBranch = $branches | fzf --exact
if ($selectedBranch -ne $null -and $selectedBranch -ne "") {
$branchToCheckout = $selectedBranch.Trim("* ").Trim()
Write-Host "Checking out branch: $branchToCheckout"
git checkout $branchToCheckout
} else {
Write-Host "No branch selected. Exiting..."
}
}
if (Get-Module -ListAvailable PSReadLine) {
Import-Module PSReadLine
Set-PSReadLineKeyHandler -Chord 'Ctrl+p' -Function PreviousHistory
Set-PSReadLineKeyHandler -Chord 'Ctrl+n' -Function NextHistory
#Set-PSReadLineKeyHandler -Chord 'Ctrl+p' -Function ReverseSearchHistory
#Set-PSReadLineKeyHandler -Chord 'Ctrl+n' -Function ForwardSearchHistory
}
if (Get-Module -ListAvailable PSReadLine) {
Import-Module PSReadLine
}
function sql {
runas /netonly /user:ushmut10\milljar 'C:\Program Files\Azure Data Studio\azuredatastudio.exe'
}
function nw {
npx nightwatch
}
function gap {
git add -p
}
function gca {
git commit --amend -v
}
function gs {
git status
}
function gd {
git diff
}
function gdc {
git diff --cached
}
$ENV:PATH="$ENV:PATH;$HOME\bin;$HOME\Documents\PlaydateSDK\bin;C:\Users\jtm\AppData\Roaming\Python\Scripts"
$ENV:PATH="$ENV:PATH;C:\Program Files\Git\usr\bin"
$ENV:PLAYDATE_SDK_PATH+="$HOME\Documents\PlaydateSDK"
# Reverse Search
Set-PSReadLineOption -HistorySearchCursorMovesToEnd
Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward
function t80 {
& "$HOME\progs\tic80.exe" $args
}
# Chocolatey profile
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path($ChocolateyProfile)) {
Import-Module "$ChocolateyProfile"
}
Import-Module posh-git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment