-
Notifications
You must be signed in to change notification settings - Fork 133
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
[feat] zi cd
with zero args or -[[:digit:]] argument will jump to the last N dir
#330
Open
psprint
wants to merge
2
commits into
zdharma-continuum:main
Choose a base branch
from
psprint:auto-last-zinit-cd
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vladdoster
approved these changes
Jul 15, 2022
vladdoster
changed the title
Make
[feat] Jul 15, 2022
zi cd
with no arguments or with a -[[:digit:]] argument jump to last Nth visited dirzi cd
with zero args or with a -[[:digit:]] argument jump to last N^^th visited dir
vladdoster
changed the title
[feat]
[feat] Jul 15, 2022
zi cd
with zero args or with a -[[:digit:]] argument jump to last N^^th visited dirzi cd
with zero args or with a -[[:digit:]] argument jump to last **N**th visited dir
vladdoster
changed the title
[feat]
[feat] Jul 15, 2022
zi cd
with zero args or with a -[[:digit:]] argument jump to last **N**th visited dirzi cd
with zero args or with a -[[:digit:]] argument jump to the last N dir
vladdoster
changed the title
[feat]
[feat] Jul 15, 2022
zi cd
with zero args or with a -[[:digit:]] argument jump to the last N dirzi cd
with zero args or -[[:digit:]] argument will jump to the last N dir
It's possible to easily test the PR with |
last or -2, or -3, etc. last visited directory with `zi cd …`. This stack essentially works as `cd -[[:digit:]]` except that the last dir on the stack is -1, not -0 (i.e.: just like Zsh array indices).
psprint
force-pushed
the
auto-last-zinit-cd
branch
from
July 16, 2022 14:28
158fe11
to
fa45f91
Compare
I've done the comment update, after some fine tuning of it. |
It seems reasonable to update _zinit to expose this feature. Thoughts? |
Yes it would be nice to complete this feature like `cd -`.
niedz., 17 lip 2022, 02:53 użytkownik vladislav doster <
***@***.***> napisał:
… It seems reasonable to update _zinit to expose this feature. Thoughts?
—
Reply to this email directly, view it on GitHub
<#330 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABOE4CGSJN3ZGGR6TEI34QLVUNKPLANCNFSM52ZB2QJQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR makes
zi cd
with no arguments or with a-[[:digit:]]
argument jump to last Nth visited dir, e.g.: to the last one (most recent,-1
or no arguments), or to one before last (-2
given as argument, i.e.:zi cd -2
), and so on. This stack essentially works ascd -[[:digit:]]
except that the last dir on the stack is-1
, not-0
(i.e.: just like Zsh array indices).Description
The stack is set up on 1150 …1500 size varying between the two numbers (when 1500 is exceeded, 1150 is enforced). The code is pretty simple.
Motivation and Context
My completion got broken and I've couldn't complete plugin ids for
zi cd <TAB>
. I then thought that a stack of recent visited dirs withzi cd
can be a good alternative to automatic pids completion.PS. I've fixed my completion now :)
Related Issue(s)
Usage examples
How Has This Been Tested?
Types of changes
Checklist: