Added ideal string highlighting – f-sy-h now handles any legal quoting and combination of "
,'
and \
when
highlighting program arguments. See the introduction for an example (item #14).
Global aliases are now supported:
Hint – how to customize styles when using Zplugin and turbo mode:
zplugin ice wait"1" atload"set_fast_theme"
zplugin light zdharma/fast-syntax-highlighting
set_fast_theme() {
FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}paired-bracket]='bg=blue'
FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}bracket-level-1]='fg=red,bold'
FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}bracket-level-2]='fg=magenta,bold'
FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}bracket-level-3]='fg=cyan,bold'
}
If you have set theme before an update of styles (e.g. recent addition of bracket highlighting)
then please repeat fast-theme {theme}
call to regenerate theme files. (2018-08-09: f-sy-h
now has full user-theme support, refer to appropriate section of README).
Ideal highlighting of brackets (pairing, etc.) – no quoting can disturb the result:
FAST_HIGHLIGHT[use_brackets]=1
to enable this feature (2018-07-31: not needed anymore, this highlighting is active by default).
Chroma architecture now supports aliases. You can have alias mygit="git commit"
and when mygit
will be invoked everything will work as expected (Git chroma will be ran).
There were problems with Ctrl-C not working when using f-sy-h. After many days I've found a fix for this, it's pushed to main.
Second, asynchronous path checking (useful on e.g. slow network drives, or when there are many files in directory)
is now optional. Set FAST_HIGHLIGHT[use_async]=1
to enable it. This saves some users from Zshell crashes
– there's an unknown bug in Zsh.
New chroma functions: awk
, make
, perl
, vim
. Checkout the video,
it shows functionality of awk
– compiling of code and NOT running it. Perl can do this too:
video.
f-sy-h gained a new architecture – "chroma functions". They are similar to "completion functions", i.e. they
are defined per-command, but instead of completing that command, they colorize it. Two chroma exist,
for Git
(video, video) and for grep
(video). Checkout
example chroma if you
would like to highlight a command.
Highlighting of command substitution (i.e. $(...)
) with alternate theme – two themes at once! It was just white before:
To select which theme to use for $(...)
set the key secondary=
in theme ini file.
All shipped themes have this key set (only the default
theme doesn't use second theme).
Also added correct highlighting of descriptor-variables passed to exec
:
For-loop is highlighted, it has separate settings in theme file.
Added support for 256-color themes. There are six themes shipped with f-sy-h. The command to
switch theme is fast-theme {theme-name}
, it has a completion which lists available themes
and options. Checkout asciinema recording that presents
the themes.
Hash holding paths that shouldn't be grepped (globbed) – blacklist for slow disks, mounts, etc.:
typeset -gA FAST_BLIST_PATTERNS
FAST_BLIST_PATTERNS[/mount/nfs1/*]=1
FAST_BLIST_PATTERNS[/mount/disk2/*]=1
Assign colorizing now spans to variables defined by typeset
, export
, local
, etc.:
Also, zcalc
has a separate math mode and specialized highlighting – no more light-red colors because of
treating zcalc
like a regular command-line:
Array assignments were still boring, so I throwed in bracked colorizing:
Assignments are no more one-colour default-white. When used in assignment, highlighted are:
- variables (outside strings),
- strings (double-quoted and single-quoted),
- math-mode (
val=$(( ... ))
).
Math mode is highlighted – expressions (( ... ))
and $(( ... ))
. Empty variables are colorized as red.
There are 3 style names (fields of
FAST_HIGHLIGHT_STYLES
hash) for math-variable, number and empty variable (error): mathvar
, mathnum
, matherr
. You can set
them (like the animation below shows) to change colors.