Skip to content

Instantly share code, notes, and snippets.

@stefthoen
Created July 8, 2014 19:20
Show Gist options
  • Save stefthoen/5c04ed054f33274e804d to your computer and use it in GitHub Desktop.
Save stefthoen/5c04ed054f33274e804d to your computer and use it in GitHub Desktop.
# TODO:
# - Maximize and restore a pane with Up-arrow and Down-arrow
# - Fix probleem met lijnregels als je kopieert uit Vim
# Set new leader
unbind C-b
set -g prefix C-a
# Set index of window and pane
set -g base-index 1
setw -g pane-base-index 1
# Force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf \; display "tmux.conf reloaded!"
# Save C-a for other programs / Press C-a twice
bind C-a send-prefix
# Fix pbcopy in Tmux
# Rebind window splits
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# Resize panes
bind -r h resize-pane -L
bind -r j resize-pane -D
bind -r k resize-pane -U
bind -r l resize-pane -R
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
# Mouse
setw -g mode-mouse off
# Kill session
bind X kill-session
# Switch sessions
bind -r ( switch-client -p
bind -r ( switch-client -n
# Keeps eye on other windows
setw -g monitor-activity on
set -g visual-activity on
# Set default shell
set-option -g default-shell /usr/local/bin/zsh
# Set colors for iTerm
set -g default-terminal "screen-256color"
# Use vim bindings
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
# Update default binding of `Enter` to also use copy-pipe
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
# Smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys 'C-\\') || tmux select-pane -l"
set -g status-justify centre
#### COLOUR (Solarized 256)
# default statusbar colors
set-option -g status-bg default #base02
set-option -g status-fg colour136 #yellow
set-option -g status-attr default
# default window title colors
set-window-option -g window-status-fg colour244 #base0
set-window-option -g window-status-bg default
#set-window-option -g window-status-attr dim
# active window title colors
set-window-option -g window-status-current-fg colour166 #orange
set-window-option -g window-status-current-bg default
#set-window-option -g window-status-current-attr bright
# pane border
set-option -g pane-border-fg colour235 #base02
set-option -g pane-active-border-fg colour240 #base01
# message text
set-option -g message-bg colour235 #base02
set-option -g message-fg colour166 #orange
# pane number display
set-option -g display-panes-active-colour colour33 #blue
set-option -g display-panes-colour colour166 #orange
# clock
set-window-option -g clock-mode-colour colour64 #green
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment