Open xiaq opened 7 months ago
The jump-to
command could then be implemented like:
fn jump-to {|filter| cd (edit:location:filtered-dirs $filter | take 1)}
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.
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 byfoo
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, sayedit:location:filter-dirs $filter
to return filtered directory history.