From affda91fe72ebcc88445f5edcb7c6375ad914a58 Mon Sep 17 00:00:00 2001 From: CatsDeservePets <145048791+CatsDeservePets@users.noreply.github.com> Date: Fri, 16 May 2025 15:39:13 +0000 Subject: [PATCH] Update lfrc.ps1.example --- etc/lfrc.ps1.example | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/etc/lfrc.ps1.example b/etc/lfrc.ps1.example index 26bbc872..41a57513 100644 --- a/etc/lfrc.ps1.example +++ b/etc/lfrc.ps1.example @@ -1,17 +1,31 @@ # interpreter for shell commands -set shell powershell +set shell pwsh + +# allow the usage of $args inside shell commands +set shellflag "-cwa" + +# speed up Powershell by skipping the profile +set shellopts "-nop" # Shell commands with multiline definitions and/or positional arguments and/or -# quotes do not work in Windows. For anything but the simplest shell commands, +# quotes only partly work in Windows. For anything but the simplest shell commands, # it is recommended to create separate script files and simply call them here # in commands or mappings. # -# Also, the default keybindings are defined using cmd syntax (i.e. '%EDITOR%') -# which does not work with powershell. Therefore, you need to override these -# keybindings with explicit choices accordingly. - -# change the default open command to work in powerShell -cmd open &start $Env:f +# Also, the default commands and keybindings are defined using cmd syntax (i.e. '%EDITOR%') +# which does not work with Powershell. Therefore, you need to override these +# with explicit choices accordingly. + +# change the default commands and keybindings to work in Powershell +cmd open &&$Env:OPENER.Trim('"', ' ') "$Env:f" +map e $&$Env:EDITOR "$Env:f" +map i !&$Env:PAGER "$Env:f" +map w $&$Env:SHELL +cmd doc !&$Env:lf.Trim('"', ' ') -doc | &$Env:PAGER +map doc +cmd maps !&$Env:lf.Trim('"', ' ') -remote "query $Env:id maps" | &$Env:PAGER +cmd cmaps !&$Env:lf.Trim('"', ' ') -remote "query $Env:id cmaps" | &$Env:PAGER +cmd cmds !&$Env:lf.Trim('"', ' ') -remote "query $Env:id cmds" | &$Env:PAGER # change the editor used in default editor keybinding # There is no builtin terminal editor installed in Windows. The default editor