olets / zsh-abbr

The zsh manager for auto-expanding abbreviations, inspired by fish. ~13,000 unique cloners as of May '24, 580+ Homebrew installs 6/23-6/24
https://zsh-abbr.olets.dev
Other
511 stars 18 forks source link

Conflict warning logged in all new sessions when adding an abbreviation in zshrc #96

Closed martino2002 closed 1 year ago

martino2002 commented 1 year ago

Is there an existing issue for this?

Update the issue title

Expected Behavior

I have only one abbreviation, since I discovered this software just yesterday, I added these two lines in my .zshrc source /home/linuxbrew/.linuxbrew/share/zsh-abbr/zsh-abbr.zsh, as indicated in the installation guide, and abbr vid="vim ~/.local/share/applications/"

It works, but I would expect it to simply work without complaining, since I don't have anything else that could conflict with the abbreviation.

Actual Behavior

And yet, it complains, as you might had guessed. The error message is: Did not add the regular user abbreviation vid. It already has an expansion (and yet it was added, because it works)

What could be the problem?

Steps To Reproduce

Added this abbreviation to .zshrc abbr vid="vim ~/.local/share/applications/"

Environment

zsh-abbr version 5.1.0
zsh 5.9 (x86_64-pc-linux-gnu)
OSTYPE linux-gnu

Installation method

Homebrew

Installation method details

Added this to bottom of .zshrc as indicated in installation guide: source /home/linuxbrew/.linuxbrew/share/zsh-abbr/zsh-abbr.zsh

Anything else?

No response

olets commented 1 year ago

The fix is to remove

abbr vid="vim ~/.local/share/applications/"

from .zshrc. That will clear the error, and won't remove the abbreviation.

Everything in .zshrc is run every time you open a new terminal. So you're rerunning your abbr command every time you open a new terminal.

Typical use is to run abbr commands in a terminal (not in a configuration file).

Let me know if that doesn't resolve it. Hope abbr turns out to be useful for you!