Skip to content

Instantly share code, notes, and snippets.

@ivan4th
Created September 28, 2019 06:24
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 ivan4th/d97248e1f1530c93d84bfa64e5e5e10c to your computer and use it in GitHub Desktop.
Save ivan4th/d97248e1f1530c93d84bfa64e5e5e10c to your computer and use it in GitHub Desktop.
tmux on mac
# http://www.hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/
unbind C-b
set -g prefix C-a
bind C-a send-prefix
set -g mouse on
# https://gist.github.com/miguelmota/71ab27e1ec2c80759d8ea975b8ec855b
# bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# bind-key -T copy-mode MouseDragEnd1Pane send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel "pbcopy"
bind-key -T copy-mode MouseDragEnd1Pane send -X copy-pipe-and-cancel "pbcopy"
set -g default-terminal "screen-256color"
# set -g status-bg colour235
# set -g status-fg white
set-option -g allow-rename off
# 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 r source-file ~/.tmux.conf
bind-key x kill-pane
bind-key a send-prefix
######################
### DESIGN CHANGES ###
######################
# panes
set -g pane-border-style fg=black
set -g pane-active-border-style fg=brightred
## Status bar design
# status line
set -g status-justify left
set -g status-style bg=default,fg=colour12
set -g status-interval 2
# messaging
set -g message-style fg=black,bg=yellow
set -g message-command-style fg=blue,bg=black
#window mode
setw -g mode-style bg=colour6,fg=colour0
# window status
setw -g window-status-format " #F#I:#W#F "
setw -g window-status-current-format " #F#I:#W#F "
setw -g window-status-format "#[fg=magenta]#[bg=black] #I #[bg=cyan]#[fg=colour8] #W "
setw -g window-status-current-format "#[bg=brightmagenta]#[fg=colour8] #I #[fg=colour8]#[bg=colour14] #W "
setw -g window-status-current-style bg=colour0,fg=colour11,dim
setw -g window-status-style bg=green,fg=black,reverse
# Info on left (I don't have a session display for now)
set -g status-left ''
# loud or quiet?
set-option -g visual-activity off
set-option -g visual-bell off
set-option -g visual-silence off
set-window-option -g monitor-activity off
set-option -g bell-action none
set -g default-terminal "screen-256color"
# The modes {
setw -g clock-mode-colour colour135
setw -g mode-style fg=colour196,bg=colour238
# }
# The panes {
set -g pane-border-style bg=colour235,fg=colour238
set -g pane-active-border-style bg=colour236,fg=colour51
# }
# The statusbar {
set -g status-position bottom
set -g status-style bg=colour234,fg=colour137,dim
set -g status-left ''
set -g status-right '#[fg=colour233,bg=colour241,bold] %d/%m #[fg=colour233,bg=colour245,bold] %H:%M:%S '
set -g status-right-length 50
set -g status-left-length 20
setw -g window-status-current-style fg=colour81,bg=colour238,bold
setw -g window-status-current-format ' #I#[fg=colour250]:#[fg=colour255]#T#[fg=colour50]#F '
setw -g window-status-style fg=colour138,bg=colour235
setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#T#[fg=colour244]#F '
setw -g window-status-bell-style fg=colour255,bg=colour1,bold
# }
# The messages {
set -g message-style fg=colour232,bg=colour166,bold
# }
set-option -g history-limit 10000
# https://unix.stackexchange.com/questions/26548/write-all-tmux-scrollback-to-a-file
bind-key P command-prompt -p 'save history to filename:' -I '~/tmux.history' 'capture-pane -S -32768 ; save-buffer %1 ; delete-buffer'
set -g default-shell $SHELL
#set -g default-command "reattach-to-user-namespace -l ${SHELL}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment