install.fairie/home/dot_config/powershell/profile.ps1

43 lines
1.3 KiB
PowerShell
Raw Normal View History

2023-06-09 17:49:42 -07:00
### Env
$env:EDITOR = 'code --wait'
$env:GIT_SSH = "C:\Windows\system32\OpenSSH\ssh.exe"
2023-06-09 17:49:42 -07:00
### Set PowerShell to UTF-8
[console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
Update dotfiles/.bashrc, dotfiles/.local/share/chezmoi/dot_bashrc.tmpl, dotfiles/.local/share/chezmoi/dot_ssh/private_id_rsa.tmpl, dotfiles/.local/share/chezmoi/dot_ssh/id_rsa.pub, dotfiles/.local/share/chezmoi/dot_ssh/authorized_keys.github.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/brew/Brewfile.tmpl, dotfiles/.local/share/chezmoi/.chezmoidata.yaml, dotfiles/.local/share/chezmoi/private_dot_config/oh-my-posh/Betelgeuse.omp.json, dotfiles/.local/share/chezmoi/private_dot_config/oh-my-posh/Betelgeuse-minimal.omp.json, dotfiles/.local/share/chezmoi/private_dot_config/powershell/user_profile.ps1, dotfiles/.local/share/chezmoi/dot_profile.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/mimeapps.list, dotfiles/.local/share/chezmoi/private_dot_config/chromium-flags.conf, dotfiles/.local/share/chezmoi/private_dot_config/pgcli/config, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/settings.json, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions.json, dotfiles/.vscode/settings.json, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/themes/themer-dark-color-theme.json, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/themes/themer-light-color-theme.json, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/README.md, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/icon.svg, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/package.json Deleted dotfiles/.local/share/chezmoi/private_dot_config/powershell/takuya.omp.json
2022-11-22 02:33:57 -08:00
### Oh My Posh
Install-Module posh-git
Update dotfiles/.bashrc, dotfiles/.local/share/chezmoi/dot_bashrc.tmpl, dotfiles/.local/share/chezmoi/dot_ssh/private_id_rsa.tmpl, dotfiles/.local/share/chezmoi/dot_ssh/id_rsa.pub, dotfiles/.local/share/chezmoi/dot_ssh/authorized_keys.github.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/brew/Brewfile.tmpl, dotfiles/.local/share/chezmoi/.chezmoidata.yaml, dotfiles/.local/share/chezmoi/private_dot_config/oh-my-posh/Betelgeuse.omp.json, dotfiles/.local/share/chezmoi/private_dot_config/oh-my-posh/Betelgeuse-minimal.omp.json, dotfiles/.local/share/chezmoi/private_dot_config/powershell/user_profile.ps1, dotfiles/.local/share/chezmoi/dot_profile.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/mimeapps.list, dotfiles/.local/share/chezmoi/private_dot_config/chromium-flags.conf, dotfiles/.local/share/chezmoi/private_dot_config/pgcli/config, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/settings.json, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions.json, dotfiles/.vscode/settings.json, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/themes/themer-dark-color-theme.json, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/themes/themer-light-color-theme.json, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/README.md, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/icon.svg, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/package.json Deleted dotfiles/.local/share/chezmoi/private_dot_config/powershell/takuya.omp.json
2022-11-22 02:33:57 -08:00
oh-my-posh init pwsh --config "$env:HOME/.config/oh-my-posh/Betelgeuse.omp.json" | Invoke-Expression
2023-05-14 17:41:51 -07:00
### Docker Completion
Import-Module "$env:HOME/.local/share/powershell/docker/DockerCompletion/DockerCompletion"
Update dotfiles/.bashrc, dotfiles/.local/share/chezmoi/dot_bashrc.tmpl, dotfiles/.local/share/chezmoi/dot_ssh/private_id_rsa.tmpl, dotfiles/.local/share/chezmoi/dot_ssh/id_rsa.pub, dotfiles/.local/share/chezmoi/dot_ssh/authorized_keys.github.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/brew/Brewfile.tmpl, dotfiles/.local/share/chezmoi/.chezmoidata.yaml, dotfiles/.local/share/chezmoi/private_dot_config/oh-my-posh/Betelgeuse.omp.json, dotfiles/.local/share/chezmoi/private_dot_config/oh-my-posh/Betelgeuse-minimal.omp.json, dotfiles/.local/share/chezmoi/private_dot_config/powershell/user_profile.ps1, dotfiles/.local/share/chezmoi/dot_profile.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/mimeapps.list, dotfiles/.local/share/chezmoi/private_dot_config/chromium-flags.conf, dotfiles/.local/share/chezmoi/private_dot_config/pgcli/config, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/settings.json, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions.json, dotfiles/.vscode/settings.json, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/themes/themer-dark-color-theme.json, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/themes/themer-light-color-theme.json, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/README.md, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/icon.svg, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/package.json Deleted dotfiles/.local/share/chezmoi/private_dot_config/powershell/takuya.omp.json
2022-11-22 02:33:57 -08:00
# Import-Module -Name Terminal-Icons
2023-06-09 17:49:42 -07:00
### PSReadLine
2023-06-09 17:54:02 -07:00
Set-PSReadLineOption -EditMode Vi
Set-PSReadLineOption -BellStyle None
Set-PSReadLineKeyHandler -Chord 'Ctrl+d' -Function DeleteChar
Set-PSReadLineOption -PredictionSource History
2023-06-09 17:49:42 -07:00
### Fzf
2023-06-09 17:54:02 -07:00
# Note: This was not working under PowerShell via VSCode on macOS
2023-06-09 17:56:25 -07:00
# The specified module 'PSFzf' was not loaded because no valid module file was found in any module directory.
2023-06-09 17:54:02 -07:00
# Import-Module PSFzf
# Set-PsFzfOption -PSReadlineChordProvider 'Ctrl+t' -PSReadlineChordReverseHistory 'Ctrl+r'
### zoxide
Invoke-Expression (& {
$hook = if ($PSVersionTable.PSVersion.Major -lt 6) { 'prompt' } else { 'pwd' }
(zoxide init --hook $hook powershell | Out-String)
})
### Aliases
Set-Alias grep findstr
### Utilities
function which ($command) {
Get-Command -Name $command -ErrorAction SilentlyContinue |
Select-Object -ExpandProperty Path -ErrorAction SilentlyContinue
}