dotfiles

dotfiles - ryukamish edition
Log | Files | Refs | README

tmux.conf (2776B)


      1 # Basic settings
      2 set -a terminal-features 'tmux-256color:RGB'
      3 
      4 # Start numbering at 1
      5 set -g base-index 1
      6 set -g renumber-windows on
      7 
      8 # Status bar
      9 set -g status-position top
     10 set -g status-interval 5
     11 set -g status-left-length 30
     12 set -g status-right-length 50
     13 set -g window-status-separator ""
     14 
     15 # Theme
     16 set -g status-style "bg=default,fg=default"
     17 set -g status-left "#[fg=black,bg=blue,bold] #S #[bg=default] "
     18 set -g status-right "#[fg=blue]#{?client_prefix,PREFIX ,}#{?window_zoomed_flag,ZOOM ,}#[fg=brightblack]#h "
     19 set -g status-right ""
     20 set -g window-status-format "#[fg=brightblack] #I:#W "
     21 set -g window-status-current-format "#[fg=blue,bold] #I:#W "
     22 set -g pane-border-style "fg=brightblack"
     23 set -g pane-active-border-style "fg=blue"
     24 set -g message-style "bg=default,fg=blue"
     25 set -g message-command-style "bg=default,fg=blue"
     26 set -g mode-style "bg=blue,fg=black"
     27 setw -g clock-mode-colour blue
     28 
     29 # Change the default prefix to C-a
     30 unbind C-b
     31 set-option -g prefix C-a
     32 bind-key C-a send-prefix
     33 
     34 # Split windows (opens in same directory as current window)
     35 unbind %
     36 unbind '"'
     37 bind \\ split-window -h -c "#{pane_current_path}"
     38 bind - split-window -v -c "#{pane_current_path}"
     39 bind v split-window -h -c "#{pane_current_path}"
     40 bind s split-window -v -c "#{pane_current_path}"
     41 
     42 # Fast session switching
     43 unbind-key s
     44 bind -n M-s choose-tree -Zs # filtered session/window/tree view
     45 bind -n M-S switch-client -l  # jump to last session instantly
     46 
     47 # Alt+hjkl to switch panes w/o prefix
     48 bind -n M-h select-pane -L
     49 bind -n M-j select-pane -D
     50 bind -n M-k select-pane -U
     51 bind -n M-l select-pane -R
     52 
     53 # Alt+number to switch windows
     54 bind -n M-1 select-window -t 1
     55 bind -n M-2 select-window -t 2
     56 bind -n M-3 select-window -t 3
     57 bind -n M-4 select-window -t 4
     58 bind -n M-5 select-window -t 5
     59 bind -n M-6 select-window -t 6
     60 bind -n M-7 select-window -t 7
     61 bind -n M-8 select-window -t 8
     62 bind -n M-9 select-window -t 9
     63 
     64 # Vim style copying
     65 set-window-option -g mode-keys vi
     66 bind-key -T copy-mode-vi v send-keys -X begin-selection
     67 bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
     68 bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
     69 unbind -T copy-mode-vi MouseDragEnd1Pane
     70 
     71 bind-key x kill-pane    # Skip kill pane prompt
     72 set -g detach-on-destroy off  # don't exit from tmux when closing a session
     73 
     74 # Setting default shell to zsh
     75 set-option -g default-shell /usr/bin/zsh
     76 
     77 # reload config file with a keystroke
     78 unbind r
     79 bind r source-file ~/.config/tmux/tmux.conf
     80 
     81 bind-key -n M-t run-shell "tmux neww ~/.local/bin/tmux-sessionizer"
     82 bind-key -r M-h run-shell "tmux neww tmux-sessionizer -s 0"
     83 bind-key -r M-j run-shell "tmux neww tmux-sessionizer -s 1"
     84 bind-key -r M-k run-shell "tmux neww tmux-sessionizer -s 2"
     85 bind-key -r M-l run-shell "tmux neww tmux-sessionizer -s 3"
     86