diff --git a/plugins/zsh-patina/README.md b/plugins/zsh-patina/README.md new file mode 100644 index 000000000..ec383323c --- /dev/null +++ b/plugins/zsh-patina/README.md @@ -0,0 +1,27 @@ +# zsh-patina plugin + +Initializes [zsh-patina](https://github.com/michel-kraemer/zsh-patina), a +"blazingly fast Zsh plugin performing syntax highlighting of your command line +while you type 🌈" + +To use it, add `zsh-patina` to the plugins array in your `.zshrc` file: + +```zsh +plugins=(... zsh-patina) +``` + +zsh-patina replaces [zsh-syntax-highlighting](../zsh-syntax-highlighting), so +enable only one of them. If zsh-syntax-highlighting is in the plugins array or +already loaded, this plugin prints a warning and does not activate. + +## Binary location + +If `zsh-patina` is not in your `PATH` when Oh My Zsh loads (eg: it lives in +`~/.cargo/bin`), set `ZSH_PATINA_BINARY` to its full path before sourcing +Oh My Zsh: + +```zsh +ZSH_PATINA_BINARY=$HOME/.cargo/bin/zsh-patina +``` + +**Note:** you have to [install zsh-patina](https://github.com/michel-kraemer/zsh-patina#how-to-install) first. diff --git a/plugins/zsh-patina/zsh-patina.plugin.zsh b/plugins/zsh-patina/zsh-patina.plugin.zsh new file mode 100644 index 000000000..bc6259ab1 --- /dev/null +++ b/plugins/zsh-patina/zsh-patina.plugin.zsh @@ -0,0 +1,7 @@ +if (( $+ZSH_HIGHLIGHT_VERSION )) || (( ${plugins[(Ie)zsh-syntax-highlighting]} )); then + echo '[oh-my-zsh] zsh-patina conflicts with zsh-syntax-highlighting, please enable only one of them' +elif [[ -x ${ZSH_PATINA_BINARY:-$commands[zsh-patina]} ]]; then + eval "$(${ZSH_PATINA_BINARY:-$commands[zsh-patina]} activate)" +else + echo '[oh-my-zsh] zsh-patina not found, please install it from https://github.com/michel-kraemer/zsh-patina' +fi