aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Triguba <hello@eugenetriguba.com>2025-08-17 10:47:23 -0400
committerEugene Triguba <hello@eugenetriguba.com>2025-08-17 10:47:23 -0400
commit186c8bfebd029d47e4984ed0735668509a2cef84 (patch)
tree5bd4549bcbe13dd61b578d67e7111f256d83456f
parentAdd auto-detection of tmux files as tmux file types (diff)
downloaddotfiles-186c8bfebd029d47e4984ed0735668509a2cef84.zip
Adjust tmux config to create new windows in same dir and use toggle term
-rwxr-xr-xexecutables/bin/tmux-toggle-term23
-rw-r--r--tmux/.config/tmux/key-remappings.tmux10
-rw-r--r--tmux/.config/tmux/macos.tmux1
-rw-r--r--tmux/.config/tmux/plugins.tmux2
4 files changed, 5 insertions, 31 deletions
diff --git a/executables/bin/tmux-toggle-term b/executables/bin/tmux-toggle-term
deleted file mode 100755
index 6d6cbd7..0000000
--- a/executables/bin/tmux-toggle-term
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/env bash
-set -uo pipefail
-
-FLOAT_TERM="${1:-}"
-LIST_PANES="$(tmux list-panes -F '#F')"
-PANE_ZOOMED="$(echo "${LIST_PANES}" | grep Z)"
-PANE_COUNT="$(echo "${LIST_PANES}" | wc -l | bc)"
-
-if [ -n "${FLOAT_TERM}" ]; then
- if [ "$(tmux display-message -p -F "#{session_name}")" = "popup" ]; then
- tmux detach-client
- else
- tmux popup -d '#{pane_current_path}' -xC -yC -w90% -h80% -E "tmux attach -t popup || tmux new -s popup"
- fi
-else
- if [ "${PANE_COUNT}" = 1 ]; then
- tmux split-window -c "#{pane_current_path}"
- elif [ -n "${PANE_ZOOMED}" ]; then
- tmux select-pane -t:.-
- else
- tmux resize-pane -Z -t1
- fi
-fi
diff --git a/tmux/.config/tmux/key-remappings.tmux b/tmux/.config/tmux/key-remappings.tmux
index 323c89f..537ef36 100644
--- a/tmux/.config/tmux/key-remappings.tmux
+++ b/tmux/.config/tmux/key-remappings.tmux
@@ -8,16 +8,12 @@ bind-key C-a send-prefix
# Remap pane splits to something more sane than the default.
#
# Split panes using | for horizontal splits and - for vertical splits
-bind-key | split-window -h
-bind-key - split-window -v
+bind-key | split-window -h -c "#{pane_current_path}"
+bind-key - split-window -v -c "#{pane_current_path}"
unbind '"'
unbind %
+bind-key c new-window -c "#{pane_current_path}"
# Easier configuration reloading and pane killing
bind-key r source-file ~/.config/tmux/tmux.conf \; display-message "Config reloaded!"
bind-key x kill-pane
-
-# Add key bindings for toggling terminal windows
-bind-key -n 'C-;' run-shell -b "${HOME}/bin/tmux-toggle-term"
-bind-key -n 'C-f' run-shell -b "${HOME}/bin/tmux-toggle-term float"
-
diff --git a/tmux/.config/tmux/macos.tmux b/tmux/.config/tmux/macos.tmux
index 02fbde3..4555ea5 100644
--- a/tmux/.config/tmux/macos.tmux
+++ b/tmux/.config/tmux/macos.tmux
@@ -1,7 +1,6 @@
# Related: [issue #67](https://github.com/tmux-plugins/tpm/issues/67)
set-environment -g PATH "/opt/homebrew/bin:/bin:/usr/bin"
-# Setting the namespace
set -g default-command "reattach-to-user-namespace -l /bin/zsh"
# Prefix C-c copy buffer to system clipboard
diff --git a/tmux/.config/tmux/plugins.tmux b/tmux/.config/tmux/plugins.tmux
index d3e32d7..65c7bb5 100644
--- a/tmux/.config/tmux/plugins.tmux
+++ b/tmux/.config/tmux/plugins.tmux
@@ -42,4 +42,6 @@ set -g @tokyo-night-tmux_date_format YMD
set -g @tokyo-night-tmux_time_format 24H
set -g @tokyo-night-tmux_show_git 0
+set -g @plugin 'git.sr.ht/~eugenetriguba/tmux-toggle-term'
+
run '$HOME/.config/tmux/plugins/tpm/tpm'