1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2024-11-12 22:21:13 +00:00
prezto/modules/autosuggestions/init.zsh

36 lines
722 B
Bash
Raw Normal View History

2016-03-02 21:31:30 +00:00
#
# 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