zdharma-continuum / fast-syntax-highlighting

Feature-rich syntax highlighting for ZSH
BSD 3-Clause "New" or "Revised" License
1.06k stars 76 forks source link

[feat]: alias-proof syntax highlighting #62

Open GotaLoveFiraCode opened 6 months ago

GotaLoveFiraCode commented 6 months ago

If the feature request is for a plugin or theme, specify it here.

fast syntax highlighting

If the feature solves a problem you have, specify it here.

I use an alias for sudo: _. When I use this alias, the alias itself has highlighting, but everything after it doesn’t. Highlighting works fine for sudo. Example:

$ _ dnf update

_ is highlighted, dnf update is not.

$ sudo dnf update

sudo and dnf are highlighted green, update yellow (intended behavior).

Describe the proposed feature.

It would be awesome if fast-syntax-highlighting could interpret aliases, and one could achieve proper syntax highlighting despite using them.

Describe alternatives you've considered

No response

Additional context

fast-syntax-highlighting does manage to interpret aliases to a certain degree, the problem really does seem to be “nested” commands :) Love the plugin though!!! Keep up the good work!

2024-01-03T20:14:03,826227021+01:00 2024-01-03T20:14:09,925853723+01:00

Related Issues

No response

L0laapk3 commented 2 weeks ago

I also ran into this issue.

alias foo="noglob foo"
foo bar?

bar? will highlight blue.