2018-03-01 00:47:14 +01:00

118 lines
2.9 KiB
Bash

# tmux display things in 256 colors
set -g default-terminal "screen-256color"
# set new history limit
set -g history-limit 30000
# screesaver after 600 sek
set -g lock-after-time 600
set -g lock-command "/usr/bin/cmatrix -C blue -s"
# automatically renumber tmux windows
set -g renumber-windows on
# set new prefix key
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# Activity Monitoring
setw -g monitor-activity off
set -g visual-activity off
# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
#setw -g aggressive-resize on
# make delay shorter
set -sg escape-time 0
# tile all windows
#unbind =
#bind = select-layout tiled
# make window/pane index start with 1
set -g base-index 1
setw -g pane-base-index 1
new-session -A -s main
set-option -g set-titles on
set-option -g set-titles-string "#T - #W"
set-window-option -g automatic-rename on
# set config reload key
bind-key r source-file ~/.tmux.conf \; display "Config reloaded!"
# enable mouse scrolling
set -g mouse on
bind -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M"
bind -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M"
######################
#### Key Bindings ####
######################
# quickly open a new window
bind N new-window
# split window and fix path for tmux 1.9
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# pane movement shortcuts
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Resize pane shortcuts
bind -r H resize-pane -L 10
bind -r J resize-pane -D 10
bind -r K resize-pane -U 10
bind -r L resize-pane -R 10
# maximizing and restoring windows
unbind Up
bind Up new-window -d -n fullscreen \; swap-pane -s fullscreen.1 \; select-window -t fullscreen
unbind Down
bind Down last-window \; swap-pane -s fullscreen.1 \; kill-window -t fullscreen
# set vi mode for copy mode
setw -g mode-keys vi
# more settings to make copy-mode more vim-like
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
bind -t vi-copy 'v' begin-selection
bind -t vi-copy 'y' copy-selection
##############################
### Color & Style Settings ###
##############################
source ~/.tmux/theme.sh
##############################
### Plugins ###
##############################
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sidebar'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-open'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'