feat(revamp): add zsh and neovim configs, add an install script and a dependencies list
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
# Syntax Highlighting
|
||||
|
||||
Integrates [zsh-syntax-highlighting][1] into Prezto.
|
||||
|
||||
This module must be loaded _before_ the _`prompt`_ module.
|
||||
|
||||
If this module is used in conjunction with the [_`history-substring-search`_][2]
|
||||
module, this module must be loaded _before_ the _`history-substring-search`_
|
||||
module.
|
||||
|
||||
Additionally, if this module is used in conjunction with the
|
||||
[_`autosuggestions`_][3] module, this module must be loaded _before_ the
|
||||
_`autosuggestions`_ module as well.
|
||||
|
||||
To elaborate, the relative order of loading the modules would be
|
||||
_`syntax-highlighting`_, _`history-substring-search`_, _`autosuggestions`_ and
|
||||
_`prompt`_.
|
||||
|
||||
## Contributors
|
||||
|
||||
New features and bug fixes should be submitted to the
|
||||
[zsh-syntax-highlighting][1] project according to its rules and regulations.
|
||||
This module will be synchronized against it.
|
||||
|
||||
## Settings
|
||||
|
||||
### Highlighting
|
||||
|
||||
To enable highlighting for this module only, add the following line to
|
||||
_`${ZDOTDIR:-$HOME}/.zpreztorc`_:
|
||||
|
||||
```sh
|
||||
zstyle ':prezto:module:syntax-highlighting' color 'yes'
|
||||
```
|
||||
|
||||
### Highlighters
|
||||
|
||||
Syntax highlighting is accomplished by pluggable [highlighters][4]. This module
|
||||
only enables the _main_ highlighter by default.
|
||||
|
||||
To enable all highlighters, add the following to
|
||||
_`${ZDOTDIR:-$HOME}/.zpreztorc`_.
|
||||
|
||||
```sh
|
||||
zstyle ':prezto:module:syntax-highlighting' highlighters \
|
||||
'main' \
|
||||
'brackets' \
|
||||
'pattern' \
|
||||
'line' \
|
||||
'cursor' \
|
||||
'root'
|
||||
```
|
||||
|
||||
### Highlighting Styles
|
||||
|
||||
Each syntax highlighter defines styles used to highlight tokens.
|
||||
|
||||
To highlight, for example, builtins, commands, and functions in blue instead of
|
||||
green, add the following to _`${ZDOTDIR:-$HOME}/.zpreztorc`_:
|
||||
|
||||
```sh
|
||||
zstyle ':prezto:module:syntax-highlighting' styles \
|
||||
'builtin' 'bg=blue' \
|
||||
'command' 'bg=blue' \
|
||||
'function' 'bg=blue'
|
||||
```
|
||||
|
||||
## Authors
|
||||
|
||||
_The authors of this module should be contacted via the [issue tracker][5]._
|
||||
|
||||
- [Sorin Ionescu](https://github.com/sorin-ionescu)
|
||||
|
||||
[1]: https://github.com/zsh-users/zsh-syntax-highlighting
|
||||
[2]: ../history-substring-search#readme
|
||||
[3]: ../autosuggestions#readme
|
||||
[4]: https://github.com/zsh-users/zsh-syntax-highlighting/tree/master/highlighters
|
||||
[5]: https://github.com/sorin-ionescu/prezto/issues
|
||||
@@ -0,0 +1,36 @@
|
||||
#
|
||||
# Integrates zsh-syntax-highlighting into Prezto.
|
||||
#
|
||||
# Authors:
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
|
||||
# Return if requirements are not found.
|
||||
if ! zstyle -t ':prezto:module:syntax-highlighting' color; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Source module files.
|
||||
source "${0:h}/external/zsh-syntax-highlighting.zsh" || return 1
|
||||
|
||||
# Set highlighters.
|
||||
zstyle -a ':prezto:module:syntax-highlighting' highlighters 'ZSH_HIGHLIGHT_HIGHLIGHTERS'
|
||||
if (( ${#ZSH_HIGHLIGHT_HIGHLIGHTERS[@]} == 0 )); then
|
||||
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main)
|
||||
fi
|
||||
|
||||
# Set highlighting styles.
|
||||
typeset -A syntax_highlighting_styles
|
||||
zstyle -a ':prezto:module:syntax-highlighting' styles 'syntax_highlighting_styles'
|
||||
for syntax_highlighting_style in "${(k)syntax_highlighting_styles[@]}"; do
|
||||
ZSH_HIGHLIGHT_STYLES[$syntax_highlighting_style]="$syntax_highlighting_styles[$syntax_highlighting_style]"
|
||||
done
|
||||
unset syntax_highlighting_style{s,}
|
||||
|
||||
# Set pattern highlighting styles.
|
||||
typeset -A syntax_pattern_styles
|
||||
zstyle -a ':prezto:module:syntax-highlighting' pattern 'syntax_pattern_styles'
|
||||
for syntax_pattern_style in "${(k)syntax_pattern_styles[@]}"; do
|
||||
ZSH_HIGHLIGHT_PATTERNS[$syntax_pattern_style]="$syntax_pattern_styles[$syntax_pattern_style]"
|
||||
done
|
||||
unset syntax_pattern_style{s,}
|
||||
Reference in New Issue
Block a user