set -g mouse on set -g default-terminal "screen-256color-bce" set -g status-justify centre #set -ga terminal-overrides ',xterm-256color:Tc' set -g base-index 1 set -g renumber-windows on set -g lock-command physlock bind q lock-client # use C-a # unbind C-b # set-option -g prefix C-a # bind-key C-a send-prefix # split with | and - #bind | split-window -h #bind - split-window -v unbind '"' unbind % bind h select-pane -L bind j select-pane -D bind k select-pane -U bind l select-pane -R 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 # switch panes using Alt-arrow without prefix bind -n M-Left select-pane -L bind -n M-Right select-pane -R bind -n M-Up select-pane -U bind -n M-Down select-pane -D bind o attach -c "#{pane_current_path}" # don't rename windows automatically set-option -g allow-rename off set -g @plugin 'tmux-plugins/tpm' run -b '~/.tmux/plugins/tpm/tpm' if "test ! -d ~/.tmux/plugins/tpm" \ "run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'" # set -g @plugin "arcticicestudio/nord-tmux" # set -g @plugin 'dracula/tmux' # set -g @dracula-show-powerline true set -g @plugin 'wfxr/tmux-power' # open pane in vim bind-key / capture-pane -S -102400 -J \; new-window 'vim -c ":read !tmux save-buffer - ; tmux delete-buffer;" -c ":normal gg" -c ":set buftype=nofile" -c ":silent! ChompWhitespace"' # clear history # bind k send-keys -R \; clear-history # copy mode setw -g mode-keys vi bind Escape copy-mode unbind [ unbind p bind p paste-buffer bind -Tcopy-mode-vi v send -X begin-selection bind -Tcopy-mode-vi y send -X copy-selection bind -Tcopy-mode-vi Escape send -X cancel # panes bind - split-window -v -c "#{pane_current_path}" bind | split-window -h -c "#{pane_current_path}" bind C-z resize-pane -Z bind g swap-pane -U bind æ swap-pane -D # panes #set -g window-active-style 'bg=colour236' #set -g window-style 'bg=black' # 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' bind -n 'M-h' if-shell "$is_vim" 'send-keys M-h' 'resize-pane -L 1' bind -n 'M-j' if-shell "$is_vim" 'send-keys M-j' 'resize-pane -D 1' bind -n 'M-k' if-shell "$is_vim" 'send-keys M-k' 'resize-pane -U 1' bind -n 'M-l' if-shell "$is_vim" 'send-keys M-l' 'resize-pane -R 1' 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 # Utils bind -r g display-popup -d '#{pane_current_path}' -w80% -h80% -E lazygit