Merge pull request #35 from wgallios/master

Created simple install sh script
This commit is contained in:
Michael Robinson 2014-12-09 15:52:38 +13:00
commit 1be4a54048
2 changed files with 35 additions and 20 deletions

View file

@ -3,26 +3,9 @@
> [Fish](http://fishshell.com/)-like fast/unobtrusive autosuggestions for zsh. > [Fish](http://fishshell.com/)-like fast/unobtrusive autosuggestions for zsh.
## Installation ## Installation
```
```sh $ git clone git://github.com/wgallios/zsh-autosuggestions ~/.zsh-autosuggestions
$ git clone git://github.com/tarruda/zsh-autosuggestions ~/.zsh-autosuggestions sh .zsh-autosuggestions/install
$ cat >> ~/.zshrc << "EOF"
# Setup zsh-autosuggestions
source ~/.zsh-autosuggestions/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
``` ```
Any widget that moves the cursor to the right(forward-word, forward-char...) Any widget that moves the cursor to the right(forward-word, forward-char...)

32
install Executable file
View file

@ -0,0 +1,32 @@
#!/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 -e $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