add: pwsh: emacs keybindings

explicit cmd/pwsh PSReadLine mode
This commit is contained in:
qwjyh 2022-10-10 22:18:04 +09:00
parent 700fa0ba79
commit 38928f1e21

View file

@ -3,13 +3,17 @@
# ==============================================================
Import-Module PSReadLine # >= 2.2.2
Import-Module CompletionPredictor
Set-PSReadLineOption -EditMode Windows
Set-PSReadLineOption -PredictionSource HistoryAndPlugin # require PowerShell ≧ 7.2 and PSReadLine ≧ 2.2.2
Set-PSReadlineOption -HistoryNoDuplicates
Set-PSReadLineOption -DingTone 880 # beep frequency
Set-PSReadLineKeyHandler -Chord "Ctrl+u" -Function BackwardKillInput # like emacs
Set-PSReadLineKeyHandler -Chord "Ctrl+p" -Function PreviousHistory # like emacs
Set-PSReadLineKeyHandler -Chord "Ctrl+n" -Function NextHistory # like emacs
Set-PSReadLineKeyHandler -Chord "Ctrl+f" -Function AcceptSuggestion # like fish
Set-PSReadLineKeyHandler -Chord "Tab" MenuComplete
Set-PSReadLineKeyHandler -Chord "Ctrl+d" DeleteCharOrExit
Set-PSReadLineKeyHandler -Chord "Ctrl+g" -ScriptBlock { Invoke-FzfTabCompletion }
Set-PSReadLineKeyHandler -Chord "Ctrl+g" -ScriptBlock { Invoke-FzfTabCompletion } -BriefDescription "Fzf tab completion" -Description "Invoke fzf tab completion. Need some input first."
# PsFzf Options
# 'Ctrl+t' for provider path, 'Ctrl+r' for reverse history