mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-04-17 11:35:32 +08:00
Update INSTALL.md
This commit is contained in:
parent
caa749d030
commit
c4e9a8033c
137
INSTALL.md
137
INSTALL.md
@ -1,20 +1,25 @@
|
|||||||
How to install
|
# Installation
|
||||||
--------------
|
|
||||||
|
|
||||||
### Using packages
|
* [Packages](#packages)
|
||||||
|
* [Antigen](#antigen)
|
||||||
|
* [Oh My Zsh](#oh-my-zsh)
|
||||||
|
* [Manual](#manual-git-clone)
|
||||||
|
* [Other](#other)
|
||||||
|
|
||||||
* Arch Linux: [community/zsh-syntax-highlighting][arch-package] / [AUR/zsh-syntax-highlighting-git][AUR-package]
|
## Packages
|
||||||
* 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])
|
| System | Package |
|
||||||
* FreeBSD: `pkg install zsh-syntax-highlighting` (port name: [`shells/zsh-syntax-highlighting`][freebsd-port])
|
| ------------- | ------------- |
|
||||||
* Gentoo: [app-shells/zsh-syntax-highlighting][gentoo-repository]
|
| Ubuntu | [zsh-syntax-highlighting OBS repository][obs-repository], [zsh-syntax-highlighting in Xenial][ubuntu-package] |
|
||||||
* Mac OS X / Homebrew: [brew install zsh-syntax-highlighting][brew-package]
|
| Debian | [zsh-syntax-highlighting OBS repository][obs-repository], [zsh-syntax-highlighting in Stretch][debian-package] |
|
||||||
* NetBSD: `pkg_add zsh-syntax-highlighting` (port name: [`shells/zsh-syntax-highlighting`][netbsd-port])
|
| Fedora / CentOS / RHEL / Scientific Linux | [zsh-syntax-highlighting OBS repository][obs-repository], [zsh-syntax-highlighting in Fedora 24+][fedora-package-alt] |
|
||||||
* OpenBSD: `pkg_add zsh-syntax-highlighting` (port name: [`shells/zsh-syntax-highlighting`][openbsd-port])
|
| Arch Linux / Manjaro / Antergos / Hyperbola | [zsh-syntax-highlighting][arch-package], [zsh-syntax-highlighting-git][AUR-package] |
|
||||||
* openSUSE / SLE: `zsh-syntax-highlighting` package in [OBS repository][obs-repository]
|
| OpenSUSE / SLE | [zsh-syntax-highlighting OBS repository][obs-repository] |
|
||||||
* RHEL / CentOS / Scientific Linux: `zsh-syntax-highlighting` package in [OBS repository][obs-repository]
|
| NetBSD / FreeBSD | [shells/zsh-syntax-highlighting][freebsd-port] |
|
||||||
* Ubuntu: `zsh-syntax-highlighting` package [in Xenial][ubuntu-package] (or in [OBS repository][obs-repository])
|
| OpenBSD | [shells/zsh-syntax-highlighting][openbsd-port] |
|
||||||
* Void Linux: `zsh-syntax-highlighting package` [in XBPS][void-package]
|
| 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
|
[arch-package]: https://www.archlinux.org/packages/zsh-syntax-highlighting
|
||||||
[AUR-package]: https://aur.archlinux.org/packages/zsh-syntax-highlighting-git
|
[AUR-package]: https://aur.archlinux.org/packages/zsh-syntax-highlighting-git
|
||||||
@ -32,50 +37,15 @@ How to install
|
|||||||
|
|
||||||
See also [repology's cross-distro index](https://repology.org/metapackage/zsh-syntax-highlighting/versions)
|
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
|
## Oh My 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
|
|
||||||
```
|
|
||||||
|
|
||||||
Then, enable syntax highlighting in the current interactive shell:
|
|
||||||
|
|
||||||
```zsh
|
|
||||||
source ./zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
|
||||||
```
|
|
||||||
|
|
||||||
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
|
|
||||||
```
|
|
||||||
|
|
||||||
Note the `source` command must be **at the end** of `~/.zshrc`.
|
|
||||||
|
|
||||||
|
|
||||||
### With a plugin manager
|
|
||||||
|
|
||||||
Note that `zsh-syntax-highlighting` must be the last plugin sourced.
|
|
||||||
|
|
||||||
The zsh-syntax-highlighting authors recommend manual installation over the use
|
|
||||||
of a framework or plugin manager.
|
|
||||||
|
|
||||||
This list is incomplete as there are too many
|
|
||||||
[frameworks / plugin managers][framework-list] to list them all here.
|
|
||||||
|
|
||||||
[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:
|
1. Clone this repository in oh-my-zsh's plugins directory:
|
||||||
|
|
||||||
@ -89,7 +59,41 @@ your `.zshrc`.
|
|||||||
plugins=( [plugins...] zsh-syntax-highlighting)
|
plugins=( [plugins...] zsh-syntax-highlighting)
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Restart zsh (such as by opening a new instance of your terminal emulator).
|
3. Start a new terminal session.
|
||||||
|
|
||||||
|
## Manual (Git Clone)
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
The zsh-syntax-highlighting authors recommend manual installation over the use
|
||||||
|
of a framework or plugin manager.
|
||||||
|
|
||||||
|
This list is incomplete as there are too many
|
||||||
|
[frameworks / plugin managers][framework-list] to list them all here.
|
||||||
|
|
||||||
|
[framework-list]: https://github.com/unixorn/awesome-zsh-plugins#frameworks
|
||||||
|
|
||||||
#### [Prezto](https://github.com/sorin-ionescu/prezto)
|
#### [Prezto](https://github.com/sorin-ionescu/prezto)
|
||||||
|
|
||||||
@ -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
|
Add `zplugin load zsh-users/zsh-syntax-highlighting` to the end of your
|
||||||
`.zshrc`.
|
`.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.
|
|
||||||
|
Loading…
Reference in New Issue
Block a user