# $Id: n-marriott.conf,v 1.11 2009-11-24 19:03:59 nicm Exp $
#
# By Nicholas Marriott. Public domain.

#set -g default-terminal "xterm-256color"
set -g default-terminal "tmux-256color"
#set -g default-terminal "screen"
#set -g default-terminal "rxvt-unicode-256color"
#set -g default-terminal "tmux-256color"
set-window-option -g xterm-keys on
setw -g mode-keys vi

bind -T root C-j  \
  set prefix None \;\
  set key-table off \;\
  set status-style "fg=$color_status_text,bg=$color_window_off_status_bg" \;\
  set window-status-current-format "#[fg=$color_window_off_status_bg,bg=$color_window_off_status_current_bg]$separator_powerline_right#[default] #I:#W# #[fg=$color_window_off_status_current_bg,bg=$color_window_off_status_bg]$separator_powerline_right#[default]" \;\
  set window-status-current-style "fg=$color_dark,bold,bg=$color_window_off_status_current_bg" \;\
  if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
  refresh-client -S \;\

bind -T off C-j \
  set -u prefix \;\
  set -u key-table \;\
  set -u status-style \;\
  set -u window-status-current-style \;\
  set -u window-status-current-format \;\
  display "Local key table ON" \;\
  refresh-client -S
  
wg_is_keys_off="#[fg=$color_light,bg=$color_window_off_indicator]#([ $(tmux show-option -qv key-table) = 'off' ] && echo 'OFF')#[default]"

#set -g status-right "$wg_is_keys_off #{sysstat_cpu} | #{sysstat_mem} | #{sysstat_loadavg} | $wg_user_host"

# Default global options.
#set -g status-bg green
#set -g status-right "%H:%M" # %d-%b-%y
#set -g bell-action none
#set -g lock-after-time 1800

# Window title stuff
set-option -g set-titles on
set-option -g set-titles-string "#H:#S|#W"
# Default global window options.
setw -g remain-on-exit off

set-option -ga terminal-overrides ',*:enacs@:smacs@:rmacs@:acsc@'
#set -g utf8 on
# Prefix key.
#set -g prefix 
#unbind C-b
#bind C-b send-prefix

#bind y setw force-width 81
#bind u setw force-width 0

# *word stuff
bind -n C-Right send Oc
bind -n C-Left  send Od

# Window management
bind-key c command-prompt -p new-window "new-window -n %1"
bind-key N command-prompt -p new-session "new-session -s %1"
bind n next-window
bind p previous-window

#synchronize panes
bind a set synchronize-panes

# turn off escape delay
set -sg escape-time 0

# Split windows
bind - split-window -v
bind | split-window -h
bind l select-pane -R
bind k select-pane -U
bind j select-pane -D
bind h select-pane -L
unbind -n M-l
unbind -n M-k
unbind -n M-j
unbind -n M-h
#bind -n M-l select-pane -R
#bind -n M-k select-pane -U
#bind -n M-j select-pane -D
#bind -n M-h select-pane -L
#bind -n M-l resize-pane -R
#bind -n M-k resize-pane -U
#bind -n M-j resize-pane -D
#bind -n M-h resize-pane -L

# unsplit pane
bind q break-pane


# Unbind Ctrl-Shift-Insert
unbind C-S-IC
#unbind -a C-Left
#unbind -a C-Right

# mouse stuff
#set-window-option -g mode-mouse on
set -g mouse off
#set-option -g mouse-select-pane on

# scrollback history
set -g history-limit 30000

# keep session list sorted
bind s choose-tree -sZ -O name

# This tmux statusbar config was created by tmuxline.vim
# # on Sun, 20 Oct 2019
#
source-file ~/.tmux_colors.conf
#set -g status-justify "left"
#set -g status "on"
#set -g status-left-style "none"
#set -g message-command-style "fg=colour231,bg=colour31"
#set -g status-right-style "none"
#set -g pane-active-border-style "fg=colour254"
#set -g status-style "none,bg=colour234"
#set -g message-style "fg=colour231,bg=colour31"
#set -g pane-border-style "fg=colour240"
#set -g status-right-length "100"
#set -g status-left-length "100"
#setw -g window-status-activity-style "none"
#setw -g window-status-separator ""
#setw -g window-status-style "none,fg=colour250,bg=colour234"
#set -g status-left "#[fg=colour16,bg=colour254,bold] #S #[fg=colour254,bg=colour234,nobold,nounderscore,noitalics]"
#set -g status-right "$wg_is_keys_off #[fg=colour236,bg=colour234,nobold,nounderscore,noitalics]#[fg=colour247,bg=colour236] %Y-%m-%d  %H:%M #[fg=colour252,bg=colour236,nobold,nounderscore,noitalics]#[fg=colour235,bg=colour252] #h "
#setw -g window-status-format "#[fg=colour244,bg=colour234] #I #[fg=colour250,bg=colour234] #W "
#setw -g window-status-current-format "#[fg=colour234,bg=colour31,nobold,nounderscore,noitalics]#[fg=colour117,bg=colour31] #I #[fg=colour231,bg=colour31,bold] #W #[fg=colour31,bg=colour234,nobold,nounderscore,noitalics]"
#
