-
Notifications
You must be signed in to change notification settings - Fork 2
FEATURE: allow to pass paths from outside without searching in them #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
FEATURE: allow to pass paths from outside without searching in them #7
Conversation
- checks if there is at least one path - gives a nice fuzzy menu with only the names of the projects and then use the internally stored absolute path to reconstruct the full directory path - uses the `input list --fuzzy` command of Nushell
this allows to both - give a list of pre-computed paths to the *sessionizer* - give a list of start directory to search recursively in them at some depth
# open a session in local repos and documents | ||
# > zellij-sessionizer.nu ( | ||
# > [~/.local/share/repos/ ~/documents/] | each { ls $in | where type == dir | get name } | flatten | ||
# > ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, Sorry for my absence!
isn't it the same as:
zellij-sessionizer $( fd . ~/Documents --type d) # Then it just gets piped into fzf?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, Sorry for my absence!
hey 👋
no worries 😉
isn't it the same as:
zellij-sessionizer $( fd . ~/Documents --type d) # Then it just gets piped into fzf?
yeah it looks about the same 👍
i'm just using pure Nushell commands but they are looking for depth-1 directories in all the directories in the list to the left 😋
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right!
So I'd probably add it as part of the alias (we can update the readme for it) instead of pushing it into the code as it feels like something some users would like where others would defer to an external app (such as fd
)
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right! So I'd probably add it as part of the alias (we can update the readme for it) instead of pushing it into the code as it feels like something some users would like where others would defer to an external app (such as
fd
)WDYT?
not sure i see what you mean here by "add it as part of the alias instead of pushing it into the code" 😕
and you're talking about the Bash implementation, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add it as part of the alias instead of pushing it into the code
I mean that I think it should be part of the users config - like a parameter passed to their .rc
aliases for zellij-sessionizer
I'm talking about both implementations as I try to maintain a single-responsibility philosophy as much as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok i see, does that mean that you'd like the script not mentioning find
or fd
directly?
i might miss something here 😱 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes!
give it some sane defaults and let the user decide about everything that's under the title of 'customization'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooh yeah, i see what you mean now 😌
i'd say, as find
and fd
were already there before this PR, we can leave this as-is for now and tackle the removal of these commands and making them configurable in another PR? 😋
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the solution I was thinking about is sort of a flat way of passing params into your find cmd, without explicitly mentioning it within the code.
Assuming you're using fd
- I envision something like
$ zellij_sessionizer [paths] -- ...rest_of_fds options
Then the script will just pass it as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mm we can't do that really in Nushell right now 😕
related to
this PR allows to pass directories from outside of the sessionizer without searching recursively in them.
the
zellij-sessionizer.nu
script also supports passing a--depth: int
to recursively search inside the...paths
at the given depth 👌hopefully this brings best of both worlds 😌 🤞