From 897991c5e413eab4f4c8aee2bf64fdac81d28673 Mon Sep 17 00:00:00 2001 From: Joe Block Date: Sun, 4 Jun 2023 07:52:58 -0600 Subject: [PATCH 1/4] Add a plugin.zsh file to be ZSH-framework friendly plugin.zsh files will be automatically detected and loaded by ZSH frameworks. Add one that adds the utilities folder to the user's `$PATH`. Signed-off-by: Joe Block --- iterm2-shell-integration.plugin.zsh | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 iterm2-shell-integration.plugin.zsh diff --git a/iterm2-shell-integration.plugin.zsh b/iterm2-shell-integration.plugin.zsh new file mode 100644 index 0000000..89fe04e --- /dev/null +++ b/iterm2-shell-integration.plugin.zsh @@ -0,0 +1,4 @@ +# Automagically add the utilities directory to $PATH + +PLUGIN_BIN="$(dirname $0)/bin" +export PATH=${PATH}:${PLUGIN_BIN} From 3533d93b9eb5cbd360c50f69c02fed900bd896d6 Mon Sep 17 00:00:00 2001 From: Joe Block Date: Sun, 4 Jun 2023 23:58:14 -0600 Subject: [PATCH 2/4] Source the helper functions, too Signed-off-by: Joe Block --- iterm2-shell-integration.plugin.zsh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/iterm2-shell-integration.plugin.zsh b/iterm2-shell-integration.plugin.zsh index 89fe04e..290df0f 100644 --- a/iterm2-shell-integration.plugin.zsh +++ b/iterm2-shell-integration.plugin.zsh @@ -1,4 +1,8 @@ # Automagically add the utilities directory to $PATH -PLUGIN_BIN="$(dirname $0)/bin" +# Add utilities to our path +PLUGIN_BIN="$(dirname $0)/utilities" export PATH=${PATH}:${PLUGIN_BIN} + +# And source the helper functions, too. +source "${0:h}/shell_integration/zsh" From 5349ca66c2af03f9546bb4d2464e12277e598db8 Mon Sep 17 00:00:00 2001 From: Joe Block Date: Fri, 25 Aug 2023 17:16:01 -0600 Subject: [PATCH 3/4] Use better path manipulation, update plugin file name @nunico mentioned a better way to massage `$PATH`, use it instead. Rename iterm2-shell-integration.plugin.zsh -> iTerm2-shell-integration.plugin.zsh per @nunico's comments about issues with zimfw and potentially other plugin managers. Signed-off-by: Joe Block --- ...tegration.plugin.zsh => iTerm2-shell-integration.plugin.zsh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) rename iterm2-shell-integration.plugin.zsh => iTerm2-shell-integration.plugin.zsh (69%) diff --git a/iterm2-shell-integration.plugin.zsh b/iTerm2-shell-integration.plugin.zsh similarity index 69% rename from iterm2-shell-integration.plugin.zsh rename to iTerm2-shell-integration.plugin.zsh index 290df0f..0b48a8a 100644 --- a/iterm2-shell-integration.plugin.zsh +++ b/iTerm2-shell-integration.plugin.zsh @@ -1,8 +1,7 @@ # Automagically add the utilities directory to $PATH # Add utilities to our path -PLUGIN_BIN="$(dirname $0)/utilities" -export PATH=${PATH}:${PLUGIN_BIN} +path+=("${0:h}/utilities") # And source the helper functions, too. source "${0:h}/shell_integration/zsh" From 71eeac5ac5774298955812f31693e0995e654d71 Mon Sep 17 00:00:00 2001 From: Joe Block Date: Tue, 19 Mar 2024 10:11:17 -0600 Subject: [PATCH 4/4] Document installation via ZSH frameworks Add a section to README.md that details installing it with the three most commonly used ZSH frameworks. Signed-off-by: Joe Block --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index ac09ed2..a0ff30f 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,21 @@ # iTerm2-shell-integration Shell integration and utilities for iTerm2 + +## ZSH framework usage + +The repository contains `iTerm2-shell-integration.plugin.zsh` to make it easier to use with ZSH frameworks like zgenom, antigen and oh-my-zsh. + +### [Zgenom](https://github.com/jandamm/zgenom) + +Add `zgenom load gnachman/iTerm2-shell-integration` to your `.zshrc` with your other load commands, then run `zgenom save` to update its `init.zsh` file. The integration will be automatically loaded the next time you start a ZSH session. + +### [Antigen](https://github.com/zsh-users/antigen) + +Add `antigen bundle gnachman/iTerm2-shell-integration@main` to your `.zshrc` + +☝ **Note** that until gets fixed in Antigen, it only automatically recognizes plugins on the `master` branch, so you need to explicitly specify `@main` here. + +### [Oh-My-Zsh](http://ohmyz.sh/) + +1. `git clone --depth 1 https://github.com/gnachman/iTerm2-shell-integration.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/fzf-zsh-plugin` +2. Add **iterm2-shell-integration** to your plugin list - edit `~.zshrc` and change `plugins=(...)` to `plugins=(... iterm2-shell-integration)`