Skip to content

Instantly share code, notes, and snippets.

@nkreeger
Last active November 24, 2020 02:33
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 nkreeger/0318e143121b6db39d14d92b711f79f7 to your computer and use it in GitHub Desktop.
Save nkreeger/0318e143121b6db39d14d92b711f79f7 to your computer and use it in GitHub Desktop.
set-option -g default-shell /bin/zsh
set -g default-terminal "screen-256color"
set -ga terminal-overrides ",xterm-256color*:Tc"
# 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
setw -g mode-keys vi
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 -c "#{pane_current_path}"
bind-key s split-window -v -c "#{pane_current_path}"
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 -c "#{pane_current_path}"
bind-key t next-window
bind-key T previous-window
bind-key [ copy-mode
bind-key ] paste-buffer
set-window-option -g display-panes-time 1500
##############################
# Dark background Color Theme:
set-option -g status-right-length 100
# set-window-option -g window-status-current-bg white
# set-option -gw window-status-activity-bg black
# set-option -gw window-status-activity-fg magenta
set-option -g status-bg blue
set-option -g status-right '#(hostname) [#{pane_pid}] %a %b %d - %H:%M'
set -g window-status-activity-style fg=black,bg=blue
set -g window-status-current-style fg=black,bg=white
# /end dark color theme
# 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
set-option -g status-right '#(hostname) [#S] %H:%M'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment