Skip to content

Instantly share code, notes, and snippets.

@tscolari
Created June 27, 2016 09:56
Show Gist options
  • Save tscolari/b00cc04eeff116f79b403d1abbe289fc to your computer and use it in GitHub Desktop.
Save tscolari/b00cc04eeff116f79b403d1abbe289fc to your computer and use it in GitHub Desktop.
# Ring the bell if any background window rang a bell
set -g bell-action any
bind-key ^D detach-client
# Create splits and vertical splits
bind-key v split-window -h
bind-key ^V split-window -h
bind-key s split-window
bind-key ^S split-window
# Use vi keybindings for tmux commandline input.
# Note that to get command mode you need to hit ESC twice...
set -g status-keys vi
# Use vi keybindings in copy and choice modes
setw -g mode-keys vi
# easily toggle synchronization (mnemonic: e is for echo)
# sends input to all panes in a given window.
bind e setw synchronize-panes on
bind E setw synchronize-panes off
# set first window to index 1 (not 0) to map more to the keyboard layout...
set -g base-index 1
set -g status-right '#{prefix_highlight}'
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
set-option -g status-attr default
# default window title colors
set-window-option -g window-status-fg colour244 #base0
set-window-option -g window-status-bg default
set-window-option -g window-status-attr dim
# active window title colors
set-window-option -g window-status-current-fg colour166 # orange
set-window-option -g window-status-current-bg white
set-window-option -g window-status-current-attr bright
set -g status-interval 1
set -g status-justify centre # center align window list
set -g status-left-length 70
set -g status-right-length 70
set -g status-utf8 on
set -g status-justify centre
setw -g monitor-activity on
set -g visual-activity on
set -g status-bg colour234
set -g window-status-format ' #I:#W#F '
set -g window-status-current-format ' #I:#W#F '
set -g status-left '#[default]┃ #[fg=green,bright]#h #[default]┃ #[fg=blue]#S #I:#P #[default]┃ '
set -g status-right '#[default]┃ #[fg=red,dim]up #(uptime | cut -f 4-5 -d " " | cut -f 1 -d ",") #[default]┃ #[fg=white]%l:%M:%S %p #[default]┃ #[fg=blue]%a %Y-%m-%d #[default]┃'
# No escape time for vi mode
set -sg escape-time 0
# Screen like binding for last window
# unbind l
bind C-b last-window
# Bigger history
set -g history-limit 10000
# Smart pane switching with awareness of vim splits
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(diff)?$"'
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'nhdaly/tmux-scroll-copy-mode'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @shell_mode 'vi'
set-option -g mouse on
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment