mirror of
https://github.com/reonokiy/dotfiles.git
synced 2025-06-15 06:02:53 +02:00
56 lines
1.5 KiB
Cheetah
56 lines
1.5 KiB
Cheetah
# starship
|
|
if (Get-Command starship -ErrorAction SilentlyContinue) {
|
|
Invoke-Expression (&starship init powershell)
|
|
}
|
|
|
|
# fnm
|
|
if (Get-Command fnm -ErrorAction SilentlyContinue) {
|
|
fnm env --use-on-cd --shell powershell | Out-String | Invoke-Expression
|
|
}
|
|
|
|
# micromamba
|
|
if (Get-Command micromamba -ErrorAction SilentlyContinue) {
|
|
$Env:MAMBA_ROOT_PREFIX = "{{ .chezmoi.homeDir }}/.micromamba"
|
|
$Env:MAMBA_EXE = "{{ .chezmoi.homeDir }}/AppData/Local/micromamba/micromamba.exe"
|
|
(& $Env:MAMBA_EXE 'shell' 'hook' -s 'powershell' -p $Env:MAMBA_ROOT_PREFIX) | Out-String | Invoke-Expression
|
|
}
|
|
|
|
# zoxide
|
|
if (Get-Command zoxide -ErrorAction SilentlyContinue) {
|
|
Invoke-Expression (& { (zoxide init powershell | Out-String) })
|
|
}
|
|
|
|
# yazi
|
|
function ya {
|
|
$tmp = [System.IO.Path]::GetTempFileName()
|
|
yazi $args --cwd-file="$tmp"
|
|
$cwd = Get-Content -Path $tmp
|
|
if (-not [String]::IsNullOrEmpty($cwd) -and $cwd -ne $PWD.Path) {
|
|
Set-Location -Path $cwd
|
|
}
|
|
Remove-Item -Path $tmSp
|
|
}
|
|
|
|
# # remove built-in alias
|
|
# if (Get-Command curl -ErrorAction SilentlyContinue) {
|
|
# remove-item alias:curl
|
|
# }
|
|
# if (Get-Command ls -ErrorAction SilentlyContinue) {
|
|
# remove-item alias:ls
|
|
# }
|
|
# if (Get-Command cp -ErrorAction SilentlyContinue) {
|
|
# remove-item alias:cp
|
|
# }
|
|
# if (Get-Command rm -ErrorAction SilentlyContinue) {
|
|
# remove-item alias:rm
|
|
# }
|
|
|
|
# alias
|
|
|
|
## eza -> ls
|
|
if (Get-Command eza -ErrorAction SilentlyContinue) {
|
|
Set-Alias -Name ls -Value eza
|
|
}
|
|
|
|
Set-Alias -Name mm -Value micromamba
|
|
Set-Alias -Name dotfiles -Value chezmoi
|