Open command that only opens directories? #2333
-
|
Hello, I would like to have an open command/keybind that only opens directories. I tried cd $f and a few variations on that, but no luck. Anyone have a solution to this? I want to replace my right motions with this. Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
CatsDeservePets
Jan 1, 2026
Replies: 1 comment 2 replies
-
|
Hello @shmcgrath, map l %{{
if [ -d "$f" ]; then
lf -remote "send $id open"
else
printf "Not a directory"
fi
}}To open files I have to press map <enter> open |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
shmcgrath
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello @shmcgrath,
I have this keybinding in my config because I constantly kept opening files by accident while navigating through directories (you can obviously remove the print statement 😃):
map l %{{ if [ -d "$f" ]; then lf -remote "send $id open" else printf "Not a directory" fi }}To open files I have to press
<enter>: