tmux/wip
This commit is contained in:
parent
6adea4a46d
commit
e9e12b6b64
1 changed files with 82 additions and 29 deletions
111
sh/tmux.sh
111
sh/tmux.sh
|
@ -6,34 +6,45 @@ rwx_tmux_setup() {
|
|||
local file
|
||||
file="${HOME}/.tmux.conf"
|
||||
rwx_file_write "${file}" "\
|
||||
# first index number
|
||||
set-option -g base-index 1
|
||||
set-option -g pane-base-index 1
|
||||
# display duration
|
||||
set-option -g display-time 1536
|
||||
# reload configuration
|
||||
bind-key r source-file ${file} \\; display-message 'Source: ${file}'
|
||||
# toggle mouse
|
||||
bind-key t set-option -g mouse \\; display-message 'Mouse: #{mouse}'
|
||||
|
||||
# select sessions with Alt & ↑ | ↓
|
||||
bind-key -n M-Down switch-client -n
|
||||
bind-key -n M-Up switch-client -p
|
||||
# ╭────────╮
|
||||
# │ option │
|
||||
# ╰────────╯
|
||||
|
||||
# empty name for windows
|
||||
set-option -g automatic-rename on
|
||||
set-option -g automatic-rename-format '#{pane_current_command}'
|
||||
set-option -g automatic-rename on
|
||||
|
||||
# first index number
|
||||
set-option -g base-index 1
|
||||
|
||||
# display duration
|
||||
set-option -g display-time 1536
|
||||
|
||||
# extend history limit
|
||||
set-option -g history-limit 1048576
|
||||
|
||||
# style for messages
|
||||
set-option -g message-style bg=red,fg=white
|
||||
|
||||
# activity monitoring
|
||||
set-window-option -g monitor-activity on
|
||||
|
||||
# silence monitoring
|
||||
set-window-option -g monitor-silence 0
|
||||
|
||||
# enable mouse actions
|
||||
set-option -g mouse on
|
||||
|
||||
# prefix with ^B or F12
|
||||
set-option -g prefix C-b
|
||||
set-option -g prefix2 F12
|
||||
|
||||
# renumber windows after closing one
|
||||
set-option -g renumber-windows on
|
||||
# status lines
|
||||
set-option -g status 3
|
||||
|
||||
# enable title
|
||||
set-option -g set-titles on
|
||||
|
||||
# set title to working directory
|
||||
set-option -g set-titles-string '\
|
||||
tmux / \
|
||||
|
@ -42,9 +53,37 @@ tmux / \
|
|||
#{pane_index} #{pane_width}×#{pane_height}\
|
||||
'
|
||||
|
||||
# status bar
|
||||
# status lines
|
||||
set-option -g status 3
|
||||
|
||||
# ╭────────┬──────╮
|
||||
# │ option │ pane │
|
||||
# ╰────────┴──────╯
|
||||
|
||||
# first index number
|
||||
set-option -g pane-base-index 1
|
||||
|
||||
# ╭────────┬──────┬────────╮
|
||||
# │ option │ pane │ border │
|
||||
# ╰────────┴──────┴────────╯
|
||||
|
||||
# active style
|
||||
set-option -g pane-active-border-style bg=black,fg=green
|
||||
|
||||
# regular style
|
||||
set-option -g pane-border-style bg=black,fg=gray
|
||||
|
||||
# ╭────────┬────────╮
|
||||
# │ option │ status │
|
||||
# ╰────────┴────────╯
|
||||
|
||||
# background color
|
||||
set-option -g status-bg black
|
||||
|
||||
# foreground color
|
||||
set-option -g status-fg gray
|
||||
|
||||
# first line
|
||||
set-option -g status-format[0] '\
|
||||
#{W:\
|
||||
#{?window_active,#[fg=green],\
|
||||
|
@ -59,6 +98,8 @@ set-option -g status-format[0] '\
|
|||
#[align=right] \
|
||||
#[fg=yellow]%Y-%m-%d\
|
||||
'
|
||||
|
||||
# second line
|
||||
set-option -g status-format[1] '\
|
||||
#{P:\
|
||||
#{?pane_active,#[fg=green],#[fg=default]}\
|
||||
|
@ -70,26 +111,38 @@ set-option -g status-format[1] '\
|
|||
#[align=right] \
|
||||
#[fg=yellow]%H:%M:%S\
|
||||
'
|
||||
|
||||
# third line
|
||||
set-option -g status-format[2] '\
|
||||
#[fg=cyan]#{pane_current_path}\
|
||||
'
|
||||
|
||||
# refresh period
|
||||
set-option -g status-interval 1
|
||||
|
||||
# bar location
|
||||
set-option -g status-position top
|
||||
|
||||
# style for messages
|
||||
set-option -g message-style bg=red,fg=white
|
||||
# style for pane borders
|
||||
set-option -g pane-active-border-style bg=black,fg=green
|
||||
set-option -g pane-border-style bg=black,fg=gray
|
||||
# ╭─────╮
|
||||
# │ key │
|
||||
# ╰─────╯
|
||||
|
||||
# prefix with ^B or F12
|
||||
set-option -g prefix C-b
|
||||
set-option -g prefix2 F12
|
||||
# select sessions with Alt & ↑ | ↓
|
||||
bind-key -n M-Down switch-client -n
|
||||
bind-key -n M-Up switch-client -p
|
||||
|
||||
# enable activity monitoring
|
||||
set-window-option -g monitor-activity on
|
||||
# disable silence monitoring
|
||||
set-window-option -g monitor-silence 0
|
||||
# ╭─────┬────────╮
|
||||
# │ key │ prefix │
|
||||
# ╰─────┴────────╯
|
||||
|
||||
# reload configuration
|
||||
bind-key r source-file ${file} \\; display-message 'source-file ${file}'
|
||||
|
||||
# toggle mouse
|
||||
bind-key t set-option -g mouse \\; display-message 'mouse = #{mouse}'
|
||||
|
||||
# ╭─╮
|
||||
# ╰─╯
|
||||
|
||||
# bind key to detach client
|
||||
bind-key -n F6 detach-client
|
||||
|
|
Loading…
Reference in a new issue