1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2024-11-20 10:51:13 +00:00
prezto/modules/autosuggestions/init.zsh
2016-03-02 16:31:33 -05:00

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