aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.config/lf
diff options
context:
space:
mode:
authorYaroslav de la Peña Smirnov <yps@yaroslavps.com>2021-10-26 15:34:07 +0300
committerYaroslav de la Peña Smirnov <yps@yaroslavps.com>2021-10-26 15:34:07 +0300
commit566a28c29703799410576a03ed474abc5e43423c (patch)
tree65f6077e5c9ca6ad5d5881313f30f4a30de81d8d /dotfiles/.config/lf
parentf79b8c8ed3d34588d35134cc19e60b059a4064e7 (diff)
downloadswayrice-566a28c29703799410576a03ed474abc5e43423c.tar.gz
swayrice-566a28c29703799410576a03ed474abc5e43423c.zip
lf: open files with fzf
Diffstat (limited to 'dotfiles/.config/lf')
-rw-r--r--dotfiles/.config/lf/lfrc26
1 files changed, 19 insertions, 7 deletions
diff --git a/dotfiles/.config/lf/lfrc b/dotfiles/.config/lf/lfrc
index 51115c2..5b9854c 100644
--- a/dotfiles/.config/lf/lfrc
+++ b/dotfiles/.config/lf/lfrc
@@ -52,13 +52,24 @@ cmd extract ${{
# change dir with fzf
cmd fzf_jump ${{
- res="$(find . -type d | fzf --header='Jump to location')"
- if [ -d "$res" ]; then
- cmd="cd"
- else
- cmd="select"
- fi
- lf -remote "send $id $cmd \"$res\""
+ res="$(find . -type d | fzf --header='Jump to location')"
+ if [ -d "$res" ]; then
+ cmd="cd"
+ else
+ cmd="select"
+ fi
+ lf -remote "send $id $cmd \"$res\""
+}}
+
+# open file with fzf
+cmd fzf_open ${{
+ res="$(find . -type d -path "*/\.*" -prune -o -not -name ".*" -type f | fzf)"
+ if [ -e "$res" ]; then
+ cmd="mimeo"
+ else
+ cmd="select"
+ fi
+ $cmd "$res"
}}
# drag and drop prompt
@@ -87,6 +98,7 @@ map <enter> shell
map D delete
map <enter> shell
map f :fzf_jump
+map o :fzf_open
map t :dragon
map T :dragon_drop
map W $setsid $TERMINAL > /dev/null 2>&1 & # open new terminal window