[feat] zi cd with zero args or -[[:digit:]] argument will jump to the last N dir#330
Open
psprint wants to merge 2 commits intozdharma-continuum:mainfrom
Open
[feat] zi cd with zero args or -[[:digit:]] argument will jump to the last N dir#330psprint wants to merge 2 commits intozdharma-continuum:mainfrom
zi cd with zero args or -[[:digit:]] argument will jump to the last N dir#330psprint wants to merge 2 commits intozdharma-continuum:mainfrom
Conversation
vladdoster
approved these changes
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
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
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
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
Contributor
Author
|
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).
158fe11 to
fa45f91
Compare
Contributor
Author
|
I've done the comment update, after some fine tuning of it. |
Member
|
It seems reasonable to update _zinit to expose this feature. Thoughts? |
Contributor
Author
|
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:
***@***.***>
|
This file contains hidden or 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
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 cdwith no arguments or with a-[[:digit:]]argument jump to last Nth visited dir, e.g.: to the last one (most recent,-1or no arguments), or to one before last (-2given 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 cdcan 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: