Skip to content

Instantly share code, notes, and snippets.

@tomshaw
Last active January 6, 2023 07:30
Show Gist options
  • Save tomshaw/2b1cb2f651d21750a0f82ba959e867f8 to your computer and use it in GitHub Desktop.
Save tomshaw/2b1cb2f651d21750a0f82ba959e867f8 to your computer and use it in GitHub Desktop.
Windows Terminal Setup
# PowerShell 7.3.1 Profile
# Posh Git
Import-Module posh-git
$omp_config = "atomic" # Themes atomic, takuya, material, jandedobbeleer
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/$omp_config.omp.json" | Invoke-Expression
# Terminal Icons
Import-Module -Name Terminal-Icons
# PSReadLine
Set-PSReadLineOption -EditMode Emacs
Set-PSReadLineOption -BellStyle None
Set-PSReadLineKeyHandler -Chord 'Ctrl+d' -Function DeleteChar
# Set-PSReadLineOption -PredictionSource History
Set-PSReadLineOption -PredictionSource HistoryAndPlugin
Set-PSReadLineOption -PredictionViewStyle ListView
# PSFzf
Import-Module PSFzf
Set-PsFzfOption -PSReadlineChordProvider 'Ctrl+f' -PSReadlineChordReverseHistory 'Ctrl+r'
# Env
$env:GIT_SSH = "C:\Windows\system32\OpenSSH\ssh.exe"
# Alias
Set-Alias -Name vim -Value nvim
Set-Alias ll ls
Set-Alias g git
Set-Alias grep findstr
Set-Alias tig 'C:\Program Files\Git\usr\bin\tig.exe'
Set-Alias less 'C:\Program Files\Git\usr\bin\less.exe'
Set-Alias jupyter jupyter-lab
# Utilities
function which ($command) {
Get-Command -Name $command -ErrorAction SilentlyContinue |
Select-Object -ExpandProperty Path -ErrorAction SilentlyContinue
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment