Skip to content

Instantly share code, notes, and snippets.

@adaam2
Created December 9, 2019 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adaam2/764f8428de05066f3469ff35c0d706e9 to your computer and use it in GitHub Desktop.
Save adaam2/764f8428de05066f3469ff35c0d706e9 to your computer and use it in GitHub Desktop.
set -g default-terminal "screen-256color"
# 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-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
# re-number windows when one is closed
set -sg renumber-windows on
# Speedier tmux
set -sg escape-time 0
set -sg status-interval 10
# Scrollback with mousewheel
set -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e; send-keys -M'"
#### Layout settings ####
setw -g pane-border-style "bg=default,fg=colour15"
setw -g pane-active-border-style "bg=default,fg=colour15"
set -g status-justify left
set -g status-bg default
set -g status-fg colour255
set -g status-left "[w]"
setw -g window-status-format "#[fg="white"] #I: #W "
setw -g window-status-separator ""
setw -g window-status-current-format "#[fg="black",bg="colour255"] #I: #W "
set -g status-right "#[fg="white"] %d/%m #[fg="black",bg="colour255"] %H:%M "
####
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment