diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index 6a71410..4801e79 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -1,6 +1,7 @@ # Rebind prefix key to Ctrl+a for easier access unbind C-b set-option -g prefix C-a +set-option -g remain-on-exit off bind-key C-a send-prefix set-option -g focus-events on @@ -20,6 +21,7 @@ bind c-l select-pane -R bind c-g popup -E -w 80% -h 80% -d "#{pane_current_path}" -b rounded lazygit bind c-t popup -E -w 80% -h 80% -b rounded -d "#{pane_current_path}" bind c-s popup -E -w 80% -h 80% -b rounded "sesh" +bind c-x confirm-before -p "Kill current session #S? (y/n)" kill-session bind j command-prompt -p "Join window:" "join-pane -h -s %1" bind b break-pane diff --git a/tmux/choose-session.sh b/tmux/choose-session.sh deleted file mode 100644 index ed4719c..0000000 --- a/tmux/choose-session.sh +++ /dev/null @@ -1,4 +0,0 @@ -SESSION_FILE=$(ls "$HOME/tmux" | fzf) -if [ -n "$SESSION_FILE" ]; then - sh "$HOME/tmux/$SESSION_FILE" -fi diff --git a/tmux/tmux/.gitignore b/tmux/tmux/.gitignore deleted file mode 100644 index cac7ccd..0000000 --- a/tmux/tmux/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.sh -!edit-sessions.sh diff --git a/tmux/tmux/edit-sessions.sh b/tmux/tmux/edit-sessions.sh deleted file mode 100644 index 2e28776..0000000 --- a/tmux/tmux/edit-sessions.sh +++ /dev/null @@ -1,20 +0,0 @@ -SESSION="edit sessions" - -if tmux has-session -t "$SESSION" 2>/dev/null; then - if [ -n "$TMUX" ]; then - tmux switch-client -t "$SESSION" - else - tmux attach -t "$SESSION" - fi - exit 0 -fi - -tmux new-session -d -s "$SESSION" -c ~/tmux/ -n "nvim" -tmux send-keys -t "$SESSION":"nvim" 'nvim .' C-m - -tmux select-window -t "$SESSION":"nvim" -if [ -n "$TMUX" ]; then - tmux switch-client -t "$SESSION" -else - tmux attach -t "$SESSION" -fi