mirror of
https://github.com/reonokiy/dotfiles.git
synced 2025-06-15 14:12:53 +02:00
add zoxide and improve init
This commit is contained in:
parent
da639b3a2a
commit
9a91e31221
2 changed files with 38 additions and 25 deletions
|
@ -1,25 +0,0 @@
|
|||
# init
|
||||
Invoke-Expression (&starship init powershell) # starship
|
||||
|
||||
# micromamba
|
||||
#region mamba initialize
|
||||
# !! Contents within this block are managed by 'mamba shell init' !!
|
||||
$Env:MAMBA_ROOT_PREFIX = "C:\Users\remon\.micromamba"
|
||||
$Env:MAMBA_EXE = "C:\Users\remon\AppData\Local\micromamba\micromamba.exe"
|
||||
(& $Env:MAMBA_EXE 'shell' 'hook' -s 'powershell' -p $Env:MAMBA_ROOT_PREFIX) | Out-String | Invoke-Expression
|
||||
#endregion
|
||||
|
||||
# Alias
|
||||
Set-Alias -Name ls -Value eza
|
||||
Set-Alias -Name mm -Value micromamba
|
||||
Set-Alias -Name dotfiles -Value chezmoi
|
||||
|
||||
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 $tmp
|
||||
}
|
38
Documents/PowerShell/Microsoft.PowerShell_profile.ps1.tmpl
Normal file
38
Documents/PowerShell/Microsoft.PowerShell_profile.ps1.tmpl
Normal file
|
@ -0,0 +1,38 @@
|
|||
# starship
|
||||
if (Get-Command starship -ErrorAction SilentlyContinue) {
|
||||
Invoke-Expression (&starship init powershell)
|
||||
}
|
||||
|
||||
# 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
|
||||
}
|
||||
|
||||
|
||||
# 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
|
Loading…
Add table
Add a link
Reference in a new issue