Skip to content

Commit

Permalink
Merge pull request sorin-ionescu#35 from wgallios/master
Browse files Browse the repository at this point in the history
Created simple install sh script
  • Loading branch information
faceleg committed Dec 9, 2014
2 parents 7446059 + 9e71059 commit 1be4a54
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 20 deletions.
23 changes: 3 additions & 20 deletions README.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,9 @@
> [Fish](http://fishshell.com/)-like fast/unobtrusive autosuggestions for zsh.
## Installation

```sh
$ git clone git://github.com/tarruda/zsh-autosuggestions ~/.zsh-autosuggestions

$ 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

```
$ git clone git://github.com/wgallios/zsh-autosuggestions ~/.zsh-autosuggestions
sh .zsh-autosuggestions/install
```

Any widget that moves the cursor to the right(forward-word, forward-char...)
Expand Down
32 changes: 32 additions & 0 deletions install
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1be4a54

Please sign in to comment.