Skip to content
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

Elvish binding for filtered directory history #1771

Open
xiaq opened this issue Mar 5, 2024 · 2 comments
Open

Elvish binding for filtered directory history #1771

xiaq opened this issue Mar 5, 2024 · 2 comments

Comments

@xiaq
Copy link
Member

xiaq commented Mar 5, 2024

Pedro on the Telegram channel raised the question of whether directory history can be used via an alternative CLI interface - for example, jump-to foo would be the equivalent of typing Ctrl-L, filter by foo and going to the first result.

I think the interactivity of location mode makes it more powerful, but on the other hand in the spirit of programmability it should be trivial for a user to implement a jump-to command if they prefer.

Right now store:dirs exposes directory history, but the filtering functionality is not exposed. It'd make sense to implement, say edit:location:filter-dirs $filter to return filtered directory history.

@xiaq
Copy link
Member Author

xiaq commented Mar 5, 2024

The jump-to command could then be implemented like:

fn jump-to {|filter| cd (edit:location:filtered-dirs $filter | take 1)}

@krader1961
Copy link
Contributor

Should this mimic store:prev-cmd and store:next-cmd where the value is a prefix to be matched? If not, why not? Should those commands have the ability for more powerful matching? Also, I don't think this should be exposed by a hypothetical edit:location:filtered-dirs command. It should be exposed by the store module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants