Spiced up .tmux.conf and updated README
This commit is contained in:
25
.tmux.conf
25
.tmux.conf
@@ -20,11 +20,11 @@ bind j select-pane -D
|
|||||||
bind k select-pane -U
|
bind k select-pane -U
|
||||||
bind l select-pane -R
|
bind l select-pane -R
|
||||||
|
|
||||||
## resize panes using PREFIX H, J, K, L
|
# resize panes using PREFIX H, J, K, L
|
||||||
bind H resize-pane -L 5
|
bind -r H resize-pane -L 2
|
||||||
bind J resize-pane -D 5
|
bind -r J resize-pane -D 2
|
||||||
bind K resize-pane -U 5
|
bind -r K resize-pane -U 2
|
||||||
bind L resize-pane -R 5
|
bind -r L resize-pane -R 2
|
||||||
|
|
||||||
## PREFIX | to split horizontally
|
## PREFIX | to split horizontally
|
||||||
## PREFIX - to split vertically
|
## PREFIX - to split vertically
|
||||||
@@ -37,10 +37,13 @@ set -sg escape-time 1
|
|||||||
## Tab through active windows
|
## Tab through active windows
|
||||||
bind Tab next-window
|
bind Tab next-window
|
||||||
|
|
||||||
|
## Rename window
|
||||||
|
bind , command-prompt "rename-window '%%'"
|
||||||
|
|
||||||
## ----------------------
|
## ----------------------
|
||||||
## Status Bar
|
## Status Bar
|
||||||
## -----------------------
|
## -----------------------
|
||||||
set-option -g status on # turn the status bar on
|
set -g status on # turn the status bar on
|
||||||
set -g status-interval 5 # set update frequencey (default 15 seconds)
|
set -g status-interval 5 # set update frequencey (default 15 seconds)
|
||||||
set -g status-justify centre # center window list for clarity
|
set -g status-justify centre # center window list for clarity
|
||||||
|
|
||||||
@@ -55,12 +58,12 @@ set -g pane-active-border-style bg=colour0,fg=colour2
|
|||||||
set-option -g message-style bg=colour0,fg=colour13
|
set-option -g message-style bg=colour0,fg=colour13
|
||||||
|
|
||||||
## set window list colors
|
## set window list colors
|
||||||
set-window-option -g window-status-style fg=colour8,bg=colour0
|
setw -g window-status-style fg=colour8,bg=colour0
|
||||||
set-window-option -g window-status-current-style fg=colour2,bg=colour0,bright
|
setw -g window-status-current-style fg=colour2,bg=colour0,bright
|
||||||
|
|
||||||
## Titles
|
## Titles
|
||||||
set-option -g set-titles on
|
set -g set-titles on
|
||||||
set-option -g set-titles-string '#H:#S.#I.#P #W #T' # window number,program name, active(or not)
|
set -g set-titles-string '#H:#S.#I.#P #W #T' # window number,program name, active(or not)
|
||||||
|
|
||||||
#set inactive/active window styles
|
#set inactive/active window styles
|
||||||
# set -g window-style fg=colour0,bg=colour0
|
# set -g window-style fg=colour0,bg=colour0
|
||||||
@@ -82,7 +85,7 @@ set -g status-right-length 60
|
|||||||
set -g status-right "S:#S W:#I P:#P | %Y-%m-%d %H:%M"
|
set -g status-right "S:#S W:#I P:#P | %Y-%m-%d %H:%M"
|
||||||
|
|
||||||
# set window and pane index to 1 (0 by default)
|
# set window and pane index to 1 (0 by default)
|
||||||
set-option -g base-index 1
|
set -g base-index 1
|
||||||
setw -g pane-base-index 1
|
setw -g pane-base-index 1
|
||||||
|
|
||||||
## visual notification of activity in other windows
|
## visual notification of activity in other windows
|
||||||
|
|||||||
20
README.md
20
README.md
@@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
filename: README
|
|
||||||
filecreated:
|
filecreated:
|
||||||
fileupdated: 2024-03-21 14:22
|
fileupdated: 2025-04-16
|
||||||
filetags: [readme]
|
filetags: [readme]
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -17,9 +16,7 @@ REQ: tmux v3+
|
|||||||
|
|
||||||
## Need
|
## Need
|
||||||
|
|
||||||
After I discovered tmux I searched for a way to manage multiple groups of tmux sessions under one unified script. Not
|
After I discovered tmux I searched for a way to manage multiple groups of tmux sessions under one unified script. Not finding anything (or maybe just not looking well enough) I decided to write my own. It's not pretty, but I've been using for a couple of years now and it's become an integral part of my workflow.
|
||||||
finding anything (or maybe just not looking well enough) I decided to write my own. It's not pretty, but I've been
|
|
||||||
using for a couple of years now and it's become an integral part of my workflow.
|
|
||||||
|
|
||||||
My setup works this way:
|
My setup works this way:
|
||||||
|
|
||||||
@@ -60,14 +57,11 @@ case $session in
|
|||||||
;;
|
;;
|
||||||
```
|
```
|
||||||
|
|
||||||
Calling the script with a pre-determined session name (ex: `./tmux-menu.sh web` or `./tmux-menu.sh database`) first
|
Calling the script with a pre-determined session name (ex: `./tmux-menu.sh web` or `./tmux-menu.sh database`) firstchecks to see if there is already a session group with that name. If not, it creates a new group with the commands youspecify and names each connection in tmux.
|
||||||
checks to see if there is already a session group with that name. If not, it creates a new group with the commands you
|
|
||||||
specify and names each connection in tmux.
|
|
||||||
|
|
||||||
If the session group *does* already exist, it simply switches you to that group.
|
If the session group *does* already exist, it simply switches you to that group.
|
||||||
|
|
||||||
If you alias `tmux-menu.sh` to something shorter (like `tm`), switching between active sessions is as easy as `Ctrl-A +
|
If you alias `tmux-menu.sh` to something shorter (like `tm`), switching between active sessions is as easy as `Ctrl-A + d` (to detach) and `tm web` (to attach or create the web group).
|
||||||
d` (to detach) and `tm web` (to attach or create the web group).
|
|
||||||
|
|
||||||
Killing session groups is as easy as `tmux-session kill -t web`.
|
Killing session groups is as easy as `tmux-session kill -t web`.
|
||||||
|
|
||||||
@@ -75,8 +69,6 @@ Killing session groups is as easy as `tmux-session kill -t web`.
|
|||||||
|
|
||||||
## Use
|
## Use
|
||||||
|
|
||||||
I've found that I use this script on different servers with different configurations. So I copy the
|
I've found that I use this script on different servers with different configurations. So I copy the `tmux-menu.template.sh` to `$HOME/tmux-menu.sh` and then alias that to `tm`.
|
||||||
`tmux-menu.template.sh` to `$HOME/tmux-menu.sh` and then alias that to `tm`.
|
|
||||||
|
|
||||||
I also include my `.tmux.conf` file with comments about what does what. If you choose to use it, make sure to copy it
|
I also include my `.tmux.conf` file with comments about what does what. If you choose to use it, make sure to copy it to your home directory.
|
||||||
to your home directory.
|
|
||||||
|
|||||||
Reference in New Issue
Block a user