set -g default-terminal "screen-256color"
set -g terminal-overrides 'xterm:colors=256'

set -s escape-time 0

set-option -g status-interval 1

set -g base-index 1

setw -g pane-base-index 1

#set -g window-style 'bg=colour239'
#set -g window-active-style 'bg=colour234'

set -g prefix C-x

#bind - split-window -v

#bind \ split-window -h
bind-key \\ split-window -h
bind-key - split-window -v
# ペインの縦分割
#bind m split-window -vc "#{pane_current_path}"
# ペインの横分割
#bind n split-window -hc "#{pane_current_path}"

bind -n S-left select-pane -L
bind -n S-down select-pane -D
bind -n S-up select-pane -U
bind -n S-right select-pane -R

# Shift arrow to switch windows
bind -n C-Left  previous-window
bind -n C-Right next-window

bind -n C-o select-pane -t :.+

bind e setw synchronize-panes \; display "synchronize-panes #{?pane_synchronized,on,off}"

# Prefix+v でコピーモード開始
bind-key v copy-mode \; display "Copy mode!"
#bind-key -t vi-copy v begin-selection

# Prefix+p でペースト
# クリップボードにも保存されているので Cmd-v でもペースト可能
bind-key p paste-buffer

set-option -g status-justify "centre"

set-option -g status-bg "colour238"

set-option -g status-fg "colour255"

set-option -g status-left-length 20

set-option -g status-left "#[fg=colour255,bg=colour241]Session: #S #[default]"

set-window-option -g window-status-format " #I: #W "

set-window-option -g window-status-current-format "#[fg=colour255,bg=colour27,bold] #I: #W #[default]"

set-option -g status-right-length 60

set-option -g status-right "#[fg=colour255,bg=colour241] #h | LA: #(cut -d' ' -f-3 /proc/loadavg) | %m/%d %H:%M:%S#[default]"

set-option -g mouse on

bind -n WheelUpPane   select-pane -t= \; copy-mode -e \; send-keys -M
bind -n WheelDownPane select-pane -t= \;                 send-keys -M
#set-window-option -g mode-mouse on
#set-option -g mouse-select-window on
#set-option -g mouse-resize-pane on
#set-option -g mouse-select-pane on