mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2024-11-18 09:51:06 +01:00
89b85d88cc
Fixed #38
32 lines
694 B
Bash
Executable file
32 lines
694 B
Bash
Executable file
#!/bin/sh
|
|
|
|
# Install script for zsh-autocomplete
|
|
|
|
#first checks if ~/.zshrc file exists and is readable
|
|
if [ ! -r ~/.zshrc ]; then
|
|
echo "\nError: ~/.zshrc file does not exist or is not readable!\n"
|
|
exit 1
|
|
fi
|
|
|
|
DIR=$(dirname $(readlink -f $0)) ;
|
|
|
|
# appends the string to ~/.zshrc file
|
|
cat >> ~/.zshrc << EOF
|
|
|
|
# Setup zsh-autosuggestions
|
|
source $DIR/autosuggestions.zsh
|
|
|
|
# Enable autosuggestions automatically
|
|
zle-line-init() {
|
|
zle autosuggest-start
|
|
}
|
|
|
|
zle -N zle-line-init
|
|
|
|
# use ctrl+t to toggle autosuggestions(hopefully this wont be needed as
|
|
# zsh-autosuggestions is designed to be unobtrusive)
|
|
bindkey '^T' autosuggest-toggle
|
|
EOF
|
|
|
|
echo "\nSetup completed successfully!\n"
|
|
exit 0
|