60 lines
1.9 KiB
Bash
60 lines
1.9 KiB
Bash
# use vim copy/paste keybindings
|
|
setw -g mode-keys vi
|
|
|
|
# needs xclip for system clipboard
|
|
run-shell "tmux setenv -g TMUX_VERSION $(tmux -V | cut -c 6-)"
|
|
if-shell -b '[ "$(echo "$TMUX_VERSION < 2.4" | bc)" = 1 ]' \
|
|
"bind-key Escape copy-mode; \
|
|
bind-key -t vi-copy Escape cancel; \
|
|
bind-key p paste-buffer; \
|
|
bind-key -t vi-copy v begin-selection; \
|
|
bind-key -t vi-copy V select-line; \
|
|
bind-key -t vi-copy r rectangle-toggle; \
|
|
bind -t vi-copy y copy-pipe 'xclip -in -selection clipboard'"
|
|
|
|
if-shell -b '[ "$(echo "$TMUX_VERSION >= 2.4" | bc)" = 1 ]' \
|
|
"bind-key -T copy-mode-vi 'v' send -X begin-selection; \
|
|
bind-key -T copy-mode-vi 'V' send -X select-line; \
|
|
bind-key -T copy-mode-vi 'r' send -X rectangle-toggle; \
|
|
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'"
|
|
|
|
# split panes using | and -
|
|
bind | split-window -h
|
|
bind - split-window -v
|
|
unbind '"'
|
|
unbind %
|
|
|
|
set -g default-command "/bin/bash"
|
|
|
|
# reload config file (change file location to your the tmux.conf you want to use)
|
|
bind r source-file ~/.tmux.conf
|
|
|
|
# status bar design
|
|
set -g status-position top
|
|
set -g status-bg colour239
|
|
set -g status-attr dim
|
|
set -g status-right ' #[fg=colour233,bg=colour102,bold] #(hostname) #[fg=colour233,bg=colour102,bold] %d/%m #[fg=colour233,bg=colour102,bold] %H:%M:%S '
|
|
set -g status-right-length 50
|
|
set -g status-left-length 20
|
|
|
|
# current session name
|
|
set-window-option -g status-left '#[fg=colour0,bg=colour102,bold] #S '
|
|
|
|
# current window
|
|
setw -g window-status-current-fg colour0
|
|
setw -g window-status-current-bg colour102
|
|
setw -g window-status-current-attr bold
|
|
setw -g window-status-current-format ' #I#[fg=colour0] #[fg=colour0]#W '
|
|
|
|
# background windows
|
|
setw -g window-status-fg colour0
|
|
setw -g window-status-bg colour240
|
|
|
|
setw -g window-status-format ' #I#[fg=colour0] #[fg=colour0]#W '
|
|
|
|
# scrollback history
|
|
set -g mouse on
|
|
|
|
# terminal colors
|
|
set -g default-terminal "xterm-256color"
|
|
|