From 55628e9fa5ab2fee17fcdb48157bd4c0ef4423c4 Mon Sep 17 00:00:00 2001 From: Andre Ramnitz Date: Wed, 4 Dec 2024 22:38:21 +0100 Subject: [PATCH] lf: preparations for using lf as a file picker lf: add a modified kks-lf2 script to get this working note: use this to overwrite the default kks-lf script provided by kks --- dot-config/lf/lfrc | 4 +--- dot-local/bin/kks-lf! | 13 +++++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100755 dot-local/bin/kks-lf! diff --git a/dot-config/lf/lfrc b/dot-config/lf/lfrc index 4a0499a1..3428df18 100644 --- a/dot-config/lf/lfrc +++ b/dot-config/lf/lfrc @@ -43,9 +43,6 @@ set ifs "\n" # leave some space at the top and the bottom of the screen set scrolloff 3 -# use enter for shell commands -map shell - # make sure trash folder exists %mkdir -p ~/.trash @@ -505,6 +502,7 @@ map \| shell-pipe map '%' : select-all # various commands +map open map unselect map ~ toggle_preview map C edit-config diff --git a/dot-local/bin/kks-lf! b/dot-local/bin/kks-lf! new file mode 100755 index 00000000..b4caf2b5 --- /dev/null +++ b/dot-local/bin/kks-lf! @@ -0,0 +1,13 @@ +#!/bin/sh +# +# open lf in single-pane view with current buffer selected +# +# requires: +# - lf (https://github.com/gokcehan/lf) + +# kks get '%val{buffile}' | + # xargs -I {} lf -command "set nopreview; set ratios 1" {} + +lf -command "set nopreview; set ratios 1" -selection-path "/tmp/lf-chosen-file.XXXX" +kks edit "$(cat "/tmp/lf-chosen-file.XXXX")" + -- 2.51.2