diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 9c50cd20..c1118b1b 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -26,8 +26,11 @@ cmd open ${{ cmd pushedit %{{ set +u - echo "Open: " && read files - echo + files=$1 + [ -z $files ] && { + echo "Open: " && read files + echo + } echo $files | xargs -r touch if [ -n "$TAOLF" ]; then lf -remote "send $id unselect @@ -162,10 +165,8 @@ cmd fzfgrep ${{ row="$(echo "$res" | cut -d':' -f2)" column="$(echo "$res" | cut -d':' -f3)" if [ -n "$res" ]; then - # shellcheck disable=2154 - lf -remote "send $id select '$file'" if [ -n "$VIM" ]; then - lf -remote "send $id open '$file'" + lf -remote "send $id pushedit '$file'" elif { [ "$EDITOR" = "nvim" ] || [ "$EDITOR" = "vim" ]; } && [ -n "$EMBEDDED" ]; then lf -remote "send $id \$$EDITOR +'call cursor($row, $column)' -- $([ -n "$EMBEDDED" ] && echo "--") '$file'" else