Sebastiaan
03/03/2022, 2:51 PMImport-Module posh-git
$env:POSH_GIT_ENABLED = $true
oh-my-posh --init --shell pwsh --config "~/.cultiv.omp.json" | Invoke-Expression
#oh-my-posh --init --shell pwsh --config $env:POSH_THEMES_PATH\aliens.omp.json | Invoke-Expression
Import-Module -Name Terminal-Icons
Set-PSReadLineOption -PredictionSource History
Set-PSReadLineOption -PredictionViewStyle ListView
Set-PSReadLineOption -EditMode Windows
Set-PSReadLineKeyHandler -Key Ctrl+Shift+b `
-BriefDescription BuildCurrentDirectory `
-LongDescription "Build the current directory" `
-ScriptBlock {
[Microsoft.PowerShell.PSConsoleReadLine]::RevertLine()
[Microsoft.PowerShell.PSConsoleReadLine]::Insert("dotnet build")
[Microsoft.PowerShell.PSConsoleReadLine]::AcceptLine()
}
Set-PSReadLineKeyHandler -Key Ctrl+F5 `
-BriefDescription BuildCurrentDirectory `
-LongDescription "Run the current directory" `
-ScriptBlock {
[Microsoft.PowerShell.PSConsoleReadLine]::RevertLine()
[Microsoft.PowerShell.PSConsoleReadLine]::Insert("dotnet run")
[Microsoft.PowerShell.PSConsoleReadLine]::AcceptLine()
}
That's my current profile, which includes CTRL+F5 for dotnet run
as well, super handy!