dotfiles

Cross platform dotfiles for linux, mac and windows
git clone git@getsh.org:dotfiles.git
Log | Files | Refs

tmux.conf (2515B)


      1 # Miscellaneous
      2 set -g base-index 1
      3 set escape-time 0
      4 set -g set-titles on
      5 # bind c new-window
      6 
      7 # Status bar
      8 set -g status-position top
      9 set -g status-justify left
     10 # set -g status-right "#(tmux-now-playing)"
     11 set -g status-right ""
     12 bind v split-window -h -c "#{pane_current_path}"
     13 bind s split-window -v -c "#{pane_current_path}"
     14 
     15 # Navigation
     16 set-window-option -g mode-keys vi
     17 
     18 bind h select-pane -L
     19 bind j select-pane -D
     20 bind k select-pane -U
     21 bind l select-pane -R
     22 
     23 bind u last-window
     24 
     25 bind J resize-pane -D 5
     26 bind K resize-pane -U 5
     27 bind H resize-pane -L 5
     28 bind L resize-pane -R 5
     29 
     30 # Clipboard
     31 unbind -T copy-mode-vi Space
     32 unbind -T copy-mode-vi Enter
     33 
     34 bind -T copy-mode-vi v send-keys -X begin-selection
     35 bind -T copy-mode-vi y send-keys -X copy-selection-and-cancel
     36 
     37 set-option -g mouse on
     38 setw -g mode-keys vi
     39 set-option -g focus-events on
     40 set-option -s set-clipboard off
     41 bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "clip"
     42 bind P paste-buffer
     43 
     44 # Themes
     45 set-option -g status-style "bg=default"
     46 set -g status-fg default
     47 set -g window-status-current-style "fg=default,bold"
     48 set -g pane-active-border-style "bg=default,fg=red"
     49 set -g pane-border-lines single
     50 set -g pane-border-status off
     51 set -g pane-border-indicators colour
     52 set -g popup-border-style "bg=default,fg=grey"
     53 set -g popup-border-lines single
     54 
     55 # Smart pane switching with awareness of Vim splits.
     56 # See: https://github.com/christoomey/vim-tmux-navigator
     57 is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
     58     | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
     59 bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h'  'select-pane -L'
     60 bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j'  'select-pane -D'
     61 bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k'  'select-pane -U'
     62 bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l'  'select-pane -R'
     63 tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
     64 if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
     65     "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\'  'select-pane -l'"
     66 if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
     67     "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\'  'select-pane -l'"
     68 
     69 bind-key -T copy-mode-vi 'C-h' select-pane -L
     70 bind-key -T copy-mode-vi 'C-j' select-pane -D
     71 bind-key -T copy-mode-vi 'C-k' select-pane -U
     72 bind-key -T copy-mode-vi 'C-l' select-pane -R
     73 bind-key -T copy-mode-vi 'C-\' select-pane -l
     74 bind R source-file ~/.config/tmux/tmux.conf
     75 bind m display-popup -E "ncmpc"
     76