You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want a keybind that toggles between these two settings:
set nopreview
set ratios 1
set preview
set ratios 1:3:2
I couldn't come up with any way to get this behavior by reading the :doc. But two came to mind:
Export lf options as shell variables (like Kakoune). Example: Exporting preview as $lf_preview (0/1).
%{{
if [ $lf_preview -eq 1 ]; then
# first setting here
else
# second setting here
fi
}}
Implementing return codes for lf -remote "send $id <...>" depending on if the command succeeded or not. This is a hackier solution but I figured it'd work since set preview will fail if ratios are not set up correctly. If the above is implemented instead, I think this would still have other uses (can't come up with any right now though).
%{{
if ! lf -remote "send $id preview"; then
# second setting here
else
# first setting here
fi
}}
I hope I didn't miss a more obvious way to set this up, this is the best I could come up with after reading the doc for a bit.
And thanks for lf! I feel like it complements the Kakoune workflow a lot.
The text was updated successfully, but these errors were encountered:
@SeerLite Thanks for the ideas. This is mentioned frequently but unfortunately not added yet. I think I'm in favor of the first option. I don't think this would be difficult to implement either. If anyone is interested, I think one should simply add a new function like app.exportOpts to be called in app.runShell that goes over all options in gOpts and export them as variables.
I want a keybind that toggles between these two settings:
I couldn't come up with any way to get this behavior by reading the
:doc
. But two came to mind:preview
as$lf_preview
(0/1).lf -remote "send $id <...>"
depending on if the command succeeded or not. This is a hackier solution but I figured it'd work sinceset preview
will fail if ratios are not set up correctly. If the above is implemented instead, I think this would still have other uses (can't come up with any right now though).I hope I didn't miss a more obvious way to set this up, this is the best I could come up with after reading the doc for a bit.
And thanks for lf! I feel like it complements the Kakoune workflow a lot.
The text was updated successfully, but these errors were encountered: