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

abbr c does not clear abbreviations created with the pattern abbr x=y #88

Closed
2 tasks done
metruzanca opened this issue Apr 19, 2023 · 3 comments
Closed
2 tasks done
Labels
invalid This doesn't seem right

Comments

@metruzanca
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Update the issue title

  • I have updated the title

Expected Behavior

When running abbr c / abbr clear-session I'm expecting all abbr to be wiped. My use case being to run abbr c; abbr import-aliases to get rid of old and add new aliases to abbr.

Actual Behavior

Screenshot 2023-04-19 at 11 59 47 AM

All other commands seem to work fine. The actual plugin works as expected, its just deleting the abbr which is tedious. I can delete with abbr erase <name>, just not abbr c.

Steps To Reproduce

Basic zsh install (no oh-my-zsh) w/ Zplug as the plugin manager running on MacOS ventura.

Environment

zsh-abbr version 5.0.1
zsh 5.9 (arm-apple-darwin22.1.0)
OSTYPE darwin22.0

Installation method

Other

Installation method details

brew tap "olets/tap"
brew install zplug olets/tap/zsh-abbr # & zsh of course

ZPlug setup

#!/usr/bin/env zsh
# as a part of your dotfiles setup/linking/stowing script
source /opt/homebrew/opt/zplug/init.zsh;
zplug "olets/zsh-abbr";
zplug install;
# .zshrc
source /opt/homebrew/opt/zplug/init.zsh;
zplug "olets/zsh-abbr";
zplug load;

Anything else?

No response

@olets
Copy link
Owner

olets commented Apr 21, 2023

clear-session clears all session abbreviations https://zsh-abbr.olets.dev/scopes.html#session (closing the terminal, or restarting zsh exec zsh does too)

If session abbreviations work for you, import aliases with abbr -S import-aliases. Then abbr c will clear them.

If you want to clear all user abbreviations, two good (though destructive) options are to delete everything from $ABBR_USER_ABBREVIATIONS_FILE

echo > $ABBR_USER_ABBREVIATIONS_FILE

or to delete the file

rm $ABBR_USER_ABBREVIATIONS_FILE
# or, if you want to be able to recover the file, use https://github.com/sindresorhus/trash-cli

@olets olets added invalid This doesn't seem right and removed needs triage labels Apr 23, 2023
@olets olets changed the title [Bug report] abbr c not working as expected abbr c does not clear abbreviations created with the pattern abbr x=y Apr 23, 2023
@olets
Copy link
Owner

olets commented Apr 23, 2023

I'm taking that reaction as good news that this solved your issue. I updated the title to be more specific now that we know what the problem was. Thanks for bringing this up!

@olets olets closed this as completed Apr 23, 2023
@metruzanca
Copy link
Author

Yes sorry I forgot to finish my reply. This was exactly what i wanted. I'm moving my setup to use sessions now.

Thanks for the great reply and thanks for the great plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants