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

Possible to get a list of previous dirs by time? #784

Open
max-sixty opened this issue Apr 8, 2024 · 0 comments · May be fixed by #857
Open

Possible to get a list of previous dirs by time? #784

max-sixty opened this issue Apr 8, 2024 · 0 comments · May be fixed by #857

Comments

@max-sixty
Copy link

(thank you for zoxide, it's excellent!)

z or zi is great for frequently visited directories. But often I want to go to a directory I visited 20 minutes ago for the first time, and this would rank very low on zoxide's list, given that it only been hit once.

So a command that listed the most recently visited directories in descending time order would be really useful.

I'm not sure whether the data structure supports it, so maybe this would require a whole new data structure and so is out of scope, feel free to close if so...

mzacho added a commit to mzacho/zoxide that referenced this issue Jul 15, 2024
Added the option `--sort-by [score|path|last-accessed]` for the `query`
subcommand with default value `score` i.e:

```bash
$ zoxide query --list --score --sort-by last-accessed
   4.0 /home/martin/playground/scala/scala-3-project-template
   3.5 /home/martin/playground/rust
   3.8 /home/martin/playground/python
  12.0 /home/martin/projects/zoxide
  11.8 /home/martin/playground
  16.5 /home/martin/projects/thesis
   6.0 /home/martin/projects/thesis/frontend
...
```

```bash
$ zoxide query --list --score --sort-by path
   0.2 /home/martin/.local/state
   0.2 /home/martin/.local/share/zoxide
   0.2 /home/martin/.local/share
   0.2 /home/martin/.config/protonmail/bridge-v3
   0.2 /home/martin/.config/protonmail
   0.5 /home
   0.5 /etc/nixos/lib/lisp
   0.8 /
...
```

```bash
$ zoxide query --list --score
  16.5 /home/martin/projects/thesis
  16.0 /home/martin/projects/zoxide
   8.0 /home/martin/projects/egcd
   8.0 /persist
   6.0 /home/martin/projects/thesis/frontend
...
```

Fixes ajeetdsouza#784 as well as ajeetdsouza#815.
@mzacho mzacho linked a pull request Jul 15, 2024 that will close this issue
mzacho added a commit to mzacho/zoxide that referenced this issue Jul 15, 2024
Added the option `--sort-by [score|path|last-accessed]` for the `query`
subcommand with default value `score` i.e:

```bash
$ zoxide query --list --score --sort-by last-accessed
   4.0 /home/martin/playground/scala/scala-3-project-template
   3.5 /home/martin/playground/rust
   3.8 /home/martin/playground/python
  12.0 /home/martin/projects/zoxide
  11.8 /home/martin/playground
  16.5 /home/martin/projects/thesis
   6.0 /home/martin/projects/thesis/frontend
...
```

```bash
$ zoxide query --list --score --sort-by path
   0.2 /home/martin/.local/state
   0.2 /home/martin/.local/share/zoxide
   0.2 /home/martin/.local/share
   0.2 /home/martin/.config/protonmail/bridge-v3
   0.2 /home/martin/.config/protonmail
   0.5 /home
   0.5 /etc/nixos/lib/lisp
   0.8 /
...
```

```bash
$ zoxide query --list --score
  16.5 /home/martin/projects/thesis
  16.0 /home/martin/projects/zoxide
   8.0 /home/martin/projects/egcd
   8.0 /persist
   6.0 /home/martin/projects/thesis/frontend
...
```

Fixes ajeetdsouza#784 as well as ajeetdsouza#815.
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

Successfully merging a pull request may close this issue.

1 participant