# -- general ------------------------------------------------------------------- set -g default-terminal "xterm-256color" #set -g default-terminal "screen-256color" set -as terminal-overrides ",*:U8=0" set -s escape-time 10 # faster command sequences set -s focus-events on set-option -sa terminal-overrides ',rxvt-256color:RGB' run-shell "powerline-daemon -q" #source "/usr/local/lib/python3.7/site-packages/powerline/bindings/tmux/powerline.conf" source "/home/jakob/.local/lib/python3.9/site-packages/powerline/bindings/tmux/powerline.conf" # -- display ------------------------------------------------------------------- set -g base-index 1 setw -g pane-base-index 1 setw -g automatic-rename on # rename window to reflect current program set -g renumber-windows on # renumber windows when a window is closed set -g display-panes-time 800 # slightly longer pane indicators display time set -g display-time 1000 # slightly longer status messages display time set -g status-interval 10 # redraw status line every 10 seconds set-option -g default-shell /usr/bin/zsh set-option -g display-panes-active-colour colour33 set-option -g display-panes-colour colour166 # activity set -g monitor-activity on set -g visual-activity off # -- navigation ---------------------------------------------------------------- # Set window notification setw -g monitor-activity on set -g visual-activity on unbind C-b set -g prefix C-a bind -n C-M-h resize-pane -L 2 bind -n C-M-j resize-pane -D 2 bind -n C-M-k resize-pane -U 2 bind -n C-M-l resize-pane -R 2 # Set copying settings setw -g mode-keys vi set-option -s set-clipboard off bind P paste-buffer bind-key -T copy-mode-vi 'v' send -X begin-selection 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 -sel clip -i'` unbind -T copy-mode-vi Enter bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel 'xclip -se c -i' #bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'xclip -se c -ind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel 'xclip -se c -i' #bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'xclip -se c -i'' bind-key S-Left swap-window -t -1 bind-key S-Right swap-window -t +1 bind -n End send-key C-e bind -n Home send-key C-a # Bells set -g visual-bell on set -g bell-action any # Scroll in shell set -g terminal-overrides 'xterm*:smcup@:rmcup@' #set -wg xterm-keys 1 set -g mouse on #set-option -s set-clipboard off # Sync panes bind-key = set-window-option synchronize-panes # -- macros -------------------------------------------------------------------- bind-key a send-keys \"jakob.stendahl\ \" # -- vim-tmux-navigator -------------------------------------------------------- # Smart pane switching with awareness of Vim splits. # See: https://github.com/christoomey/vim-tmux-navigator is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L' bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D' bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U' bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R' tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")' if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \ "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'" if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \ "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'" bind-key -T copy-mode-vi 'C-h' select-pane -L bind-key -T copy-mode-vi 'C-j' select-pane -D bind-key -T copy-mode-vi 'C-k' select-pane -U bind-key -T copy-mode-vi 'C-l' select-pane -R bind-key -T copy-mode-vi 'C-\' select-pane -l # -- Utility ------------------------------------------------------------------ bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"