You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
3.5 KiB

  1. How to install
  2. --------------
  3. ### Using packages
  4. * Arch Linux: [community/zsh-syntax-highlighting][arch-package] / [AUR/zsh-syntax-highlighting-git][AUR-package]
  5. * Debian: `zsh-syntax-highlighting` package [in `stretch`][debian-package]
  6. * Gentoo: [mv overlay][gentoo-overlay]
  7. * Mac OS X / Homebrew: [brew install zsh-syntax-highlighting][brew-package]
  8. * Ubuntu: `zsh-syntax-highlighting` package [in Xenial][ubuntu-package]
  9. [arch-package]: https://www.archlinux.org/packages/zsh-syntax-highlighting
  10. [AUR-package]: https://aur.archlinux.org/packages/zsh-syntax-highlighting-git
  11. [debian-package]: https://packages.debian.org/zsh-syntax-highlighting
  12. [gentoo-overlay]: http://gpo.zugaina.org/app-shells/zsh-syntax-highlighting
  13. [brew-package]: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/zsh-syntax-highlighting.rb
  14. [ubuntu-package]: https://launchpad.net/ubuntu/+source/zsh-syntax-highlighting
  15. ### In your ~/.zshrc
  16. Simply clone this repository and source the script:
  17. git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
  18. echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
  19. Then, enable syntax highlighting in the current interactive shell:
  20. source ./zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
  21. If `git` is not installed, download and extract a snapshot of the latest
  22. development tree from:
  23. https://github.com/zsh-users/zsh-syntax-highlighting/archive/master.tar.gz
  24. Note the `source` command must be **at the end** of `~/.zshrc`.
  25. ### With a plugin manager
  26. Note that `zsh-syntax-highlighting` must be the last plugin sourced.
  27. The zsh-syntax-highlighting authors recommend manual installation over the use
  28. of a framework or plugin manager.
  29. This list is incomplete as there are too many [frameworks / plugin managers]
  30. (https://github.com/unixorn/awesome-zsh-plugins#frameworks) to list them all
  31. here.
  32. #### [Antigen](https://github.com/zsh-users/antigen)
  33. Add `antigen bundle zsh-users/zsh-syntax-highlighting` as the last bundle in
  34. your `.zshrc`.
  35. #### [Oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh)
  36. 1. Clone this repository in oh-my-zsh's plugins directory:
  37. git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
  38. 2. Activate the plugin in `~/.zshrc`:
  39. plugins=( [plugins...] zsh-syntax-highlighting)
  40. 3. Source `~/.zshrc` to take changes into account:
  41. source ~/.zshrc
  42. #### [Prezto](https://github.com/sorin-ionescu/prezto)
  43. Zsh-syntax-highlighting is included with Prezto. See the [Prezto documentation]
  44. (https://github.com/sorin-ionescu/prezto/tree/master/modules/syntax-highlighting)
  45. to enable and configure highlighters.
  46. #### [zgen](https://github.com/tarjoilija/zgen)
  47. Add `zgen load zsh-users/zsh-syntax-highlighting` to the end of your `.zshrc`.
  48. #### [zplug](https://github.com/zplug/zplug)
  49. Add `zplug "zsh-users/zsh-syntax-highlighting", nice:10` to your `.zshrc`.
  50. #### [zplugin](https://github.com/psprint/zplugin)
  51. Add `zplugin load zsh-users/zsh-syntax-highlighting` to the end of your
  52. `.zshrc`.
  53. ### System-wide installation
  54. Any of the above methods is suitable for a single-user installation,
  55. which requires no special privileges. If, however, you desire to install
  56. zsh-syntax-highlighting system-wide, you may do so by running
  57. make install
  58. and directing your users to add
  59. source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
  60. to their `.zshrc`s.