Find file
Fetching contributors…
Cannot retrieve contributors at this time
67 lines (50 sloc) 2.14 KB
# Sets prefix globally
unbind C-b
set -g prefix C-s
# Reload tmux.conf
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
# improve colors
set-option -g default-terminal "screen-256color"
# Set prompt behavior like emacs
set-option -g status-keys "emacs"
# Set length of char in status bar left
set-option -g status-left-length 50
# Change status bar color from harsh green to pink
set-option -g status-bg '#d33682'
set-option -g status-fg black
# Show session name in the status left, empty status right
set -g status-left ' [#S] '
set -g status-right ''
# More intuitive panes split and remember current path
bind-key - split-window -v -c '#{pane_current_path}'
bind-key \ split-window -h -c '#{pane_current_path}'
# Smart pane switching with awareness of vim splits
# See:
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(diff)?$"'
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# Resize panes using shift key
bind -n S-Left resize-pane -L 2
bind -n S-Right resize-pane -R 2
bind -n S-Down resize-pane -D 1
bind -n S-Up resize-pane -U 1
# Remember current patch when creating new window
bind c new-window -c '#{pane_current_path}'
# Set base-index to 1 (useful for switching between windows)
set-option -g base-index 1
set-option -g renumber-windows on
# Set break-pane and detach (-d) while keeping focus on current window
bind-key b break-pane -d
# Easily go to tmux choose-tree to navigate between sessions
bind-key C-j choose-tree
# Use vim keybindings in copy mode
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"