aboutsummaryrefslogtreecommitdiffstats
path: root/plugin.tmux
diff options
context:
space:
mode:
authorEugene Triguba <hello@eugenetriguba.com>2026-11-14 11:08:59 -0800
committerEugene Triguba <hello@eugenetriguba.com>2026-11-14 11:08:59 -0800
commit36f7df56164df73c7af867d8ed478a9b572aee40 (patch)
tree0e46940d56b58e2b473b872a8bc4fac9d69a3d33 /plugin.tmux
parentFix links to docs images in readme and update install instructions (diff)
downloadtmux-toggle-term-36f7df56164df73c7af867d8ed478a9b572aee40.zip
Move source files to src/ directory and add test script to scripts/
Diffstat (limited to '')
-rwxr-xr-xsrc/main.sh (renamed from plugin.tmux)16
1 files changed, 7 insertions, 9 deletions
diff --git a/plugin.tmux b/src/main.sh
index 43d587a..4bc01c2 100755
--- a/plugin.tmux
+++ b/src/main.sh
@@ -1,11 +1,9 @@
#!/bin/sh
-# vi: ft=sh
-set -e
+set -o errexit
+set -o nounset
CURRENT_DIR="$(dirname "$0")"
-. "$CURRENT_DIR/scripts/tmux.sh"
-
-SCRIPTS_DIR="${CURRENT_DIR}/scripts"
+. "$CURRENT_DIR/tmux.sh"
FLOAT_KEYBINDING="C-f"
FLOAT_KEYBINDING_OPTION="@toggle-term-float-key"
@@ -23,18 +21,18 @@ main() {
if [ "$(float_enabled)" = "true" ]; then
float_key_binding="$(float_key)"
if [ "$(use_prefix_for_float)" = "true" ]; then
- $tmux_cmd bind-key "$float_key_binding" run-shell -b "$SCRIPTS_DIR/toggle-term.sh float"
+ $tmux_cmd bind-key "$float_key_binding" run-shell -b "$CURRENT_DIR/toggle-term.sh float"
else
- $tmux_cmd bind-key -n "$float_key_binding" run-shell -b "$SCRIPTS_DIR/toggle-term.sh float"
+ $tmux_cmd bind-key -n "$float_key_binding" run-shell -b "$CURRENT_DIR/toggle-term.sh float"
fi
fi
if [ "$(split_enabled)" = "true" ]; then
split_key_binding="$(split_key)"
if [ "$(use_prefix_for_split)" = "true" ]; then
- $tmux_cmd bind-key "$split_key_binding" run-shell -b "$SCRIPTS_DIR/toggle-term.sh split"
+ $tmux_cmd bind-key "$split_key_binding" run-shell -b "$CURRENT_DIR/toggle-term.sh split"
else
- $tmux_cmd bind-key -n "$split_key_binding" run-shell -b "$SCRIPTS_DIR/toggle-term.sh split"
+ $tmux_cmd bind-key -n "$split_key_binding" run-shell -b "$CURRENT_DIR/toggle-term.sh split"
fi
fi
}