This can/should co-exist with alias-tips #51
-
That would be awesome if we can skip
edit from olets: Note Answered at #51 (comment) |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 6 replies
-
Thanks for the idea! alias-tips has an excludes array (https://github.com/djui/alias-tips#exclude-some-aliases). If for every abbreviation you have an alias with the same short form (for example, export ZSH_PLUGINS_ALIAS_TIPS_EXCLUDES="${(f)$(abbr l)}" (that is, a single string from export ZSH_PLUGINS_ALIAS_TIPS_EXCLUDES="myalias ${(f)$(abbr l)}" After adding a new abbreviation, open a new terminal and/or refresh open terminals ( Does that meet your need? |
Beta Was this translation helpful? Give feedback.
-
Yes, that's exactly what I needed! Feeling stupid, didn't figure out myself! |
Beta Was this translation helpful? Give feedback.
-
Also, a 2nd thought, we should auto sync |
Beta Was this translation helpful? Give feedback.
-
I've chosen to not support auto syncing because it would require letting abbr write and possibly first parse You could do something like
Putting it at the very end of your // Another approach: run abbr import-aliases once and then delete as many aliases as possible. That's my personal recommendation. It would probably even obviate your alias-tips problem. If you decide to switch back to aliases, run |
Beta Was this translation helpful? Give feedback.
-
I understand both the workarounds you proposed! Someone might want to use both What I suggest is
Let me know if that makes sense, I can add a PR, or we can discuss in more details about the implementation! |
Beta Was this translation helpful? Give feedback.
-
Interesting idea! For now, it doesn't feel to me like syncing abbreviations and aliases is something zsh-abbr should take on — it's sort of a meta responsibility. But let's keep thinking it through. //
Now and then I consider making a "delete all abbreviations" function… But I'm afraid if it existed I'd run it by mistake! The easiest way to roll your own will be echo > $ABBR_USER_ABBREVIATIONS_FILE
abbr load
I'm not aware of a way to do this, but sounds cool. Are you? // What if you invert my previous idea, letting aliases be the source of truth # .zshrc
source .zsh-aliases
# load zsh-abbr and then
abbr import-aliases --quiet and to add an alias and an abbreviation use % echo alias x=y > .zsh-aliases && exec zsh (Could make a function for that, and |
Beta Was this translation helpful? Give feedback.
-
I stumbled upon this on my search to see if this plugin supports abbreviation hints like alias-tips does. I.e., I write the full command but there already exists an abbreviation for it. So the plugin shows me at the end of the output the abbreviation I could have used. |
Beta Was this translation helpful? Give feedback.
Thanks for the idea!
alias-tips has an excludes array (https://github.com/djui/alias-tips#exclude-some-aliases). If for every abbreviation you have an alias with the same short form (for example,
alias x="my command"
andabbr x="my command"
) then adding this snippet to your.zshrc
should automatically exclude all abbreviations when the shell initializes:(that is, a single string from
abbr l
's multi-line output). If you're already excluding things,After adding a new abbreviation, open a new terminal and/or refresh open terminals (
source ~/.zshrc
or, preferably,exec zsh
…