olets / zsh-autosuggestions-abbreviations-strategy

Have zsh-autosuggestions suggest your zsh-abbr abbreviations
MIT License
5 stars 0 forks source link
abbr abbreviations zsh zsh-abbr zsh-plugin

zsh-autosuggestions-abbreviations-strategy

Have zsh-autosuggestions suggest your zsh-abbr abbreviations.

Installation

Package

Homebrew

zsh-autosuggestions-abbreviations-strategy is available on Homebrew. Run

brew install olets/tap/zsh-autosuggestions-abbreviations-strategy

and follow the post-install instructions logged to the terminal.

Linux package repositories

If you know of a community member-create Linux package, please make a pull request to update this page!

Plugin

You can install zsh-autosuggestions-abbreviations-strategy with a zsh plugin manager. Each has their own way of doing things. Read your package manager's documentation or the zsh plugin manager plugin installation procedures gist; Fig users can install zsh-autosuggestions-abbreviations-strategy from its page in the Fig plugin directory

After adding the plugin to the manager, it will be available in all new terminals. To use it in an already-open terminal, restart zsh in that terminal:

exec zsh

Manual

Then add source path/to/zsh-autosuggestions-abbreviations-strategy.zsh to your .zshrc (replace path/to/ with the real path), and restart zsh:

exec zsh

Usage

  1. Install zsh-autosuggestions
  2. Install zsh-autosuggestions-abbreviations-strategy
  3. Configure zsh-autosuggestions's ZSH_AUTOSUGGEST_STRATEGY. Do one of:

    • Recommended. To suggest abbrevations before zsh-autosuggestions's default suggestions, append abbreviations:

      # .zshrc
      
      # load zsh-abbr
      # load zsh-autosuggestions
      # load zsh-autosuggestions-abbreviations-strategy
      ZSH_AUTOSUGGEST_STRATEGY=( abbreviations $ZSH_AUTOSUGGEST_STRATEGY )
    • Recommended. To suggest abbreviations along with other things, in the order of your choosing. I recommed putting abbreviations first. For example:

      # .zshrc
      
      # load zsh-abbr
      # load zsh-autosuggestions
      # load zsh-autosuggestions-abbreviations-strategy
      ZSH_AUTOSUGGEST_STRATEGY=( abbreviations strategy1 strategy2 )

      where the strategy* strategies are the strategies shipped with zsh-autosuggestions or provided by some other plugin you use.

    • To suggest abbreviations after zsh-autosuggestions's default suggestions, append abbreviations:

      # .zshrc
      
      # load zsh-abbr
      # load zsh-autosuggestions
      # load zsh-autosuggestions-abbreviations-strategy
      ZSH_AUTOSUGGEST_STRATEGY+=( abbreviations )
    • To only suggest abbreviations:

      # .zshrc
      
      # load zsh-abbr
      # load zsh-autosuggestions
      # load zsh-autosuggestions-abbreviations-strategy
      ZSH_AUTOSUGGEST_STRATEGY=( abbreviations )

Limitations

Matches in command position; global abbreviations are only matched in command position.

Exported values

ZSH_AUTOSUGGESTIONS_ABBREVIATIONS_STRATEGY_VERSION is the zsh-autosuggestions-abbreviations-strategy version number.

License

zsh-autosuggestions-abbreviations-strategy is licensed under MIT license. For the full text of the license, see the LICENSE file.

zsh-autosuggestions-abbreviations-strategy by Henry Bley-Vroman is released under the MIT license.

Acknowledgments

zsh-autosuggestions-abbreviations-strategy builds off zsh-autosuggestions.