2023-06-18 20:30:41 -07:00
|
|
|
# [PSFzf](https://github.com/kelleyma49/PSFzf)
|
|
|
|
# [DockerCompletion](https://github.com/matt9ucci/DockerCompletion)
|
|
|
|
|
2023-06-09 17:49:42 -07:00
|
|
|
### Env
|
2022-11-29 23:52:39 -08:00
|
|
|
$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
|
2023-06-18 20:30:41 -07:00
|
|
|
[Console]::InputEncoding = [Console]::OutputEncoding = [System.Text.UTF8Encoding]::new()
|
Update dotfiles/.config/kitty/kitty.conf, dotfiles/.config/kitty/Betelgeuse-dark.conf, dotfiles/.config/kitty/Betelgeuse-light.conf, dotfiles/.local/share/chezmoi/private_dot_config/kitty/kitty.conf, dotfiles/.local/share/chezmoi/private_dot_config/kitty/Betelgeuse-dark.conf, dotfiles/.local/share/chezmoi/private_dot_config/kitty/Betelgeuse-light.conf, dotfiles/.local/share/chezmoi/private_dot_config/ngrok/ngrok.yml.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/powershell/user_profile.ps1, dotfiles/.local/share/chezmoi/private_dot_config/powershell/takuya.omp.json, dotfiles/.local/share/chezmoi/private_dot_config/slack-term/config.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/tabby/config.yaml.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/terminator/config, dotfiles/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml, dotfiles/.local/share/chezmoi/private_dot_config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml, dotfiles/.local/share/chezmoi/private_dot_config/xfce4/terminal/terminalrc, dotfiles/.config/xsettingsd/xsettingsd.conf, dotfiles/.local/share/chezmoi/private_dot_config/xsettingsd/xsettingsd.conf, dotfiles/.local/share/chezmoi/private_dot_config/gtk-3.0/settings.ini
2022-11-21 17:43:46 -08:00
|
|
|
|
2023-06-09 17:49:42 -07:00
|
|
|
### PSReadLine
|
2023-06-09 17:54:02 -07:00
|
|
|
Set-PSReadLineOption -EditMode Vi
|
Update dotfiles/.config/kitty/kitty.conf, dotfiles/.config/kitty/Betelgeuse-dark.conf, dotfiles/.config/kitty/Betelgeuse-light.conf, dotfiles/.local/share/chezmoi/private_dot_config/kitty/kitty.conf, dotfiles/.local/share/chezmoi/private_dot_config/kitty/Betelgeuse-dark.conf, dotfiles/.local/share/chezmoi/private_dot_config/kitty/Betelgeuse-light.conf, dotfiles/.local/share/chezmoi/private_dot_config/ngrok/ngrok.yml.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/powershell/user_profile.ps1, dotfiles/.local/share/chezmoi/private_dot_config/powershell/takuya.omp.json, dotfiles/.local/share/chezmoi/private_dot_config/slack-term/config.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/tabby/config.yaml.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/terminator/config, dotfiles/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml, dotfiles/.local/share/chezmoi/private_dot_config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml, dotfiles/.local/share/chezmoi/private_dot_config/xfce4/terminal/terminalrc, dotfiles/.config/xsettingsd/xsettingsd.conf, dotfiles/.local/share/chezmoi/private_dot_config/xsettingsd/xsettingsd.conf, dotfiles/.local/share/chezmoi/private_dot_config/gtk-3.0/settings.ini
2022-11-21 17:43:46 -08:00
|
|
|
Set-PSReadLineOption -BellStyle None
|
|
|
|
Set-PSReadLineKeyHandler -Chord 'Ctrl+d' -Function DeleteChar
|
|
|
|
Set-PSReadLineOption -PredictionSource History
|
|
|
|
|
2023-06-18 20:30:41 -07:00
|
|
|
### Import PowerShell modules
|
|
|
|
$modules = @("Carbon", "ImportExcel", "Microsoft.PowerShell.ConsoleGuiTools", "Microsoft.PowerShell.PSResourceGet", "PSFzf", "PSWindowsUpdate", "PackageManagement", "PendingReboot", "posh-git", "Terminal-Icons")
|
|
|
|
|
|
|
|
foreach ($module in $modules) {
|
|
|
|
if (-not (Get-Module -ListAvailable -Name $module)) {
|
|
|
|
Install-Module -Name $module -Scope CurrentUser -Force -Repository PSGallery -AllowPrerelease
|
|
|
|
}
|
|
|
|
Import-Module $module -Force
|
|
|
|
}
|
|
|
|
|
2023-07-08 23:46:28 -07:00
|
|
|
### Homebrew
|
|
|
|
Add-Content -Path $PROFILE.CurrentUserAllHosts -Value '$(/usr/local/bin/brew shellenv) | Invoke-Expression'
|
|
|
|
|
2023-06-18 20:30:41 -07:00
|
|
|
### posh-git settings
|
|
|
|
oh-my-posh init pwsh --config "$env:HOME/.config/oh-my-posh/Betelgeuse.omp.json" | Invoke-Expression
|
|
|
|
|
|
|
|
### PSFzf settings
|
|
|
|
Set-PsFzfOption -PSReadlineChordProvider 'Ctrl+t' -PSReadlineChordReverseHistory 'Ctrl+r'
|
|
|
|
$commandOverride = [ScriptBlock]::Create("param(\$Location) Set-Location \$Location")
|
|
|
|
Set-PsFzfOption -AltCCommand $commandOverride
|
|
|
|
Set-PsFzfOption -TabExpansion
|
|
|
|
$env:_PSFZF_FZF_DEFAULT_OPTS = "--ansi --preview 'bat --color=always {}'"
|
|
|
|
Set-PSFzfOption -EnableAlias
|
Update dotfiles/.config/kitty/kitty.conf, dotfiles/.config/kitty/Betelgeuse-dark.conf, dotfiles/.config/kitty/Betelgeuse-light.conf, dotfiles/.local/share/chezmoi/private_dot_config/kitty/kitty.conf, dotfiles/.local/share/chezmoi/private_dot_config/kitty/Betelgeuse-dark.conf, dotfiles/.local/share/chezmoi/private_dot_config/kitty/Betelgeuse-light.conf, dotfiles/.local/share/chezmoi/private_dot_config/ngrok/ngrok.yml.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/powershell/user_profile.ps1, dotfiles/.local/share/chezmoi/private_dot_config/powershell/takuya.omp.json, dotfiles/.local/share/chezmoi/private_dot_config/slack-term/config.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/tabby/config.yaml.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/terminator/config, dotfiles/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml, dotfiles/.local/share/chezmoi/private_dot_config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml, dotfiles/.local/share/chezmoi/private_dot_config/xfce4/terminal/terminalrc, dotfiles/.config/xsettingsd/xsettingsd.conf, dotfiles/.local/share/chezmoi/private_dot_config/xsettingsd/xsettingsd.conf, dotfiles/.local/share/chezmoi/private_dot_config/gtk-3.0/settings.ini
2022-11-21 17:43:46 -08:00
|
|
|
|
|
|
|
### zoxide
|
2023-06-18 20:30:41 -07:00
|
|
|
Invoke-Expression '& {
|
|
|
|
$hook = if ($PSVersionTable.PSVersion.Major -lt 6) { "prompt" } else { "pwd" }
|
Update dotfiles/.config/kitty/kitty.conf, dotfiles/.config/kitty/Betelgeuse-dark.conf, dotfiles/.config/kitty/Betelgeuse-light.conf, dotfiles/.local/share/chezmoi/private_dot_config/kitty/kitty.conf, dotfiles/.local/share/chezmoi/private_dot_config/kitty/Betelgeuse-dark.conf, dotfiles/.local/share/chezmoi/private_dot_config/kitty/Betelgeuse-light.conf, dotfiles/.local/share/chezmoi/private_dot_config/ngrok/ngrok.yml.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/powershell/user_profile.ps1, dotfiles/.local/share/chezmoi/private_dot_config/powershell/takuya.omp.json, dotfiles/.local/share/chezmoi/private_dot_config/slack-term/config.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/tabby/config.yaml.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/terminator/config, dotfiles/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml, dotfiles/.local/share/chezmoi/private_dot_config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml, dotfiles/.local/share/chezmoi/private_dot_config/xfce4/terminal/terminalrc, dotfiles/.config/xsettingsd/xsettingsd.conf, dotfiles/.local/share/chezmoi/private_dot_config/xsettingsd/xsettingsd.conf, dotfiles/.local/share/chezmoi/private_dot_config/gtk-3.0/settings.ini
2022-11-21 17:43:46 -08:00
|
|
|
(zoxide init --hook $hook powershell | Out-String)
|
2023-06-18 20:30:41 -07:00
|
|
|
}'
|
Update dotfiles/.config/kitty/kitty.conf, dotfiles/.config/kitty/Betelgeuse-dark.conf, dotfiles/.config/kitty/Betelgeuse-light.conf, dotfiles/.local/share/chezmoi/private_dot_config/kitty/kitty.conf, dotfiles/.local/share/chezmoi/private_dot_config/kitty/Betelgeuse-dark.conf, dotfiles/.local/share/chezmoi/private_dot_config/kitty/Betelgeuse-light.conf, dotfiles/.local/share/chezmoi/private_dot_config/ngrok/ngrok.yml.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/powershell/user_profile.ps1, dotfiles/.local/share/chezmoi/private_dot_config/powershell/takuya.omp.json, dotfiles/.local/share/chezmoi/private_dot_config/slack-term/config.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/tabby/config.yaml.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/terminator/config, dotfiles/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml, dotfiles/.local/share/chezmoi/private_dot_config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml, dotfiles/.local/share/chezmoi/private_dot_config/xfce4/terminal/terminalrc, dotfiles/.config/xsettingsd/xsettingsd.conf, dotfiles/.local/share/chezmoi/private_dot_config/xsettingsd/xsettingsd.conf, dotfiles/.local/share/chezmoi/private_dot_config/gtk-3.0/settings.ini
2022-11-21 17:43:46 -08:00
|
|
|
|
|
|
|
### Aliases
|
2023-06-18 20:30:41 -07:00
|
|
|
Set-Alias grep Select-String
|
Update dotfiles/.config/kitty/kitty.conf, dotfiles/.config/kitty/Betelgeuse-dark.conf, dotfiles/.config/kitty/Betelgeuse-light.conf, dotfiles/.local/share/chezmoi/private_dot_config/kitty/kitty.conf, dotfiles/.local/share/chezmoi/private_dot_config/kitty/Betelgeuse-dark.conf, dotfiles/.local/share/chezmoi/private_dot_config/kitty/Betelgeuse-light.conf, dotfiles/.local/share/chezmoi/private_dot_config/ngrok/ngrok.yml.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/powershell/user_profile.ps1, dotfiles/.local/share/chezmoi/private_dot_config/powershell/takuya.omp.json, dotfiles/.local/share/chezmoi/private_dot_config/slack-term/config.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/tabby/config.yaml.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/terminator/config, dotfiles/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml, dotfiles/.local/share/chezmoi/private_dot_config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml, dotfiles/.local/share/chezmoi/private_dot_config/xfce4/terminal/terminalrc, dotfiles/.config/xsettingsd/xsettingsd.conf, dotfiles/.local/share/chezmoi/private_dot_config/xsettingsd/xsettingsd.conf, dotfiles/.local/share/chezmoi/private_dot_config/gtk-3.0/settings.ini
2022-11-21 17:43:46 -08:00
|
|
|
|
|
|
|
### Utilities
|
|
|
|
function which ($command) {
|
|
|
|
Get-Command -Name $command -ErrorAction SilentlyContinue |
|
2023-06-18 20:30:41 -07:00
|
|
|
Select-Object -ExpandProperty Source -ErrorAction SilentlyContinue
|
Update dotfiles/.config/kitty/kitty.conf, dotfiles/.config/kitty/Betelgeuse-dark.conf, dotfiles/.config/kitty/Betelgeuse-light.conf, dotfiles/.local/share/chezmoi/private_dot_config/kitty/kitty.conf, dotfiles/.local/share/chezmoi/private_dot_config/kitty/Betelgeuse-dark.conf, dotfiles/.local/share/chezmoi/private_dot_config/kitty/Betelgeuse-light.conf, dotfiles/.local/share/chezmoi/private_dot_config/ngrok/ngrok.yml.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/powershell/user_profile.ps1, dotfiles/.local/share/chezmoi/private_dot_config/powershell/takuya.omp.json, dotfiles/.local/share/chezmoi/private_dot_config/slack-term/config.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/tabby/config.yaml.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/terminator/config, dotfiles/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml, dotfiles/.local/share/chezmoi/private_dot_config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml, dotfiles/.local/share/chezmoi/private_dot_config/xfce4/terminal/terminalrc, dotfiles/.config/xsettingsd/xsettingsd.conf, dotfiles/.local/share/chezmoi/private_dot_config/xsettingsd/xsettingsd.conf, dotfiles/.local/share/chezmoi/private_dot_config/gtk-3.0/settings.ini
2022-11-21 17:43:46 -08:00
|
|
|
}
|