add windows interactive cd

This commit is contained in:
2025-05-22 15:29:51 +08:00
parent fb5ba9f036
commit a7a83d64ea

View File

@@ -40,6 +40,23 @@ Then,
Invoke-Expression (& { (zoxide init powershell | Out-String) })
```
# Interactive cd using fzf
```powershell
function INTERECTIVE_CD {gci -Directory -Recurse | select -expandproperty FullName | fzf}
Set-Alias cdi INTERECTIVE_CD
```
# ctrl-t; ctrl-r
First, install `PSFzf` module
```powershell
Install-Module -Name PSFzf
```
Then, add the following line into `$PROFILE`
```powershell
Set-PsFzfOption -PSReadlineChordProvider 'Ctrl+t' -PSReadlineChordReverseHistory 'Ctrl+r'
```
# Oh-My-Posh
Copy *.omp.json to `$env:POSH_THEMES_PATH`
Edit $PROFILE and add
@@ -47,3 +64,16 @@ Edit $PROFILE and add
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/powerlevel10k_rainbow_eip.omp.json" | Invoke-Expression
```
at the top.
# `$PROFILE` File All In One
```powershell
Invoke-Expression (&starship init powershell)
Invoke-Expression (& { (zoxide init powershell | Out-String) })
Set-PSReadLineOption -EditMode Emacs
Set-PsFzfOption -PSReadlineChordProvider 'Ctrl+t' -PSReadlineChordReverseHistory 'Ctrl+r'
function INTERACTIVE_CD {gci -Directory -Recurse | select -expandproperty FullName | fzf}
Set-Alias cdi INTERACTIVE_CD
```