From 84de3da9ac22c014ddacd286d5b3bd9f6efcc9e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gergo=CC=8B=20Sulymosi?= Date: Thu, 27 Feb 2014 23:02:54 +0100 Subject: [PATCH 1/2] Initialization under fish --- init.fish | 17 +++++++++++++++++ libexec/tmuxifier-init | 11 +++++++++++ 2 files changed, 28 insertions(+) create mode 100644 init.fish diff --git a/init.fish b/init.fish new file mode 100644 index 0000000..1fa2f6f --- /dev/null +++ b/init.fish @@ -0,0 +1,17 @@ +# Set/fix Tmuxifier root path if needed. +if test -z $TMUXIFIER + set -gx TMUXIFIER "$HOME/.tmuxifier" +end + +# Add `bin` directroy to `$PATH`. +if not contains "$TMUXIFIER/bin" $PATH + set -gx PATH "$TMUXIFIER/bin" $PATH +end + +# If `tmuxifier` is available, and `$TMUXIFIER_NO_COMPLETE` is not set, then +# load Tmuxifier shell completion. +if test -n (which tmuxifier); and test -z $TMUXIFIER_NO_COMPLETE + source "$TMUXIFIER/completion/tmuxifier.fish" +end + + diff --git a/libexec/tmuxifier-init b/libexec/tmuxifier-init index 7f676c0..ad0eab3 100755 --- a/libexec/tmuxifier-init +++ b/libexec/tmuxifier-init @@ -29,6 +29,9 @@ case "$shell" in tcsh ) profile='~/.tcshrc' ;; + fish ) + profile='~/.config/fish/config.fish' + ;; * ) profile='shell init file' ;; @@ -44,6 +47,10 @@ Load Tmuxifier by adding the following to your ${profile}: case "$shell" in csh | tcsh ) echo " eval \`tmuxifier init -\` +" + ;; + fish ) + echo " eval (tmuxifier init -) " ;; * ) @@ -67,6 +74,10 @@ case "$shell" in echo "setenv TMUXIFIER \"$TMUXIFIER\";" echo "source \"\$TMUXIFIER/init.tcsh\";" ;; + fish ) + echo "set -gx TMUXIFIER \"$TMUXIFIER\";" + echo "source \"\$TMUXIFIER/init.fish\";" + ;; * ) echo "export TMUXIFIER=\"$TMUXIFIER\";" echo "source \"\$TMUXIFIER/init.sh\";" From a9479df7c1c84855cd17721d170fc4e3c5d2a269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gergo=CC=8B=20Sulymosi?= Date: Thu, 27 Feb 2014 23:03:09 +0100 Subject: [PATCH 2/2] Update README with fish related stuff --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index fedd779..22e75a0 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,12 @@ __In tcsh:__ set path = ( "~/.tmuxifier/bin" $path ) ``` +__In fish:__ + +```fish +set -gx PATH "~/.tmuxifier/bin $PATH +``` + ### Custom Installation Path To install Tmuxifier somewhere else than the suggested `~/.tmuxifier`, simply @@ -94,6 +100,14 @@ Add the following to your `~/.cshrc`, `~/.tcshrc` or equivalent: eval `tmuxifier init -` ``` +__In fish:__ + +And add the following to your `~/.config/fish/config.fish` or equivalent: + +```fish +eval (tmuxifier init -) +``` + If you need to pass custom arguments to tmux itself, you can do so by setting the `TMUXIFIER_TMUX_OPTS` environment variable. For example: