mirror of
https://github.com/dcarrillo/prezto.git
synced 2024-09-06 20:27:31 +00:00
36 lines
722 B
Bash
36 lines
722 B
Bash
|
#
|
||
|
# Integrates zsh-autosuggestions into Prezto.
|
||
|
#
|
||
|
# Authors:
|
||
|
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||
|
#
|
||
|
|
||
|
# Load dependencies.
|
||
|
pmodload 'editor'
|
||
|
|
||
|
# Source module files.
|
||
|
source "${0:h}/external/zsh-autosuggestions.zsh" || return 1
|
||
|
|
||
|
#
|
||
|
# Highlighting
|
||
|
#
|
||
|
|
||
|
# Set highlight color, default 'fg=8'.
|
||
|
zstyle -s ':prezto:module:autosuggestions:color' found \
|
||
|
'ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE' || ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=8'
|
||
|
|
||
|
# Disable highlighting.
|
||
|
if ! zstyle -t ':prezto:module:autosuggestions' color; then
|
||
|
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE=''
|
||
|
fi
|
||
|
|
||
|
#
|
||
|
# Key Bindings
|
||
|
#
|
||
|
|
||
|
if [[ -n "$key_info" ]]; then
|
||
|
# vi
|
||
|
bindkey -M viins "$key_info[Control]F" vi-forward-word
|
||
|
bindkey -M viins "$key_info[Control]E" vi-add-eol
|
||
|
fi
|