# set -g default-terminal "screen-256color" set-option -sa terminal-overrides ",xterm*:Tc" # set -sa terminal-overrides "screen-256color:RGB" # set font display set-window-option -q -g utf8 on # Start windows and panes at 1, not 0 set -g base-index 1 set -g pane-base-index 1 set-window-option -g pane-base-index 1 set-option -g renumber-windows on # action key unbind C-b #bind t send-key C-t set-option -g prefix C-t set-option -g repeat-time 0 # Reload settings bind r source-file ~/.tmux.conf \; display "Reloaded!" # Kill all panes except current one with e bind -r e kill-pane -a # is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ # | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?|fzf)(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 # vim-like pane switching bind -r k select-pane -U bind -r j select-pane -D bind -r h select-pane -L bind -r l select-pane -R # Shift-Alt to switch windows bind -n M-H previous-window bind -n M-L next-window # Moving window bind-key -n C-S-Left swap-window -t -1 \; previous-window bind-key -n C-S-Right swap-window -t +1 \; next-window # Resizing pane bind -r C-k resize-pane -U 5 bind -r C-j resize-pane -D 5 bind -r C-h resize-pane -L 5 bind -r C-l resize-pane -R 5 # Maximize pane bind -r m resize-pane -Z # Bind splits unbind % bind | split-window -h -c "#{pane_current_path}" # and open in current unbind '"' bind - split-window -v -c "#{pane_current_path}" # and open in current #### basic settings # setting mouse scroll option set -g mouse on # to enable mouse scroll, see https://github.com/tmux/tmux/issues/145#issuecomment-150736967 bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'" set-option -g status-justify "left" # look'n feel set-option -g status-fg cyan set-option -g status-bg black set -g pane-active-border-style fg=colour166,bg=default set -g window-style fg=colour10,bg=default set -g window-active-style fg=colour12,bg=default set-option -g history-limit 64096 set-option -g focus-events on # allow autoread set -sg escape-time 10 #### COLOUR # default statusbar colors set-option -g status-style bg=colour235,fg=colour136,default # default window title colors set-window-option -g window-status-style fg=colour244,bg=colour234,dim # active window title colors set-window-option -g window-status-current-style fg=colour166,bg=default,bright # pane border set-option -g pane-border-style fg=colour235 #base02 set-option -g pane-active-border-style fg=colour136 #,bg=colour235 # message text set-option -g message-style bg=colour235,fg=colour166 # pane number display set-option -g display-panes-active-colour colour33 #blue set-option -g display-panes-colour colour166 #orange # default shell set -g default-command /usr/bin/fish set -g default-shell /usr/bin/fish # clock set-window-option -g clock-mode-colour colour64 #green # allow the title bar to adapt to whatever host you connect to set -g set-titles on set -g set-titles-string "#T" # Set tmux statusbar position set -g status-position top #### Key bindings set-window-option -g mode-keys vi bind-key -T copy-mode-vi 'v' send -X begin-selection # start selecting text with "v" bind-key -T copy-mode-vi 'C-v' send -X rectangle-toggle # start selecting text in rectangle mode with "C-v" bind-key -T copy-mode-vi 'y' send -X copy-selection # copy text with "y" unbind -T copy-mode-vi MouseDragEnd1Pane # don't exit copy mode after dragging with mouse # import if-shell "uname -s | grep -q Darwin" "source ~/.tmux.conf.osx" # List of plugins set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' set -g @plugin 'tmux-plugins/tmux-yank' set -g @plugin 'christoomey/vim-tmux-navigator' # Powerline source ~/.tmux.powerline.conf # Initialize TMUX plugin manager (keep this line at the very bottom of tmyx.conf) run '~/.tmux/plugins/tpm/tpm'