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
510 stars 18 forks source link

Cannot use scopes #61

Closed wookayin closed 1 year ago

wookayin commented 1 year ago

What is the exact syntax for scopes?

The documentation says

abbr [<SCOPE>] [<TYPE>] <COMMAND> [<ARGS>]

and I tried the following:

❯❯❯ abbr -S session add  v=vim 
abbr add: Expected one argument, got 2: add v=vim
❯❯❯ abbr session add  v=vim
abbr add: Expected one argument, got 2: add v=vim
❯❯❯ abbr -S session add  
abbr add: Requires abbreviation and expansion
❯❯❯ abbr -S session add v vim
abbr add: Expected one argument, got 3: add v vim

None of these works, so I think this could be simply a bug.

wookayin commented 1 year ago

Figured out:

❯❯❯ abbr --session v=vim 

-S stands for --session, not --scope. It was a bit confusing, perhaps the documentation could be improved.

olets commented 1 year ago

Glad you figured it out! You can also leave off add: abbr -S v=vim.

Thanks for the feedback. There's a documentation rewrite in the works, I'll take this into account. I want to make sure I'm understanding which part of the documentation you're referring to. It's what's confusing the add line

To add a session abbreviation, use the --session or -S scope flag. Otherwise, or if the --user or -U scope flag is used, the new abbreviation will be available to all sessions.

(and the equivalent documentation in other abbr commands)?