Swap with the next and previous windows with <ctrl><alt>N and <ctrl><alt>P, show a notification after the config has been reloaded and stay on the current window when swapping with ","

This commit is contained in:
Kevin MacMartin 2024-03-09 16:06:38 -05:00
parent 88fe711380
commit f5d00f3a0e
3 changed files with 13 additions and 4 deletions

View file

@ -44,6 +44,7 @@
|-----------------------------------------|--------------------------------------------------------------------|
| `<Alt><Shift><Up,Down,Left,Right>` | Navigate to the pane in the respective direction |
| `<Alt>N` and `<Alt>P` | Switch to the next and previous window |
| `<Ctrl><Alt>N` and `<Ctrl><Alt>P` | Swap the current window with the next and previous window |
| `Alt-[0-9]` | Switch to the window with the respective index |
### Copy Mode

View file

@ -73,7 +73,7 @@ bind -r + rotate-window -D
bind S swap-pane
#
# , to swap the current window with another
bind , command-prompt "swap-window -t '%%'"
bind , command-prompt "swap-window -d -t '%%'"
#
# # to rename the current window
bind "#" command-prompt -I '#W' "rename-window '%%'"
@ -86,7 +86,7 @@ bind C-Space last-pane
bind ` set-window-option synchronize-panes \; display "synchronize-panes: toggled"
#
# r to reload /etc/tmux.conf
bind r source-file /etc/tmux.conf
bind r source-file /etc/tmux.conf \; display "configuration reloaded"
#
# ? and / to show keyboard and command help
bind ? list-keys
@ -117,6 +117,10 @@ bind -n M-S-Right select-pane -R
bind -n M-N next-window
bind -n M-P previous-window
#
# (without prefix) <ctrl><alt> + N and P to swap with the next and previous windows
bind -n C-M-N swap-window -d -t +
bind -n C-M-P swap-window -d -t -
#
# (without prefix) <alt>[0-9] to switch directly to the window with the respective index
bind -n M-1 select-window -t 1
bind -n M-2 select-window -t 2

View file

@ -73,7 +73,7 @@ bind -r + rotate-window -D
bind S swap-pane
#
# , to swap the current window with another
bind , command-prompt "swap-window -t '%%'"
bind , command-prompt "swap-window -d -t '%%'"
#
# # to rename the current window
bind "#" command-prompt -I '#W' "rename-window '%%'"
@ -86,7 +86,7 @@ bind C-Space last-pane
bind ` set-window-option synchronize-panes \; display "synchronize-panes: toggled"
#
# r to reload /etc/tmux.conf
bind r source-file /etc/tmux.conf
bind r source-file /etc/tmux.conf \; display "configuration reloaded"
#
# ? and / to show keyboard and command help
bind ? list-keys
@ -117,6 +117,10 @@ bind -n M-S-Right select-pane -R
bind -n M-N next-window
bind -n M-P previous-window
#
# (without prefix) <ctrl><alt> + N and P to swap with the next and previous windows
bind -n C-M-N swap-window -d -t +
bind -n C-M-P swap-window -d -t -
#
# (without prefix) <alt>[0-9] to switch directly to the window with the respective index
bind -n M-1 select-window -t 1
bind -n M-2 select-window -t 2