Skip to content

Instantly share code, notes, and snippets.

@yardstick17
Created February 16, 2017 16:59
Show Gist options
  • Save yardstick17/86e0b025aedb4dfbce18a1a92b07c65a to your computer and use it in GitHub Desktop.
Save yardstick17/86e0b025aedb4dfbce18a1a92b07c65a to your computer and use it in GitHub Desktop.
unbind C-b
set -g prefix \ # or `
bind-key \ send-prefix # Without this forget backtick forever (in tmux)
# Turn on mouse mode - enables scrolling etc.
#set -g mouse on
set -g mode-mouse on
set -g mouse-resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on
# Start numbering at 1
set -g base-index 1
bind -n C-k clear-history
# Allows for faster key repetition
set -s escape-time 0
# Set status bar
set -g status-bg black
set -g status-fg white
set -g status-left ""
set -g status-right "#[fg=green]#H"
# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
#setw -g aggressive-resize on
setw -g aggressive-resize off
# Allows us to use C-a a <command> to send commands to a TMUX session inside
# another TMUX session
#bind-key a send-prefix
# Activity monitoring
#setw -g monitor-activity on
#set -g visual-activity on
# Example of using a shell command in the status line
#set -g status-right "#[fg=yellow]#(uptime | cut -d ',' -f 2-)"
# Highlight active window
set-window-option -g window-status-current-bg red
# Smart pane switching with awareness of vim splits
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(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" #C-l conflicts with clear command
bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# Send Ctrl-l to clear screen
bind -n C-l send-keys 'C-l'
bind -n M-Right next-window
bind -n M-Left previous-window
bind -n C-Right next-window
bind -n C-Left previous-window
#set -g status-right "CPU: #{cpu_percentage} | Battery: #{battery_icon} #{battery_percentage} #{battery_remain} | #{online_status} | %a %h-%d %H:%M "
set -g status-right "Battery: #{battery_icon} #{battery_percentage} #{battery_remain} | %a %h-%d %H:%M "
setw -g mode-keys vi
set -g @shell_mode 'vi'
#set-option -g default-command "reattach-to-user-namespace -l zsh" # or bash...
#bind C-c run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
#bind C-v run "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer"
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
#set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-pain-control'
set -g @plugin 'tmux-plugins/tmux-cpu'
set -g @plugin 'tmux-plugins/tmux-battery'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com/user/plugin'
# set -g @plugin 'git@bitbucket.com/user/plugin'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
setw -g mode-keys vi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment