Skip to content

Instantly share code, notes, and snippets.

@mushfiqweb
Last active October 16, 2023 06:28
Show Gist options
  • Save mushfiqweb/b0fbffcbdeef9e5c3199af987934edae to your computer and use it in GitHub Desktop.
Save mushfiqweb/b0fbffcbdeef9e5c3199af987934edae to your computer and use it in GitHub Desktop.
My Windows Terminal Setup: PowerShel Profile
function Import-Module-With-Measure {
param ($ModuleName)
$import = Measure-Command {
Import-Module $ModuleName
}
Write-Host "$ModuleName took $($import.TotalMilliseconds) ms"
}
oh-my-posh --init --shell pwsh --config https://gist.githubusercontent.com/mushfiqweb/a761862a60ebfd809d234d711172d7a5/raw/7078718e31a6190b64dfef7084530d32cacafb64/mushfiqwebOhMyPOSH.json | Invoke-Expression
Import-Module-With-Measure PSReadLine
Import-Module-With-Measure posh-git
Import-Module-With-Measure Terminal-Icons
Set-PSReadLineOption -PredictionSource History
Set-PSReadLineOption -PredictionViewStyle ListView
Set-PSReadLineOption -EditMode Windows
$PSReadLineOptions = @{
EditMode = "Emacs"
HistoryNoDuplicates = $true
HistorySearchCursorMovesToEnd = $true
Colors = @{
"Command" = "#8181f7"
}
}
Set-PSReadLineOption @PSReadLineOptions
Set-PSReadLineOption -Colors @{
Command = 'Magenta'
Number = 'DarkGray'
Member = 'White'
Operator = '#baf7c9'
Type = '#faa2eb'
Variable = 'DarkGreen'
Parameter = 'DarkGreen'
ContinuationPrompt = '#faa2eb'
Default = 'White'
}
Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward
Set-PSReadlineKeyHandler -Chord Tab -Function MenuComplete
# Import the Chocolatey Profile that contains the necessary code to enable
# tab-completions to function for `choco`.
# Be aware that if you are missing these lines from your profile, tab completion
# for `choco` will not function.
# See https://ch0.co/tab-completion for details.
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path($ChocolateyProfile)) {
Import-Module "$ChocolateyProfile"
}
function killport([parameter(mandatory)] [string] $uport){
if($upid = (Get-NetTCPConnection -LocalPort $uport -ErrorAction Ignore).OwningProcess){kill $upid}
}
function gs{git status}
function ga{git add .}
function gfa{git fetch --all}
function grman{git rebase -i main}
function grmas{git rebase -i master}
function grdev{git rebase -i develop}
function gprman{git pull origin main;git rebase -i main;}
function gprmas{git pull origin master;git rebase -i master;}
function gprdev{git pull origin develop;git rebase -i develop;}
function gitc{ git commit -m @args }
function gac{git add .;git commit -m @args}
function pushmas{git push origin master}
function pushman{git push origin main}
function pushdev{git push origin develop}
function pullman{git pull origin main}
function pullmas{git pull origin main}
function pulldev{git pull origin develop}
function pull{git pull origin master}
function gl{git log}
function glo{git log --oneline}
function gch{git checkout @args}
function gcn{git checkout -b @args}
function gman{git checkout main}
function gmas{git checkout master}
function gdev{git checkout develop}
function gb{git branch @args}
function gs{git status}
function gd{git diff}
function ns{npm start}
#function shkonod{shopify theme dev --store=https://jp-halfsaints-dev.myshopify.com}
#function shwak{shopify theme dev --store=https://waksnap.myshopify.com}
#function shgo{shopify theme dev --store=https://wego-gocart-online.myshopify.com}
function shlo{shopify auth logout}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment