Created
June 7, 2020 15:36
-
-
Save bmartel/5386d5afe9aa1d57d7585b4747ddf95b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# make sure there is no delay in the esacpe sequence | |
set -g escape-time 10 | |
# use C-a, since it's on the home row and easier to hit than C-b | |
set-option -g prefix C-a | |
unbind-key C-a | |
bind-key C-a send-prefix | |
set -g base-index 1 | |
# Easy config reload | |
bind-key R source-file ~/.tmux.conf \; display-message "tmux.conf reloaded." | |
# vi is good | |
set -g status-keys vi | |
setw -g mode-keys vi | |
# mouse behavior | |
set -g mouse on | |
set-option -g default-terminal screen-256color | |
bind-key : command-prompt | |
bind-key r refresh-client | |
bind-key L clear-history | |
bind-key space next-window | |
bind-key bspace previous-window | |
bind-key enter next-layout | |
# use vim-like keys for splits and windows | |
bind-key v split-window -h | |
bind-key s split-window -v | |
bind-key h select-pane -L | |
bind-key j select-pane -D | |
bind-key k select-pane -U | |
bind-key l select-pane -R | |
# smart pane switching with awareness of vim splits | |
# bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-h) || tmux select-pane -L" | |
# bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-j) || tmux select-pane -D" | |
# bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-k) || tmux select-pane -U" | |
# bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-l) || tmux select-pane -R" | |
# bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys 'C-\\') || tmux select-pane -l" | |
# bind C-l send-keys 'C-l' | |
bind-key C-o rotate-window | |
bind-key + select-layout main-horizontal | |
bind-key = select-layout main-vertical | |
set-window-option -g other-pane-height 25 | |
set-window-option -g other-pane-width 80 | |
bind-key a last-pane | |
bind-key q display-panes | |
bind-key c new-window | |
bind-key t next-window | |
bind-key T previous-window | |
bind-key [ copy-mode | |
bind-key ] paste-buffer | |
# Setup 'v' to begin selection as in Vim | |
bind-key -T copy-mode-vi v send-keys -X begin-selection | |
bind-key -T copy-mode-vi y send-keys -X copy-pipe "reattach-to-user-namespace pbcopy" | |
# Update default binding of `Enter` to also use copy-pipe | |
unbind -T copy-mode-vi Enter | |
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe "reattach-to-user-namespace pbcopy" | |
set-window-option -g display-panes-time 1500 | |
# Status Bar | |
set-option -g status-interval 2 | |
set-option -g status-left '' | |
set-option -g status-right '%l:%M%p' | |
set-window-option -g window-status-current-fg magenta | |
set-option -g status-fg default | |
# Status Bar solarized-dark (default) | |
set-option -g status-bg black | |
set-option -g pane-active-border-fg yellow | |
set-option -g pane-border-fg cyan | |
# Status Bar solarized-light | |
if-shell "[ \"$COLORFGBG\" = \"11;15\" ]" "set-option -g status-bg white" | |
if-shell "[ \"$COLORFGBG\" = \"11;15\" ]" "set-option -g pane-active-border-fg white" | |
if-shell "[ \"$COLORFGBG\" = \"11;15\" ]" "set-option -g pane-border-fg white" | |
# Set window notifications | |
setw -g monitor-activity on | |
set -g visual-activity on | |
# Enable native Mac OS X copy/paste | |
# set-option -g default-command "/bin/bash -c 'which reattach-to-user-namespace >/dev/null && exec reattach-to-user-namespace $SHELL -l || exec $SHELL -l'" | |
# Allow the arrow key to be used immediately after changing windows | |
set-option -g repeat-time 0 | |
bind-key b break-pane -d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment