GithubHelp home page GithubHelp logo

Autosuggestion for abbreviations about zsh-abbr HOT 2 CLOSED

olets avatar olets commented on July 29, 2024 1
Autosuggestion for abbreviations

from zsh-abbr.

Comments (2)

olets avatar olets commented on July 29, 2024

Hi thanks for the issue! It's different from #20 — what you want is sort of the opposite of what that user wanted.

zsh-autosuggestions suggests history items and commands. By definition abbreviations aren't commands, so that's out. You could add them to your history:

  1. Use the history or match_prev_cmd strategy (see https://github.com/zsh-users/zsh-autosuggestions#suggestion-strategy)
  2. Add to the history:
    • either: disable zsh-abbr, reload the terminal, run each abbreviation as a command, then enable zsh-abbr and reload the terminal
    • or: make sure you have a history file (echo $HISTFILE. if there isn't one, add [ -z "$HISTFILE" ] && HISTFILE="~/.zsh_history" to your .zshrc (use any path you like, but know that ~/.zsh_history is a standard choice)), then add your abbreviations to it:
      abbr list-abbreviations -U >> $HISTFILE
      

But that's not a real solution, because as you run other commands the abbreviation history entries could be deprioritized.

What you really need is for zsh-autosuggestions to support passing in a custom list of terms which would match before anything else. Pretty niche need but you could request the feature over at zsh-autosuggestions.

from zsh-abbr.

olets avatar olets commented on July 29, 2024

Closing because the change currently necessary is not to zsh-abbr, but do please let me know if you get this working!

from zsh-abbr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.