lf opener fixes
This commit is contained in:
parent
1eba4db0c7
commit
34b3e87a57
|
@ -13,16 +13,29 @@ set promptfmt # this is set in a function later
|
||||||
# HACK: This is needed to trigger the opening function of the taolf nvim plugin
|
# HACK: This is needed to trigger the opening function of the taolf nvim plugin
|
||||||
cmd open ${{
|
cmd open ${{
|
||||||
set +u
|
set +u
|
||||||
[ "$lf_user_multiedit" = "true" ] && { $EDITOR $fx; return; }
|
[ "$lf_user_multiedit" = "true" ] && {
|
||||||
|
if [ -n "$TAOLF" ]; then
|
||||||
|
lf -remote "send $id open"
|
||||||
|
else
|
||||||
|
$EDITOR $fx
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
}
|
||||||
$OPENER "$f"
|
$OPENER "$f"
|
||||||
}}
|
}}
|
||||||
|
|
||||||
cmd pushedit %{{
|
cmd pushedit %{{
|
||||||
|
set +u
|
||||||
echo "Open: " && read files
|
echo "Open: " && read files
|
||||||
echo
|
echo
|
||||||
echo $files | xargs touch
|
echo $files | xargs -r touch
|
||||||
lf -remote "send $id \$$OPENER $files
|
if [ -n "$TAOLF" ]; then
|
||||||
send $id unselect"
|
lf -remote "send $id toggle $files
|
||||||
|
send $id open"
|
||||||
|
else
|
||||||
|
lf -remote "send $id \$$OPENER $files
|
||||||
|
send $id unselect"
|
||||||
|
fi
|
||||||
}}
|
}}
|
||||||
|
|
||||||
cmd open-with ${{
|
cmd open-with ${{
|
||||||
|
|
|
@ -1,17 +1,13 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# shellcheck disable=2154
|
# shellcheck disable=2154
|
||||||
|
|
||||||
[ -n "$TAOLF" ] && {
|
|
||||||
lf -remote "send $id toggle $(printf "'%s'" "$@"); open"
|
|
||||||
}
|
|
||||||
|
|
||||||
term=
|
term=
|
||||||
[ -n "$SCRATCHPAD" ] && {
|
[ -n "$SCRATCHPAD" ] && {
|
||||||
set -- -ft "$@"
|
set -- -ft "$@"
|
||||||
term="$TERMCMD -e"
|
term="$TERMCMD -e"
|
||||||
}
|
}
|
||||||
|
|
||||||
# HACK: workaround for an nvim/taolf bug with opening empty files
|
# HACK: workaround for a bug with opening empty files in vim
|
||||||
[ "$(rifle -c "$XDG_CONFIG_HOME/lf/rifle.conf" | head -1 | cut -d ':' -f 2)" = "editor" ] && $term vim "$@"
|
[ "$(rifle -c "$XDG_CONFIG_HOME/lf/rifle.conf" | head -1 | cut -d ':' -f 2)" = "editor" ] && $term vim "$@"
|
||||||
|
|
||||||
set -- -p0 -c "$XDG_CONFIG_HOME/lf/rifle.conf" "$@"
|
set -- -p0 -c "$XDG_CONFIG_HOME/lf/rifle.conf" "$@"
|
||||||
|
|
Loading…
Reference in New Issue