|
|
@ -1,20 +1,25 @@ |
|
|
|
How to install |
|
|
|
-------------- |
|
|
|
|
|
|
|
### Using packages |
|
|
|
|
|
|
|
* Arch Linux: [community/zsh-syntax-highlighting][arch-package] / [AUR/zsh-syntax-highlighting-git][AUR-package] |
|
|
|
* Debian: `zsh-syntax-highlighting` package [in `stretch`][debian-package] (or in [OBS repository][obs-repository]) |
|
|
|
* Fedora: [zsh-syntax-highlighting package][fedora-package-alt] in Fedora 24+ (or in [OBS repository][obs-repository]) |
|
|
|
* FreeBSD: `pkg install zsh-syntax-highlighting` (port name: [`shells/zsh-syntax-highlighting`][freebsd-port]) |
|
|
|
* Gentoo: [app-shells/zsh-syntax-highlighting][gentoo-repository] |
|
|
|
* Mac OS X / Homebrew: [brew install zsh-syntax-highlighting][brew-package] |
|
|
|
* NetBSD: `pkg_add zsh-syntax-highlighting` (port name: [`shells/zsh-syntax-highlighting`][netbsd-port]) |
|
|
|
* OpenBSD: `pkg_add zsh-syntax-highlighting` (port name: [`shells/zsh-syntax-highlighting`][openbsd-port]) |
|
|
|
* openSUSE / SLE: `zsh-syntax-highlighting` package in [OBS repository][obs-repository] |
|
|
|
* RHEL / CentOS / Scientific Linux: `zsh-syntax-highlighting` package in [OBS repository][obs-repository] |
|
|
|
* Ubuntu: `zsh-syntax-highlighting` package [in Xenial][ubuntu-package] (or in [OBS repository][obs-repository]) |
|
|
|
* Void Linux: `zsh-syntax-highlighting package` [in XBPS][void-package] |
|
|
|
# Installation |
|
|
|
|
|
|
|
* [Packages](#packages) |
|
|
|
* [Antigen](#antigen) |
|
|
|
* [Oh My Zsh](#oh-my-zsh) |
|
|
|
* [Manual](#manual-git-clone) |
|
|
|
* [Other](#other) |
|
|
|
|
|
|
|
## Packages |
|
|
|
|
|
|
|
| System | Package | |
|
|
|
| ------------- | ------------- | |
|
|
|
| Ubuntu | [zsh-syntax-highlighting OBS repository][obs-repository], [zsh-syntax-highlighting in Xenial][ubuntu-package] | |
|
|
|
| Debian | [zsh-syntax-highlighting OBS repository][obs-repository], [zsh-syntax-highlighting in Stretch][debian-package] | |
|
|
|
| Fedora / CentOS / RHEL / Scientific Linux | [zsh-syntax-highlighting OBS repository][obs-repository], [zsh-syntax-highlighting in Fedora 24+][fedora-package-alt] | |
|
|
|
| Arch Linux / Manjaro / Antergos / Hyperbola | [zsh-syntax-highlighting][arch-package], [zsh-syntax-highlighting-git][AUR-package] | |
|
|
|
| OpenSUSE / SLE | [zsh-syntax-highlighting OBS repository][obs-repository] | |
|
|
|
| NetBSD / FreeBSD | [shells/zsh-syntax-highlighting][freebsd-port] | |
|
|
|
| OpenBSD | [shells/zsh-syntax-highlighting][openbsd-port] | |
|
|
|
| Gentoo | [app-shells/zsh-syntax-highlighting][gentoo-repository] | |
|
|
|
| Void Linux | [zsh-syntax-highlighting in XBPS][void-package] | |
|
|
|
| Mac OS | [brew install zsh-syntax-highlighting][brew-package] | |
|
|
|
|
|
|
|
[arch-package]: https://www.archlinux.org/packages/zsh-syntax-highlighting |
|
|
|
[AUR-package]: https://aur.archlinux.org/packages/zsh-syntax-highlighting-git |
|
|
@ -32,33 +37,53 @@ How to install |
|
|
|
|
|
|
|
See also [repology's cross-distro index](https://repology.org/metapackage/zsh-syntax-highlighting/versions) |
|
|
|
|
|
|
|
## Antigen |
|
|
|
|
|
|
|
### In your ~/.zshrc |
|
|
|
1. Add the following to your `.zshrc`: |
|
|
|
|
|
|
|
Simply clone this repository and source the script: |
|
|
|
```sh |
|
|
|
antigen bundle zsh-users/zsh-syntax-highlighting |
|
|
|
``` |
|
|
|
|
|
|
|
```zsh |
|
|
|
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git |
|
|
|
echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc |
|
|
|
``` |
|
|
|
## Oh My Zsh |
|
|
|
|
|
|
|
Then, enable syntax highlighting in the current interactive shell: |
|
|
|
1. Clone this repository in oh-my-zsh's plugins directory: |
|
|
|
|
|
|
|
```zsh |
|
|
|
source ./zsh-syntax-highlighting/zsh-syntax-highlighting.zsh |
|
|
|
``` |
|
|
|
```zsh |
|
|
|
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting |
|
|
|
``` |
|
|
|
|
|
|
|
If `git` is not installed, download and extract a snapshot of the latest |
|
|
|
development tree from: |
|
|
|
2. Activate the plugin in `~/.zshrc`: |
|
|
|
|
|
|
|
``` |
|
|
|
https://github.com/zsh-users/zsh-syntax-highlighting/archive/master.tar.gz |
|
|
|
``` |
|
|
|
```zsh |
|
|
|
plugins=( [plugins...] zsh-syntax-highlighting) |
|
|
|
``` |
|
|
|
|
|
|
|
Note the `source` command must be **at the end** of `~/.zshrc`. |
|
|
|
3. Start a new terminal session. |
|
|
|
|
|
|
|
## Manual (Git Clone) |
|
|
|
|
|
|
|
### With a plugin manager |
|
|
|
1. Clone this repository and source the script: |
|
|
|
|
|
|
|
```sh |
|
|
|
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git |
|
|
|
echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc |
|
|
|
``` |
|
|
|
|
|
|
|
If `git` is not installed, download and extract a snapshot of the latest development tree from: |
|
|
|
``` |
|
|
|
https://github.com/zsh-users/zsh-syntax-highlighting/archive/master.tar.gz |
|
|
|
``` |
|
|
|
|
|
|
|
2. Enable syntax highlighting in the current interactive shell (add the following to **the end** of your `.zshrc`): |
|
|
|
|
|
|
|
```sh |
|
|
|
source ./zsh-syntax-highlighting/zsh-syntax-highlighting.zsh |
|
|
|
``` |
|
|
|
|
|
|
|
3. Start a new terminal session. |
|
|
|
|
|
|
|
## Other |
|
|
|
|
|
|
|
Note that `zsh-syntax-highlighting` must be the last plugin sourced. |
|
|
|
|
|
|
@ -70,27 +95,6 @@ This list is incomplete as there are too many |
|
|
|
|
|
|
|
[framework-list]: https://github.com/unixorn/awesome-zsh-plugins#frameworks |
|
|
|
|
|
|
|
#### [Antigen](https://github.com/zsh-users/antigen) |
|
|
|
|
|
|
|
Add `antigen bundle zsh-users/zsh-syntax-highlighting` as the last bundle in |
|
|
|
your `.zshrc`. |
|
|
|
|
|
|
|
#### [Oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) |
|
|
|
|
|
|
|
1. Clone this repository in oh-my-zsh's plugins directory: |
|
|
|
|
|
|
|
```zsh |
|
|
|
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting |
|
|
|
``` |
|
|
|
|
|
|
|
2. Activate the plugin in `~/.zshrc`: |
|
|
|
|
|
|
|
```zsh |
|
|
|
plugins=( [plugins...] zsh-syntax-highlighting) |
|
|
|
``` |
|
|
|
|
|
|
|
3. Restart zsh (such as by opening a new instance of your terminal emulator). |
|
|
|
|
|
|
|
#### [Prezto](https://github.com/sorin-ionescu/prezto) |
|
|
|
|
|
|
|
Zsh-syntax-highlighting is included with Prezto. See the |
|
|
@ -110,22 +114,3 @@ Add `zplug "zsh-users/zsh-syntax-highlighting", defer:2` to your `.zshrc`. |
|
|
|
|
|
|
|
Add `zplugin load zsh-users/zsh-syntax-highlighting` to the end of your |
|
|
|
`.zshrc`. |
|
|
|
|
|
|
|
|
|
|
|
### System-wide installation |
|
|
|
|
|
|
|
Any of the above methods is suitable for a single-user installation, |
|
|
|
which requires no special privileges. If, however, you desire to install |
|
|
|
zsh-syntax-highlighting system-wide, you may do so by running |
|
|
|
|
|
|
|
```zsh |
|
|
|
make install |
|
|
|
``` |
|
|
|
|
|
|
|
and directing your users to add |
|
|
|
|
|
|
|
```zsh |
|
|
|
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh |
|
|
|
``` |
|
|
|
|
|
|
|
to their `.zshrc`s. |