aboutsummaryrefslogtreecommitdiff
path: root/find-file/split.sh
diff options
context:
space:
mode:
Diffstat (limited to 'find-file/split.sh')
-rwxr-xr-xfind-file/split.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/find-file/split.sh b/find-file/split.sh
new file mode 100755
index 0000000..77a6670
--- /dev/null
+++ b/find-file/split.sh
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+
+width=$(tmux display -p "#{pane_width}")
+height=$(tmux display -p "#{pane_height}")
+
+if (( $(echo "$width / $height > 2.5" | bc -l) )); then
+ tmux split-window -h "$@"
+else
+ tmux split-window -v "$@"
+fi
+