Skip to content

Instantly share code, notes, and snippets.

@mehar
Last active December 16, 2017 11:35
Show Gist options
  • Save mehar/10bdbfb3db882f2ff4c36d5f861798b7 to your computer and use it in GitHub Desktop.
Save mehar/10bdbfb3db882f2ff4c36d5f861798b7 to your computer and use it in GitHub Desktop.
# Set the base index for windows to 1 instead of 0
set -g base-index 1
# Set the base index for panesl to 1 instead of 0
setw -g pane-base-index 1
# Reload tmx configuration
bind r source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf!"
# Ensure we can send Ctrl+b to other apps
bind C-b send-prefix
# Kill Session - TODO
bind X confirm-before kill-session
# Splitting panes with | and -
bind | split-window -h
bind - split-window -v
# Moving between panes using h,j,k,l
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Resizing panes
bind H resize-pane -L 5
bind J resize-pane -D 5
bind K resize-pane -U 5
bind L resize-pane -R 5
# Set mouse on
set -g mouse on
# Set the default terminal mode to 256 color mode
set -g default-terminal "screen-256color"
# Change default green status bar
set -g status-style bold,fg=white,bg=black
# Set the color of the window list
setw -g window-status-style bold,fg=cyan,bg=black
# Set colors for the active window
setw -g window-status-current-style bold,fg=white,bg=red
# Set Pane titles
setw -g pane-border-status top
setw -g pane-border-format "#{pane_index}:#{pane_title}#{?pane_synchronized, SYNC,} #{pane_current_command}"
# Colors for pane borders
setw -g pane-border-style fg=white,bg=black
setw -g pane-active-border-style fg=green
#setw -g pane-active-border-bg default
# Active pane normal, other faded out
setw -g window-style fg=colour245,bg=black
setw -g window-active-style fg=white,bg=black
# Command/Message line style
set -g message-style bold,fg=white,bg=black
# Status line left side to show Session:Window:Pane
set -g status-left-length 40
set -g status-left "#[fg=green]Session: #S #[fg=yellow]#I #[fg=cyan]#P "
# Status line right side
set -g status-right "#[fg=cyan]%d %b %R"
# Center the window list in the status line
set -g status-justify centre
# Enable acitivity alerts
setw -g monitor-activity on
set -g visual-activity on
# Enable vi keys
setw -g mode-keys vi
# Synchronize panes to run commands on all panes
bind C-s set-window-option synchronize-panes
# OS X (MAC) Copy/Paste
# Prerequisite: brew install reattach-to-user-namespace
set -g default-command "reattach-to-user-namespace -l /bin/bash"
bind C-c run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
# Visual select/copy (VI Copy Mode)
# Enable vi keys
setw -g mode-keys vi
# Show help
# Bash shortcuts
bind C-h run-shell 'markdown-cli ~/README.md'
# Pane resizing panes with Prefix H,J,K,L. Press repeatedly until satisfied
bind -r h resize-pane -L 5
bind -r j resize-pane -D 5
bind -r k resize-pane -U 5
bind -r l resize-pane -R 5
# Toggle Windows
bind -r n next-window
bind -r p previous-window
# Toggle layouts
bind -r Space next-layout
bind -n M-F11 setw -g window-status-style bold,fg=colour246,bg=black
bind -n M-F12 setw -g window-status-style bold,fg=cyan,bg=black
bind -n M-Up \
setw -g window-status-style bold,fg=colour246,bg=black \; \
set -qg prefix C-a \; \
display "Up Pressed"
bind -n M-Down \
setw -g window-status-style bold,fg=cyan,bg=black \; \
set -qg prefix C-b \; \
display "Down Pressed"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment