1
0
Fork 0
mirror of synced 2024-12-22 06:41:07 -05:00

updated to tmux 1.9+

This commit is contained in:
Gregory Pakosz 2014-02-28 11:41:39 +01:00
parent a1114ec47b
commit 9b001164f0
2 changed files with 34 additions and 25 deletions

View file

@ -6,7 +6,7 @@
set -g default-terminal "screen-256color" # colors! set -g default-terminal "screen-256color" # colors!
setw -g xterm-keys on setw -g xterm-keys on
set -s escape-time 0 # fastest command sequences set -s escape-time 0 # fastest command sequences
set -s repeat-time 600 # increase repeat timeout set -sg repeat-time 600 # increase repeat timeout
set -s quiet on # disable various messages set -s quiet on # disable various messages
set -g prefix2 C-a # GNU-Screen compatible prefix set -g prefix2 C-a # GNU-Screen compatible prefix
@ -20,7 +20,7 @@ bind C-a send-prefix -2
set -g status-utf8 on # expect UTF-8 set -g status-utf8 on # expect UTF-8
setw -g utf8 on setw -g utf8 on
set history-limit 5000 # boost history set -g history-limit 5000 # boost history
# edit configuration # edit configuration
bind e new-window -n '~/.tmux.conf' '${EDITOR:-vim} ~/.tmux.conf && tmux source ~/.tmux.conf && tmux display "~/.tmux.conf sourced"' bind e new-window -n '~/.tmux.conf' '${EDITOR:-vim} ~/.tmux.conf && tmux source ~/.tmux.conf && tmux display "~/.tmux.conf sourced"'
@ -74,10 +74,13 @@ bind C-c new-session
# find session # find session
bind C-f command-prompt -p find-session 'switch-client -t %%' bind C-f command-prompt -p find-session 'switch-client -t %%'
# split current window vertically # split current window vertically, retain current path
bind _ split-window -h bind '"' split-window -h -c "#{pane_current_path}"
# split current window horizontally bind _ split-window -h -c "#{pane_current_path}"
bind - split-window -v # split current window horizontally, retain current path
unbind %
bind % split-window -v -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# pane navigation # pane navigation
bind -r h select-pane -L # move left bind -r h select-pane -L # move left
@ -165,30 +168,30 @@ run 'for name in $(printenv | grep -Eo ^tmux_conf_[^=]+); do tmux setenv -gu $na
# pane_border_fg=colour238 # light gray # pane_border_fg=colour238 # light gray
# pane_active_border_fg=colour39 # light blue # pane_active_border_fg=colour39 # light blue
# #
# tmux set -g pane-border-fg $pane_border_fg \; set -g pane-active-border-fg $pane_active_border_fg # tmux set -g pane-border-style fg=$pane_border_fg \; set -g pane-active-border-style fg=$pane_active_border_fg
# #uncomment for fat borders # #uncomment for fat borders
# #tmux set -g pane-border-bg $pane_border_fg \; set -g pane-active-border-bg $pane_active_border_fg # #tmux set -ga pane-border-style bg=$pane_border_fg \; set -ga pane-active-border-style bg=$pane_active_border_fg
# #
# display_panes_active_colour=colour39 # light blue # display_panes_active_colour=colour39 # light blue
# display_panes_colour=colour39 # light blue # display_panes_colour=colour39 # light blue
# tmux set -g display-panes-active-colour $display_panes_active_colour \; set -g display-panes-colour $display_panes_colour # tmux set -g display-panes-active-colour $display_panes_active_colour \; set -g display-panes-colour $display_panes_colour
# #
# # messages # # messages
# message_attr=bold
# message_fg=colour16 #black # message_fg=colour16 #black
# message_bg=colour226 #yellow # message_bg=colour226 #yellow
# tmux set -g message-attr $message_attr \; set -g message-fg $message_fg \; set -g message-bg $message_bg # message_attr=bold
# tmux set -g message-style fg=$message_fg,bg=$message_bg,$message_attr
# #
# # windows mode # # windows mode
# mode_attr=bold
# mode_fg=colour16 #black # mode_fg=colour16 #black
# mode_bg=colour226 #yellow # mode_bg=colour226 #yellow
# tmux setw -g mode-attr $mode_attr \; set -g mode-fg $mode_fg \; set -g mode-bg $mode_bg # mode_attr=bold
# tmux setw -g mode-style fg=$mode_fg,bg=$mode_bg,$mode_attr
# #
# # status line # # status line
# status_fg=colour253 # white # status_fg=colour253 # white
# status_bg=colour232 # dark gray # status_bg=colour232 # dark gray
# tmux set -g status-fg $status_fg \; set -g status-bg $status_bg # tmux set -g status-style fg=$status_fg,bg=$status_bg
# #
# session_fg=colour16 # black # session_fg=colour16 # black
# session_bg=colour226 # yellow # session_bg=colour226 # yellow
@ -198,7 +201,7 @@ run 'for name in $(printenv | grep -Eo ^tmux_conf_[^=]+); do tmux setenv -gu $na
# window_status_fg=colour245 # light gray # window_status_fg=colour245 # light gray
# window_status_bg=colour232 # dark gray # window_status_bg=colour232 # dark gray
# window_status_format="#I #W" # window_status_format="#I #W"
# tmux setw -g window-status-fg "$window_status_fg" \; setw -g window-status-bg "$window_status_bg" \; setw -g window-status-format "$window_status_format" # tmux setw -g window-status-style fg="$window_status_fg",bg="$window_status_bg" \; setw -g window-status-format "$window_status_format"
# #
# window_status_current_fg=colour16 # black # window_status_current_fg=colour16 # black
# window_status_current_bg=colour39 # light blue # window_status_current_bg=colour39 # light blue
@ -206,10 +209,10 @@ run 'for name in $(printenv | grep -Eo ^tmux_conf_[^=]+); do tmux setenv -gu $na
# tmux setw -g window-status-current-format "$window_status_current_format" # tmux setw -g window-status-current-format "$window_status_current_format"
# tmux set -g status-justify left # tmux set -g status-justify left
# #
# window_status_activity_attr=underscore
# window_status_activity_fg=default # window_status_activity_fg=default
# window_status_activity_bg=default # window_status_activity_bg=default
# tmux setw -g window-status-activity-attr "$window_status_activity_attr" \; setw -g window-status-activity-fg "$window_status_activity_fg" \; setw -g window-status-activity-bg "$window_status_activity_bg" # window_status_activity_attr=underscore
# tmux setw -g window-status-activity-style fg=$window_status_activity_fg,bg=$window_status_activity_bg,$window_status_activity_attr
# #
# time_date_fg=colour245 # light gray # time_date_fg=colour245 # light gray
# time_date_bg=colour232 # dark gray # time_date_bg=colour232 # dark gray
@ -237,24 +240,24 @@ run 'for name in $(printenv | grep -Eo ^tmux_conf_[^=]+); do tmux setenv -gu $na
# } # }
# #
# maximize_pane() { # maximize_pane() {
# __current_pane=$(tmux display -p '#D') # tmux -V |grep -q '1.9a\?$' && tmux display "tmux 1.9 and 1.9a have a bug that prevent this feature from working" && return
# # __current_pane=$(tmux display -p '#{pane_id}')
#
# __dead_panes=$(tmux list-panes -s -F '#{pane_dead} #{pane_id} #{pane_title}' | grep -o '^1 %.\+%.\+$' || true) # __dead_panes=$(tmux list-panes -s -F '#{pane_dead} #{pane_id} #{pane_title}' | grep -o '^1 %.\+%.\+$' || true)
# __restore=$(echo "${__dead_panes}" | sed -n -E -e "s/^1 ${__current_pane} \[\+\](%[0-9]+)$/tmux swap-pane -s \1 -t ${__current_pane} \; kill-pane -t ${__current_pane}/p" -e "s/^1 (%[0-9]+) \[\+\]${__current_pane}$/tmux swap-pane -s \1 -t ${__current_pane} \; kill-pane -t \1/p" ) # __restore=$(echo "${__dead_panes}" | sed -n -E -e "s/^1 ${__current_pane} \[\+\](%[0-9]+)$/tmux swap-pane -s \1 -t ${__current_pane} \; kill-pane -t ${__current_pane}/p" -e "s/^1 (%[0-9]+) \[\+\]${__current_pane}$/tmux swap-pane -s \1 -t ${__current_pane} \; kill-pane -t \1/p" )
# #
# if [ x"${__restore}" = x ] ; then # if [ x"${__restore}" = x ] ; then
# [ x"$(tmux list-panes | wc -l | sed 's/^ *//g')" = x1 ] && tmux display "Can't maximize with only one pane" && return # [ x"$(tmux list-panes | wc -l | sed 's/^ *//g')" = x1 ] && tmux display "Can't maximize with only one pane" && return
#
# __window=$(tmux new-window -P "exec maximized+ 2> /dev/null | tmux setw remain-on-exit on && printf '\033]2;%s\033\\' [+]${__current_pane}") # __window=$(tmux new-window -P "exec maximized+ 2> /dev/null | tmux setw remain-on-exit on && printf '\033]2;%s\033\\' [+]${__current_pane}")
# __window=${__window%.*} # __window=${__window%.*}
# #
# __guard=100 # __guard=100
# while ( [ x"$(tmux list-panes -t ${__window} -F '#S:#I #{pane_dead}')" != x"${__window} "1 ] && [ x"${__guard}" != x0 ] ) ; do sleep 0.01 ; _guard=$((__guard - 1)) ; done # while ( [ x"$(tmux list-panes -t ${__window} -F '#{session_name}:#{window_index} #{pane_dead}')" != x"${__window} "1 ] && [ x"${__guard}" != x0 ] ) ; do sleep 0.01 ; _guard=$((__guard - 1)) ; done
# if [ x"${__guard}" = 0 ] ; then # if [ x"${__guard}" = 0 ] ; then
# exit 1 # exit 1
# fi # fi
# #
# __new_pane=$(tmux display -p '#D') # __new_pane=$(tmux display -p '#{pane_id}')
# tmux setw remain-on-exit off \; swap-pane -s "${__current_pane}" -t "${__new_pane}" # tmux setw remain-on-exit off \; swap-pane -s "${__current_pane}" -t "${__new_pane}"
# else # else
# ${__restore} # ${__restore}

View file

@ -5,12 +5,18 @@ Self-contained, opinionated `.tmux.conf` configuration file.
![Screenshot](screenshot.png) ![Screenshot](screenshot.png)
The `master` branch targets tmux 1.9+. You may want to use the `1.7` or `1.8`
branch.
**Please note that tmux 1.9 and 1.9a SEGFAULT when using the maximize pane
feature. As a consequence, the feature is disabled for those version.**
Features Features
-------- --------
- `C-a` acts as secondary prefix, while keeping default `C-b` prefix - `C-a` acts as secondary prefix, while keeping default `C-b` prefix
- visual theme inspired by [powerline](https://github.com/Lokaltog/powerline) - visual theme inspired by [powerline](https://github.com/Lokaltog/powerline)
- [maximize any pane to a new window with `<prefix>+`](http://pempek.net/articles/2013/04/14/maximizing-tmux-pane-new-window/) (tmux 1.6+) - [maximize any pane to a new window with `<prefix>+`](http://pempek.net/articles/2013/04/14/maximizing-tmux-pane-new-window/) (tmux 1.6+, except 1.9 and 1.9a)
- mouse mode toggle with `<prefix>m` - mouse mode toggle with `<prefix>m`
- automatic usage of `reattach-to-user-namespace` if available - automatic usage of `reattach-to-user-namespace` if available
- laptop battery status - laptop battery status