You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use zsh-z primarily to jump between various directories that are tracked as git repositories.
Occasionally, there will be a higher-'frecency' match that is a subpath of some repository, when I really want to change to a repository that matches the query.
It would be nice if zsh-z had an optional flag to prioritize directories which contain a .git directory. This could be done at scoring time, or at invocation-time (i.e. of all matches for query QUERY, take the first one that has a .git directory, if the directory name itself matches QUERY, otherwise the most 'frecent' directory). This would only take effect if the query were a match for the name of the repository itself, so that e.g. z somedir doesn't drop me at the root of the repository, but would behave as it does not normally.
TL;DR An environment variable that prioritizes git repository roots if the search query matches the directory name containing a git repository (but queries for subpaths that do not match the repo name are unchanged).
Examples
I want to change to the git repository that has 'iob' in the name. I recently spent some time in a completely unrelated directory that has 'iob' somewhere run its subpath, and it is now ranked higher. This is undesirable for my use case.
Current behavior
~ ❯❯❯ z iob
~/s/C/m/m/IOBxxx/P/somedir ❯❯❯
Desired behavior
~ ❯❯❯ z iob
~/s/C/iobXYZ ❯❯❯ ls -d .git
.git
The text was updated successfully, but these errors were encountered:
zachriggle
changed the title
Feature: Heavier weighting for directories which contain a .git directory
Feature: Prefer directories which contain a .git directory, if query matches repo name
Mar 11, 2021
zachriggle
changed the title
Feature: Prefer directories which contain a .git directory, if query matches repo name
Feature: Prefer directories which contain a .git directory, if query matches repo directory name
Mar 11, 2021
and the best match is /foo/bar/bat, you’ll end up in /foo/bar because you searched for bar. If you’d run z foo and the best match was /foo/bar/bat, you’d end up in /foo.
I use zsh-z primarily to jump between various directories that are tracked as git repositories.
Occasionally, there will be a higher-'frecency' match that is a subpath of some repository, when I really want to change to a repository that matches the query.
It would be nice if zsh-z had an optional flag to prioritize directories which contain a .git directory. This could be done at scoring time, or at invocation-time (i.e. of all matches for query
QUERY
, take the first one that has a .git directory, if the directory name itself matchesQUERY
, otherwise the most 'frecent' directory). This would only take effect if the query were a match for the name of the repository itself, so that e.g.z somedir
doesn't drop me at the root of the repository, but would behave as it does not normally.TL;DR An environment variable that prioritizes git repository roots if the search query matches the directory name containing a git repository (but queries for subpaths that do not match the repo name are unchanged).
Examples
I want to change to the git repository that has 'iob' in the name. I recently spent some time in a completely unrelated directory that has 'iob' somewhere run its subpath, and it is now ranked higher. This is undesirable for my use case.
Current behavior
Desired behavior
The text was updated successfully, but these errors were encountered: