From 03bd381112f3919e93b2c2c2ceb1c7b062347225 Mon Sep 17 00:00:00 2001 From: Eric Freese Date: Sun, 7 Feb 2016 14:18:49 -0700 Subject: [PATCH] Add `.plugin` file and installation instructions for Oh My Zsh (#104). --- Makefile | 7 ++++++- README.md | 19 +++++++++++++++++++ zsh-autosuggestions.plugin.zsh | 1 + 3 files changed, 26 insertions(+), 1 deletion(-) create mode 120000 zsh-autosuggestions.plugin.zsh diff --git a/Makefile b/Makefile index 7533d37..f66408f 100644 --- a/Makefile +++ b/Makefile @@ -17,9 +17,11 @@ 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) @@ -27,6 +29,9 @@ $(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) diff --git a/README.md b/README.md index 6159c7f..234a782 100644 --- a/README.md +++ b/README.md @@ -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). @@ -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 diff --git a/zsh-autosuggestions.plugin.zsh b/zsh-autosuggestions.plugin.zsh new file mode 120000 index 0000000..e41b4f7 --- /dev/null +++ b/zsh-autosuggestions.plugin.zsh @@ -0,0 +1 @@ +zsh-autosuggestions.zsh \ No newline at end of file