{"id":13587533,"url":"https://github.com/zdharma-continuum/fast-syntax-highlighting","last_synced_at":"2025-05-15T09:07:17.567Z","repository":{"id":38024093,"uuid":"422751197","full_name":"zdharma-continuum/fast-syntax-highlighting","owner":"zdharma-continuum","description":"Feature-rich syntax highlighting for ZSH","archived":false,"fork":false,"pushed_at":"2023-11-21T07:24:39.000Z","size":1384,"stargazers_count":1292,"open_issues_count":42,"forks_count":79,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-14T15:01:10.352Z","etag":null,"topics":["syntax-highlighting","zinit","zsh"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zdharma-continuum.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-10-30T01:03:05.000Z","updated_at":"2025-04-11T16:11:41.000Z","dependencies_parsed_at":"2024-01-03T04:16:59.247Z","dependency_job_id":"5ebfca75-8312-4cf4-8f5a-6d9a6ade6773","html_url":"https://github.com/zdharma-continuum/fast-syntax-highlighting","commit_stats":{"total_commits":871,"total_committers":29,"mean_commits":30.03448275862069,"dds":"0.10907003444316876","last_synced_commit":"5521b083f8979ad40be2137d7a46bfa51c8d666a"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zdharma-continuum%2Ffast-syntax-highlighting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zdharma-continuum%2Ffast-syntax-highlighting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zdharma-continuum%2Ffast-syntax-highlighting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zdharma-continuum%2Ffast-syntax-highlighting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zdharma-continuum","download_url":"https://codeload.github.com/zdharma-continuum/fast-syntax-highlighting/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254310515,"owners_count":22049469,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["syntax-highlighting","zinit","zsh"],"created_at":"2024-08-01T15:06:15.330Z","updated_at":"2025-05-15T09:07:12.547Z","avatar_url":"https://github.com/zdharma-continuum.png","language":"Shell","funding_links":[],"categories":["Plugins","Shell","shell"],"sub_categories":["ZSH on Windows"],"readme":"# Fast Syntax Highlighting (F-Sy-H) [![Gitter][gitter-image]][gitter-link]\n\nFeature rich syntax highlighting for Zsh.\n\n\u003cdiv style=\"width:100%;background-color:black;border:3px solid black;border-radius:6px;margin:5px 0;padding:2px 5px\"\u003e\n  \u003cimg\n    src=\"https://raw.githubusercontent.com/zdharma-continuum/fast-syntax-highlighting/master/images/highlight-much.png\"\n    alt=\"image could not be loaded\"\n    style=\"color:red;background-color:black;font-weight:bold\"\n  /\u003e\n\u003c/div\u003e\n\n### Table of Contents\n\n- [News](#news)\n- [Installation](#installation)\n- [Features](#features)\n- [Performance](#performance)\n\n### Other Contents\n\n- [License](https://github.com/zdharma-continuum/fast-syntax-highlighting/blob/master/LICENSE)\n- [Changelog](https://github.com/zdharma-continuum/fast-syntax-highlighting/blob/master/CHANGELOG.md)\n- [Theme Guide](https://github.com/zdharma-continuum/fast-syntax-highlighting/blob/master/THEME_GUIDE.md)\n- [Chroma Guide](https://github.com/zdharma-continuum/fast-syntax-highlighting/blob/master/CHROMA_GUIDE.adoc)\n\n# News\n\n- 15-06-2019\n  - A new architecture for defining the highlighting for **specific commands**: it now uses **abstract definitions**\n    instead of **top-down, regular code**. The first effect is the highlighting for the `git` command it is now\n    **maximally faithful**, it follows the `git` command almost completely. [Screencast](https://asciinema.org/a/253411)\n\n# Installation\n\n### Manual\n\nClone the Repository.\n\n```zsh\ngit clone https://github.com/zdharma-continuum/fast-syntax-highlighting ~/path/to/fsh\n```\n\nAnd add the following to your `zshrc` file.\n\n```zsh\nsource ~/path/to/fsh/fast-syntax-highlighting.plugin.zsh\n```\n\n### Zinit\n\nAdd the following to your `zshrc` file.\n\n```zsh\nzinit light zdharma-continuum/fast-syntax-highlighting\n```\n\nHere's an example of how to load the plugin together with a few other popular ones with the use of\n[Turbo](https://zdharma-continuum.org/zinit/wiki/INTRODUCTION/#turbo_mode_zsh_62_53), i.e.: speeding up the Zsh startup\nby loading the plugin right after the first prompt, in background:\n\n```zsh\nzinit wait lucid for \\\n atinit\"ZINIT[COMPINIT_OPTS]=-C; zicompinit; zicdreplay\" \\\n    zdharma-continuum/fast-syntax-highlighting \\\n blockf \\\n    zsh-users/zsh-completions \\\n atload\"!_zsh_autosuggest_start\" \\\n    zsh-users/zsh-autosuggestions\n```\n\n### Antigen\n\nAdd the following to your `zshrc` file.\n\n```zsh\nantigen bundle zdharma-continuum/fast-syntax-highlighting\n```\n\n### Fig\n\n[Fig](https://fig.io) adds apps, shortcuts, and autocomplete to your existing terminal.\n\nInstall `fast-syntax-highlighting` in just one click.\n\n\u003ca href=\"https://fig.io/plugins/other/fast-syntax-highlighting_zdharma-continuum\" target=\"_blank\"\u003e\u003cimg src=\"https://fig.io/badges/install-with-fig.svg\" /\u003e\u003c/a\u003e\n\n\n### Zgen\n\nAdd the following to your `.zshrc` file in the same place you're doing your other `zgen load` calls in.\n\n```zsh\nzgen load zdharma-continuum/fast-syntax-highlighting\n```\n\n### Oh-My-Zsh\n\nClone the Repository.\n\n```zsh\ngit clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git \\\n  ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/fast-syntax-highlighting\n```\n\nAnd add `fast-syntax-highlighting` to your plugin list.\n\n# Features\n\n### Themes\n\nSwitch themes via `fast-theme {theme-name}`.\n\n\u003cdiv style=\"width:100%;background-color:black;border:3px solid black;border-radius:6px;margin:5px 0;padding:2px 5px\"\u003e\n  \u003cimg\n    src=\"https://raw.githubusercontent.com/zdharma-continuum/fast-syntax-highlighting/master/images/theme.png\"\n    alt=\"image could not be loaded\"\n    style=\"color:red;background-color:black;font-weight:bold\"\n  /\u003e\n\u003c/div\u003e\n\nRun `fast-theme -t {theme-name}` option to obtain the snippet above.\n\nRun `fast-theme -l` to list available themes.\n\n### Variables\n\nComparing to the project `zsh-users/zsh-syntax-highlighting` (the upper line):\n\n\u003cdiv style=\"width:100%;background-color:black;border:3px solid black;border-radius:6px;margin:5px 0;padding:2px 5px\"\u003e\n  \u003cimg\n    src=\"https://raw.githubusercontent.com/zdharma-continuum/fast-syntax-highlighting/master/images/parameter.png\"\n    alt=\"image could not be loaded\"\n    style=\"color:red;background-color:black;font-weight:bold\"\n  /\u003e\n\u003c/div\u003e\n\n\u003cdiv style=\"width:100%;background-color:black;border:3px solid black;border-radius:6px;margin:5px 0;padding:2px 5px\"\u003e\n  \u003cimg\n    src=\"https://raw.githubusercontent.com/zdharma-continuum/fast-syntax-highlighting/master/images/in_string.png\"\n    alt=\"image could not be loaded\"\n    style=\"color:red;background-color:black;font-weight:bold\"\n  /\u003e\n\u003c/div\u003e\n\n### Brackets\n\n\u003cdiv style=\"width:100%;background-color:black;border:3px solid black;border-radius:6px;margin:5px 0;padding:2px 5px\"\u003e\n  \u003cimg\n    src=\"https://raw.githubusercontent.com/zdharma-continuum/fast-syntax-highlighting/master/images/brackets.gif\"\n    alt=\"image could not be loaded\"\n    style=\"color:red;background-color:black;font-weight:bold\"\n  /\u003e\n\u003c/div\u003e\n\n### Conditions\n\nComparing to the project `zsh-users/zsh-syntax-highlighting` (the upper line):\n\n\u003cdiv style=\"width:100%;background-color:black;border:3px solid black;border-radius:6px;margin:5px 0;padding:2px 5px\"\u003e\n  \u003cimg\n    src=\"https://raw.githubusercontent.com/zdharma-continuum/fast-syntax-highlighting/master/images/cplx_cond.png\"\n    alt=\"image could not be loaded\"\n    style=\"color:red;background-color:black;font-weight:bold\"\n  /\u003e\n\u003c/div\u003e\n\n### Strings\n\nExact highlighting that recognizes quotings.\n\n\u003cdiv style=\"width:100%;background-color:black;border:3px solid black;border-radius:6px;margin:5px 0;padding:2px 5px\"\u003e\n  \u003cimg\n    src=\"https://raw.githubusercontent.com/zdharma-continuum/fast-syntax-highlighting/master/images/ideal-string.png\"\n    alt=\"image could not be loaded\"\n    style=\"color:red;background-color:black;font-weight:bold\"\n  /\u003e\n\u003c/div\u003e\n\n### here-strings\n\n\u003cdiv style=\"width:100%;background-color:black;border:3px solid black;border-radius:6px;margin:5px 0;padding:2px 5px\"\u003e\n  \u003cimg\n    src=\"https://raw.githubusercontent.com/zdharma-continuum/fast-syntax-highlighting/master/images/herestring.png\"\n    alt=\"image could not be loaded\"\n    style=\"color:red;background-color:black;font-weight:bold\"\n  /\u003e\n\u003c/div\u003e\n\n### `exec` descriptor-variables\n\nComparing to the project `zsh-users/zsh-syntax-highlighting` (the upper line):\n\n\u003cdiv style=\"width:100%;background-color:black;border:3px solid black;border-radius:6px;margin:5px 0;padding:2px 5px\"\u003e\n  \u003cimg\n    src=\"https://raw.githubusercontent.com/zdharma-continuum/fast-syntax-highlighting/master/images/execfd_cmp.png\"\n    alt=\"image could not be loaded\"\n    style=\"color:red;background-color:black;font-weight:bold\"\n  /\u003e\n\u003c/div\u003e\n\n### for-loops and alternate syntax (brace `{`/`}` blocks)\n\n\u003cdiv style=\"width:100%;background-color:black;border:3px solid black;border-radius:6px;margin:5px 0;padding:2px 5px\"\u003e\n  \u003cimg\n    src=\"https://raw.githubusercontent.com/zdharma-continuum/fast-syntax-highlighting/master/images/for-loop-cmp.png\"\n    alt=\"image could not be loaded\"\n    style=\"color:red;background-color:black;font-weight:bold\"\n  /\u003e\n\u003c/div\u003e\n\n### Function definitions\n\nComparing to the project `zsh-users/zsh-syntax-highlighting` (the upper 2 lines):\n\n\u003cdiv style=\"width:100%;background-color:black;border:3px solid black;border-radius:6px;margin:5px 0;padding:2px 5px\"\u003e\n  \u003cimg\n    src=\"https://raw.githubusercontent.com/zdharma-continuum/fast-syntax-highlighting/master/images/function.png\"\n    alt=\"image could not be loaded\"\n    style=\"color:red;background-color:black;font-weight:bold\"\n  /\u003e\n\u003c/div\u003e\n\n### Recursive `eval` and `$( )` highlighting\n\nComparing to the project `zsh-users/zsh-syntax-highlighting` (the upper line):\n\n\u003cdiv style=\"width:100%;background-color:black;border:3px solid black;border-radius:6px;margin:5px 0;padding:2px 5px\"\u003e\n  \u003cimg\n    src=\"https://raw.githubusercontent.com/zdharma-continuum/fast-syntax-highlighting/master/images/eval_cmp.png\"\n    alt=\"image could not be loaded\"\n    style=\"color:red;background-color:black;font-weight:bold\"\n  /\u003e\n\u003c/div\u003e\n\n### Chroma functions\n\nHighlighting that is specific for a given command.\n\n\u003cdiv style=\"width:100%;background-color:black;border:3px solid black;border-radius:6px;margin:5px 0;padding:2px 5px\"\u003e\n  \u003cimg\n    src=\"https://raw.githubusercontent.com/zdharma-continuum/fast-syntax-highlighting/master/images/git_chroma.png\"\n    alt=\"image could not be loaded\"\n    style=\"color:red;background-color:black;font-weight:bold\"\n  /\u003e\n\u003c/div\u003e\n\nThe [chromas](https://github.com/zdharma-continuum/fast-syntax-highlighting/tree/master/%E2%86%92chroma) that are\nenabled by default can be found\n[here](https://github.com/zdharma-continuum/fast-syntax-highlighting/blob/master/fast-highlight#L166).\n\n### Math-mode highlighting\n\n\u003cdiv style=\"width:100%;background-color:black;border:3px solid black;border-radius:6px;margin:5px 0;padding:2px 5px\"\u003e\n  \u003cimg\n    src=\"https://raw.githubusercontent.com/zdharma-continuum/fast-syntax-highlighting/master/images/math.gif\"\n    alt=\"image could not be loaded\"\n    style=\"color:red;background-color:black;font-weight:bold\"\n  /\u003e\n\u003c/div\u003e\n\n### Zcalc highlighting\n\n\u003cdiv style=\"width:100%;background-color:black;border:3px solid black;border-radius:6px;margin:5px 0;padding:2px 5px\"\u003e\n  \u003cimg\n    src=\"https://raw.githubusercontent.com/zdharma-continuum/fast-syntax-highlighting/master/images/zcalc.png\"\n    alt=\"image could not be loaded\"\n    style=\"color:red;background-color:black;font-weight:bold\"\n  /\u003e\n\u003c/div\u003e\n\n# Performance\n\nPerformance differences can be observed in this Asciinema recording, where a `10 kB` function is being edited.\n\n\u003cdiv style=\"width:100%;background-color:#121314;border:3px solid #121314;border-radius:6px;margin:5px 0;padding:2px 5px\"\u003e\n  \u003ca href=\"https://asciinema.org/a/112367\"\u003e\n    \u003cimg src=\"https://asciinema.org/a/112367.png\" alt=\"asciicast\"\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n[gitter-image]: https://badges.gitter.im/zdharma-continuum/community.svg\n[gitter-link]: https://gitter.im/zdharma-continuum/community\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzdharma-continuum%2Ffast-syntax-highlighting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzdharma-continuum%2Ffast-syntax-highlighting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzdharma-continuum%2Ffast-syntax-highlighting/lists"}