diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 70efc841..3ae82df8 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -59,7 +59,7 @@ "nvim-dap-virtual-text": { "branch": "master", "commit": "76d80c3d171224315b61c006502a1e30c213a9ab" }, "nvim-jdtls": { "branch": "master", "commit": "ece818f909c6414cbad4e1fb240d87e003e10fda" }, "nvim-lint": { "branch": "master", "commit": "1fea92f1d9908eaa5eb8bafe08b4293d7aadaa55" }, - "nvim-lspconfig": { "branch": "master", "commit": "9204642002ba91f9e0b7d0e5989f373657fe754a" }, + "nvim-lspconfig": { "branch": "master", "commit": "b54abeb8b90af1cb4592ce937ee95ed8cb457801" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, "nvim-notify": { "branch": "master", "commit": "fbef5d32be8466dd76544a257d3f3dce20082a07" }, "nvim-spider": { "branch": "main", "commit": "c61aca1d9541e1d14083e1e23e20c01c53c98668" }, diff --git a/.config/tmux/confirm_kill_pane.sh b/.config/tmux/confirm_kill_pane.sh new file mode 100755 index 00000000..64849eee --- /dev/null +++ b/.config/tmux/confirm_kill_pane.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +# Function to check if killing the pane would kill the session +if [ "$(tmux list-panes -F '#{pane_id}' | wc -l)" -eq 1 ]; then + tmux confirm-before -p "Kill window? (y/n): " "kill-pane" +else + tmux kill-pane +fi diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf index 3d379c58..96b75339 100644 --- a/.config/tmux/tmux.conf +++ b/.config/tmux/tmux.conf @@ -4,7 +4,6 @@ set -g xterm-keys on set -g allow-rename off set -s escape-time 1 - # For image.nvim set -gq allow-passthrough on set -g visual-activity off @@ -57,12 +56,16 @@ bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel bind-key b set-option status +# Do not preserve the current working directory for new windows +bind c new-window -c "" + # Swap the split bindings to be consistent with nvim bind -n M-v split-window -h -c "#{pane_current_path}" bind -n M-s split-window -v -c "#{pane_current_path}" bind x kill-window -bind -n M-x killp +# bind -n M-x killp +bind -n M-x run-shell "~/.config/tmux/confirm_kill_pane.sh; true" bind -n M-f resize-pane -Z bind - copy-mode bind -n M-u next-window