GithubHelp home page GithubHelp logo

Comments (3)

olets avatar olets commented on July 29, 2024

Let me know if these work for you. Works in my Ubuntu VM but it'd be nice to get that WSL2 confirmation before I add them to the README. h/t #20 for getting me started

# in .zshrc

typeset -A ZSH_HIGHLIGHT_REGEXP
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main regexp)
# the next two lines must come after zsh-abbr
ZSH_HIGHLIGHT_REGEXP=('^[[:blank:][:space:]]*('${(j:|:)${(k)ABBR_REGULAR_USER_ABBREVIATIONS}}')$' fg=blue)
ZSH_HIGHLIGHT_REGEXP+=('\<('${(j:|:)${(k)ABBR_GLOBAL_USER_ABBREVIATIONS}}')$' fg=yellow)
% abbr x=test
% abbr -g y=test
% x # should be blue
% <space>x # should be blue
% <tab>x # should be blue
% x; # should not color
% a x # should not color
%
x # should be blue (alt-enter for a line break)
% a
x # should not color
% y # should be yellow
% <space>y # should be yellow
% <tab>y # should be yellow
% y; # should not color
% a y # should be yellow
%
y # should be yellow (alt-enter for a line break)
% a
y # should be yellow

You can customize the fg= bits to meet your needs

from zsh-abbr.

Herjar avatar Herjar commented on July 29, 2024

It works great 🚀

Thank you!

from zsh-abbr.

olets avatar olets commented on July 29, 2024

This is now in the README!

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.