Skip to content

Commit

Permalink
Add .plugin file and installation instructions for Oh My Zsh (sorin…
Browse files Browse the repository at this point in the history
  • Loading branch information
ericfreese committed Feb 7, 2016
1 parent 00bd0e9 commit 03bd381
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,21 @@ HEADER_FILES := \
LICENSE

PLUGIN_TARGET := zsh-autosuggestions.zsh
OH_MY_ZSH_LINK_TARGET := zsh-autosuggestions.plugin.zsh

ALL_TARGETS := \
$(PLUGIN_TARGET)
$(PLUGIN_TARGET) \
$(OH_MY_ZSH_LINK_TARGET)

all: $(ALL_TARGETS)

$(PLUGIN_TARGET): $(HEADER_FILES) $(SRC_FILES)
cat $(HEADER_FILES) | sed -e 's/^/# /g' >> $@
cat $(SRC_FILES) >> $@

$(OH_MY_ZSH_LINK_TARGET): $(PLUGIN_TARGET)
ln -s $(PLUGIN_TARGET) $@

.PHONY: clean
clean:
rm $(ALL_TARGETS)
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,23 @@ It suggests commands as you type, based on command history.
3. Start a new terminal session.


### Oh My Zsh

1. Clone this repository into `$ZSH_CUSTOM/plugins` (by default `~/.oh-my-zsh/custom/plugins`)

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

2. Add the plugin to the list of plugins for Oh My Zsh to load:

```sh
plugins=(zsh-autosuggestions)
```

3. Start a new terminal session.


## Usage

As you type commands, you will see a completion offered after the cursor in a muted gray color. This color can be changed by setting the `ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE` variable. See [configuration](#configuration).
Expand All @@ -37,6 +54,8 @@ If you invoke the `forward-word` widget, it will partially accept the suggestion

You may want to override the default global config variables after sourcing the plugin. Default values of these variables can be found [here](src/config.zsh).

**Note:** If you are using Oh My Zsh, you can put this configuration in a file in the `$ZSH_CUSTOM` directory. See their comments on [overriding internals](https://github.com/robbyrussell/oh-my-zsh/wiki/Customization#overriding-internals).


### Suggestion Highlight Style

Expand Down
1 change: 1 addition & 0 deletions zsh-autosuggestions.plugin.zsh

0 comments on commit 03bd381

Please sign in to comment.