From aa81de0ba16fc0730dfd47fad833e6cb39ef9835 Mon Sep 17 00:00:00 2001 From: Jan Schmidle Date: Sun, 9 Mar 2014 16:44:52 +0100 Subject: [PATCH 1/4] restructure to make it work with antigen --- autosuggestions.zsh | 2 +- completion-client.zsh => lib/completion-client.zsh | 2 +- completion-server-init.zsh => lib/completion-server-init.zsh | 0 completion-server.zsh => lib/completion-server.zsh | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename completion-client.zsh => lib/completion-client.zsh (93%) rename completion-server-init.zsh => lib/completion-server-init.zsh (100%) rename completion-server.zsh => lib/completion-server.zsh (97%) diff --git a/autosuggestions.zsh b/autosuggestions.zsh index 34d482a..8ef4168 100644 --- a/autosuggestions.zsh +++ b/autosuggestions.zsh @@ -9,7 +9,7 @@ # ``` zmodload zsh/net/socket -source "${0:a:h}/completion-client.zsh" +source "${0:a:h}/lib/completion-client.zsh" # configuration variables AUTOSUGGESTION_HIGHLIGHT_COLOR='fg=8' diff --git a/completion-client.zsh b/lib/completion-client.zsh similarity index 93% rename from completion-client.zsh rename to lib/completion-client.zsh index c8cd957..ac487ed 100755 --- a/completion-client.zsh +++ b/lib/completion-client.zsh @@ -1,7 +1,7 @@ #!/usr/bin/env zsh zmodload zsh/net/socket -AUTOSUGGEST_SERVER_SCRIPT="${0:a:h}/completion-server.zsh" +AUTOSUGGEST_SERVER_SCRIPT="${0:a:h}/lib/completion-server.zsh" autosuggest-ensure-server() { setopt local_options no_hup diff --git a/completion-server-init.zsh b/lib/completion-server-init.zsh similarity index 100% rename from completion-server-init.zsh rename to lib/completion-server-init.zsh diff --git a/completion-server.zsh b/lib/completion-server.zsh similarity index 97% rename from completion-server.zsh rename to lib/completion-server.zsh index cd103f1..718193a 100755 --- a/completion-server.zsh +++ b/lib/completion-server.zsh @@ -75,7 +75,7 @@ print "autosuggestion server started, pid: $$" >&2 zpty z ZLE_DISABLE_AUTOSUGGEST=1 zsh -i print 'interactive shell started' # Source the init script -zpty -w z "source '${0:a:h}/completion-server-init.zsh'" +zpty -w z "source '${0:a:h}/lib/completion-server-init.zsh'" # wait for ok from shell read-to-null &> /dev/null From ddc61f15c012cf26c2f036adacd419ce52143310 Mon Sep 17 00:00:00 2001 From: Jan Schmidle Date: Sun, 9 Mar 2014 17:03:58 +0100 Subject: [PATCH 2/4] added files and docu for oh-my-zsh --- README.mkd | 16 ++++++++++++++++ autosuggestions.plugin.zsh | 1 + 2 files changed, 17 insertions(+) create mode 100644 autosuggestions.plugin.zsh diff --git a/README.mkd b/README.mkd index 9ce8365..1a50d21 100644 --- a/README.mkd +++ b/README.mkd @@ -38,6 +38,22 @@ Emacs-mode users can simply use alt+f which is bound to forward-word The [zsh-history-substring-search](https://github.com/zsh-users/zsh-history-substring-search) plugin is also recommended. + +## With oh-my-zsh + +* Download the script or clone this repository in [oh-my-zsh](http://github.com/robbyrussell/oh-my-zsh) plugins directory: + + cd ~/.oh-my-zsh/custom/plugins + git clone git://github.com/tarruda/zsh-autosuggestions.git + +* Activate the plugin in `~/.zshrc` (in **last** position): + + plugins=( [plugins...] zsh-autosuggestions) + +* Source `~/.zshrc` to take changes into account: + + source ~/.zshrc + ## Configuration You may override default global config variables after plugin load. diff --git a/autosuggestions.plugin.zsh b/autosuggestions.plugin.zsh new file mode 100644 index 0000000..c7b77e0 --- /dev/null +++ b/autosuggestions.plugin.zsh @@ -0,0 +1 @@ +autosuggestions.zsh From 11a00bc7c66a0cd5e4e0b667850cfe339697a246 Mon Sep 17 00:00:00 2001 From: Jan Schmidle Date: Sun, 9 Mar 2014 17:03:58 +0100 Subject: [PATCH 3/4] added files and docu for oh-my-zsh --- README.mkd | 16 ++++++++++++++++ zsh-autosuggestions.plugin.zsh | 1 + 2 files changed, 17 insertions(+) create mode 100644 zsh-autosuggestions.plugin.zsh diff --git a/README.mkd b/README.mkd index 9ce8365..1a50d21 100644 --- a/README.mkd +++ b/README.mkd @@ -38,6 +38,22 @@ Emacs-mode users can simply use alt+f which is bound to forward-word The [zsh-history-substring-search](https://github.com/zsh-users/zsh-history-substring-search) plugin is also recommended. + +## With oh-my-zsh + +* Download the script or clone this repository in [oh-my-zsh](http://github.com/robbyrussell/oh-my-zsh) plugins directory: + + cd ~/.oh-my-zsh/custom/plugins + git clone git://github.com/tarruda/zsh-autosuggestions.git + +* Activate the plugin in `~/.zshrc` (in **last** position): + + plugins=( [plugins...] zsh-autosuggestions) + +* Source `~/.zshrc` to take changes into account: + + source ~/.zshrc + ## Configuration You may override default global config variables after plugin load. diff --git a/zsh-autosuggestions.plugin.zsh b/zsh-autosuggestions.plugin.zsh new file mode 100644 index 0000000..c7b77e0 --- /dev/null +++ b/zsh-autosuggestions.plugin.zsh @@ -0,0 +1 @@ +autosuggestions.zsh From 0f35d621f99ba7dab75a00efe20740b4ccbde545 Mon Sep 17 00:00:00 2001 From: Jan Schmidle Date: Sun, 9 Mar 2014 18:45:31 +0100 Subject: [PATCH 4/4] fixed paths --- lib/completion-client.zsh | 2 +- lib/completion-server.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/completion-client.zsh b/lib/completion-client.zsh index ac487ed..c8cd957 100755 --- a/lib/completion-client.zsh +++ b/lib/completion-client.zsh @@ -1,7 +1,7 @@ #!/usr/bin/env zsh zmodload zsh/net/socket -AUTOSUGGEST_SERVER_SCRIPT="${0:a:h}/lib/completion-server.zsh" +AUTOSUGGEST_SERVER_SCRIPT="${0:a:h}/completion-server.zsh" autosuggest-ensure-server() { setopt local_options no_hup diff --git a/lib/completion-server.zsh b/lib/completion-server.zsh index 718193a..cd103f1 100755 --- a/lib/completion-server.zsh +++ b/lib/completion-server.zsh @@ -75,7 +75,7 @@ print "autosuggestion server started, pid: $$" >&2 zpty z ZLE_DISABLE_AUTOSUGGEST=1 zsh -i print 'interactive shell started' # Source the init script -zpty -w z "source '${0:a:h}/lib/completion-server-init.zsh'" +zpty -w z "source '${0:a:h}/completion-server-init.zsh'" # wait for ok from shell read-to-null &> /dev/null