Skip to content

Commit

Permalink
Support multiple tmux versions in tmux.conf (Closes #119)
Browse files Browse the repository at this point in the history
  • Loading branch information
chros authored and chros committed Aug 14, 2017
1 parent 084ad3a commit ed6c783
Showing 1 changed file with 29 additions and 36 deletions.
65 changes: 29 additions & 36 deletions ubuntu-14.04/home/chros73/.tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,47 @@ bind a send-prefix
bind C-a last-window
bind '"' choose-window

# Rebind pane splitting
# Rebind pane splitting C-a - , C-a _
unbind %
bind - split-window -v
bind _ split-window -h
#bind-key | split-window -h

# Bind Power detach and logout to C-a C-d
bind C-d detach -P

# C-a D : get a list all sessions with their current dimension and choose which client you want to detach from the session

# Rebind r to force a reload of the config file: C-a r
unbind r
bind r source-file ~/.tmux.conf

# Set status bar
set -g status-bg colour236
set -g status-fg white
#set -g status-left '#[fg=green]#H'
set -g status-left ""
set -g status-right "#[fg=green]#H"

# Highlight active window
set-window-option -g window-status-current-bg colour164

# Bind toggle status line to T: C-a T
bind T set-option -g status

# use UTF8
set -g utf8
set-window-option -g utf8 on

# Allows for faster key repetition
set -s escape-time 0
# Set 256 color display, use new tmux-256color if available
if-shell '[ -f /usr/share/terminfo/t/tmux-256color ]' \
'set -g default-terminal "tmux-256color"' \
'set -g default-terminal "screen-256color"'


#set 256 color display
set -g default-terminal "screen-256color"
# Fix cursor keys when connecting with putty-256color TERM setting in v2.2-2.3
if-shell "tmux -V | awk '{exit !($2 >= 2.2 && $2 < 2.4)}'" \
'set -g terminal-overrides "putty*:kLFT@:kRIT@:kLFT5=\eOD:kRIT5=\eOC:kUP5=\eOA:kDN5=\eOB:smkx@:rmkx@"'


# Allows for faster key repetition
set -s escape-time 0

# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
Expand All @@ -51,36 +57,23 @@ setw -g aggressive-resize on
# Activity monitoring
setw -g monitor-activity on

# Refresh the status bar every 30 seconds. Try to keep the nzb folder to a reasonable number
set-option -g status-interval 30

# Example of using a shell command in the status line
#set -g status-right "#[fg=yellow]#(free -m | grep '+' | awk '{ print \"Ram: \"$3\" MB Free: \"$4\" MB\";}')#(free -m | grep 'Swap' | awk '{ print \" Swap: \"$3\" MB\";}') #[fg=cyan]%m-%d-%Y #(uptime)"

set-option -g status-right-length 200
# Set memory and scrollback buffer
set -g history-limit 50000

# Set display message timeout
set-option -g display-time 4000

#reduce memory and scrollback buffer
set -g history-limit 1000

# Mouse - allows select pane and resize with mouse (changed in v2.1)
if-shell "tmux -V | awk '{exit !($2 < 2.1)}'" \
'set -g mode-mouse on; set -g mouse-resize-pane on; set -g mouse-select-pane on; set -g mouse-select-window on' \
'set -g mouse on'

#mouse - allows selct pane and resize with mouse
set -g mode-mouse on
set -g mouse-resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on

bind m \
set -g mode-mouse on \;\
set -g mouse-resize-pane on \;\
set -g mouse-select-pane on \;\
set -g mouse-select-window on \;\
display 'Mouse: ON'
# Refresh the status bar every 30 seconds. Try to keep the nzb folder to a reasonable number
#set-option -g status-interval 30

bind M \
set -g mode-mouse off \;\
set -g mouse-resize-pane off \;\
set -g mouse-select-pane off \;\
set -g mouse-select-window off \;\
display 'Mouse: OFF'
# Example of using a shell command in the status line
#set -g status-right "#[fg=yellow]#(free -m | grep '+' | awk '{ print \"Ram: \"$3\" MB Free: \"$4\" MB\";}')#(free -m | grep 'Swap' | awk '{ print \" Swap: \"$3\" MB\";}') #[fg=cyan]%m-%d-%Y #(uptime)"
#set-option -g status-right-length 200

0 comments on commit ed6c783

Please sign in to comment.