mirror of
1
0
Fork 0

made the theme more flexible by adding configuration variables

This commit is contained in:
Gregory Pakosz 2015-10-22 21:37:44 +02:00
parent 748dc7a19b
commit 921c6d14d0
3 changed files with 274 additions and 128 deletions

View File

@ -54,12 +54,6 @@ bind -n C-l send-keys C-l \; run 'tmux clear-history'
set -g monitor-activity on
set -g visual-activity off
# tmux theme, colors and status line
# available themes:
# - powerline (a powerline inspired theme)
# - powerline_patched_font (a powerline inspired theme using a patched font)
tmux_conf_theme=powerline
# -- navigation ----------------------------------------------------------------
@ -155,7 +149,7 @@ if '[ -f ~/.tmux.conf.local ]' 'source ~/.tmux.conf.local'
# -- 8< ------------------------------------------------------------------------
run 'cut -c3- ~/.tmux.conf | sh -s apply_theme $tmux_conf_theme'
run 'cut -c3- ~/.tmux.conf | sh -s apply_theme'
run 'cut -c3- ~/.tmux.conf | sh -s apply_configurable_bindings $tmux_conf_new_windows_retain_current_path $tmux_conf_new_panes_retain_current_path'
run 'for name in $(printenv | grep -Eo ^tmux_conf_[^=]+); do tmux setenv -gu $name; done;'
@ -166,101 +160,138 @@ run 'for name in $(printenv | grep -Eo ^tmux_conf_[^=]+); do tmux setenv -gu $na
# set -e
#
# apply_theme() {
# case "$1" in
# powerline_patched_font)
# tmux_conf_theme=${tmux_conf_theme:-default}
# case "${tmux_conf_theme}" in
# powerline|powerline_patched_font)
# left_separator=''
# left_separator_black=''
# right_separator=''
# right_separator_black=''
# session_symbol=''
# ;;
# powerline)
# ""|default)
# left_separator='|'
# left_separator_black=' '
# left_separator_black=''
# right_separator='|'
# right_separator_black=' '
# right_separator_black=''
# ;;
# esac
#
# case "$1" in
# powerline*)
# case "$tmux_conf_theme" in
# ""|default|powerline)
#
# # panes
# pane_border_fg=colour238 # light gray
# pane_active_border_fg=colour39 # light blue
# tmux_conf_theme_pane_border_fg=${tmux_conf_theme_pane_border_fg:-colour238} # light gray
# tmux_conf_theme_pane_active_border_fg=${tmux_conf_theme_pane_active_border_fg:-colour39} # light blue
#
# tmux set -g pane-border-style fg=$pane_border_fg \; set -g pane-active-border-style fg=$pane_active_border_fg
# tmux set -g pane-border-style fg=$tmux_conf_theme_pane_border_fg \; set -g pane-active-border-style fg=$tmux_conf_theme_pane_active_border_fg
# #uncomment for fat borders
# #tmux set -ga pane-border-style bg=$pane_border_fg \; set -ga pane-active-border-style bg=$pane_active_border_fg
# #tmux set -ga pane-border-style bg=$tmux_conf_theme_pane_border_fg \; set -ga pane-active-border-style bg=$tmux_conf_theme_pane_active_border_fg
#
# display_panes_active_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_conf_theme_display_panes_active_colour=${tmux_conf_theme_display_panes_active_colour:-colour39} # light blue
# tmux_conf_theme_display_panes_colour=${tmux_conf_theme_display_panes_colour:-colour39} # light blue
# tmux set -g display-panes-active-colour $tmux_conf_theme_display_panes_active_colour \; set -g display-panes-colour $tmux_conf_theme_display_panes_colour
#
# # messages
# message_fg=colour16 # black
# message_bg=colour226 # yellow
# message_attr=bold
# tmux set -g message-style fg=$message_fg,bg=$message_bg,$message_attr
# tmux_conf_theme_message_fg=${tmux_conf_theme_message_fg:-colour16} # black
# tmux_conf_theme_message_bg=${tmux_conf_theme_message_bg:-colour226} # yellow
# tmux_conf_theme_message_attr=${tmux_conf_theme_message_attr:-bold}
# tmux set -g message-style fg=$tmux_conf_theme_message_fg,bg=$tmux_conf_theme_message_bg,$tmux_conf_theme_message_attr
#
# message_command_fg=colour16 # black
# message_command_bg=colour160 # light yellow
# tmux set -g message-command-style fg=$message_command_fg,bg=$message_command_bg,$message_attr
# tmux_conf_theme_message_command_fg=${tmux_conf_theme_message_command_fg:-colour16} # black
# tmux_conf_theme_message_command_bg=${tmux_conf_theme_message_command_bg:-colour160} # light yellow
# tmux set -g message-command-style fg=$tmux_conf_theme_message_command_fg,bg=$tmux_conf_theme_message_command_bg,$tmux_conf_theme_message_attr
#
# # windows mode
# mode_fg=colour16 # black
# mode_bg=colour226 # yellow
# mode_attr=bold
# tmux setw -g mode-style fg=$mode_fg,bg=$mode_bg,$mode_attr
# tmux_conf_theme_mode_fg=${tmux_conf_theme_mode_fg:-colour16} # black
# tmux_conf_theme_mode_bg=${tmux_conf_theme_mode_bg:-colour226} # yellow
# tmux_conf_theme_mode_attr=${tmux_conf_theme_mode_attr:-bold}
# tmux setw -g mode-style fg=$tmux_conf_theme_mode_fg,bg=$tmux_conf_theme_mode_bg,$tmux_conf_theme_mode_attr
#
# # status line
# status_fg=colour253 # white
# status_bg=colour232 # dark gray
# tmux set -g status-style fg=$status_fg,bg=$status_bg
# tmux_conf_theme_status_fg=${tmux_conf_theme_status_fg:-colour253} # white
# tmux_conf_theme_status_bg=${tmux_conf_theme_status_bg:-colour232} # dark gray
# tmux set -g status-style fg=$tmux_conf_theme_status_fg,bg=$tmux_conf_theme_status_bg
#
# session_fg=colour16 # black
# session_bg=colour226 # yellow
# status_left="#[fg=$session_fg,bg=$session_bg,bold] ❐ #S #[fg=$session_bg,bg=$status_bg,nobold]$left_separator_black"
# tmux_conf_theme_session_fg=${tmux_conf_theme_session_fg:-colour16} # black
# tmux_conf_theme_session_bg=${tmux_conf_theme_session_bg:-colour226} # yellow
# status_left="#[fg=$tmux_conf_theme_session_fg,bg=$tmux_conf_theme_session_bg,bold] ❐ #S #[fg=$tmux_conf_theme_session_bg,bg=$tmux_conf_theme_status_bg,nobold]$left_separator_black"
# if [ x"`tmux -q -L tmux_theme_status_left_test -f /dev/null new-session -d \; show -g -v status-left \; kill-session`" = x"[#S] " ] ; then
# status_left="$status_left "
# fi
# tmux set -g status-left-length 32 \; set -g status-left "$status_left"
#
# window_status_fg=colour245 # light gray
# window_status_bg=colour232 # dark gray
# tmux_conf_theme_window_status_fg=${tmux_conf_theme_window_status_fg:-colour245} # light gray
# tmux_conf_theme_window_status_bg=${tmux_conf_theme_window_status_bg:-colour232} # dark gray
# window_status_format="#I #W"
# tmux setw -g window-status-style fg=$window_status_fg,bg=$window_status_bg \; setw -g window-status-format "$window_status_format"
# tmux setw -g window-status-style fg=$tmux_conf_theme_window_status_fg,bg=$tmux_conf_theme_window_status_bg \; setw -g window-status-format "$window_status_format"
#
# window_status_current_fg=colour16 # black
# window_status_current_bg=colour39 # light blue
# window_status_current_format="#[fg=$window_status_bg,bg=$window_status_current_bg]$left_separator_black#[fg=$window_status_current_fg,bg=$window_status_current_bg,bold] #I $left_separator #W #[fg=$window_status_current_bg,bg=$status_bg,nobold]$left_separator_black"
# tmux_conf_theme_window_status_current_fg=${tmux_conf_theme_window_status_current_fg:-colour16} # black
# tmux_conf_theme_window_status_current_bg=${tmux_conf_theme_window_status_current_bg:-colour39} # light blue
# window_status_current_format="#[fg=$tmux_conf_theme_window_status_bg,bg=$tmux_conf_theme_window_status_current_bg]$left_separator_black#[fg=$tmux_conf_theme_window_status_current_fg,bg=$tmux_conf_theme_window_status_current_bg,bold] #I $left_separator #W #[fg=$tmux_conf_theme_window_status_current_bg,bg=$tmux_conf_theme_status_bg,nobold]$left_separator_black"
# tmux setw -g window-status-current-format "$window_status_current_format"
# tmux set -g status-justify left
#
# window_status_activity_fg=default
# window_status_activity_bg=default
# 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
# tmux_conf_theme_window_status_activity_fg=${tmux_conf_theme_window_status_activity_fg:-default}
# tmux_conf_theme_window_status_activity_bg=${tmux_conf_theme_window_status_activity_bg:-default}
# tmux_conf_theme_window_status_activity_attr=${tmux_conf_theme_window_status_activity_attr:-underscore}
# tmux setw -g window-status-activity-style fg=$tmux_conf_theme_window_status_activity_fg,bg=$tmux_conf_theme_window_status_activity_bg,$tmux_conf_theme_window_status_activity_attr
#
# window_status_bell_fg=colour226 # yellow
# window_status_bell_bg=default
# window_status_bell_attr=blink,bold
# tmux setw -g window-status-bell-style fg=$window_status_bell_fg,bg=$window_status_bell_bg,$window_status_bell_attr
# tmux_conf_theme_window_status_bell_fg=${tmux_conf_theme_window_status_bell_fg:-colour226} # yellow
# tmux_conf_theme_window_status_bell_bg=${tmux_conf_theme_window_status_bell_bg:-default}
# tmux_conf_theme_window_status_bell_attr=${tmux_conf_theme_window_status_bell_attr:-blink,bold}
# tmux setw -g window-status-bell-style fg=$tmux_conf_theme_window_status_bell_fg,bg=$tmux_conf_theme_window_status_bell_bg,$tmux_conf_theme_window_status_bell_attr
#
# window_status_last_fg=colour39 # light blue
# window_status_last_attr=default
# tmux setw -g window-status-last-style $window_status_last_attr,fg=$window_status_last_fg
#
# battery_full_fg=colour160 # red
# battery_empty_fg=colour254 # white
# battery_bg=colour160 # black
# time_date_fg=colour245 # light gray
# time_date_bg=colour232 # dark gray
# whoami_fg=colour254 # white
# whoami_bg=colour160 # red
# host_fg=colour16 # black
# host_bg=colour254 # white
# status_right="${tmux_conf_battery:-#(cut -c3- ~/.tmux.conf | sh -s battery ${tmux_conf_battery_symbol:-block} ${tmux_conf_battery_symbol_count:-auto} ${tmux_conf_battery_palette:-colour160,colour254,colour16} ${tmux_conf_battery_status})} #[fg=$time_date_fg,nobold]$right_separator %R $right_separator %d %b #[fg=$whoami_bg,bg=$time_date_bg,nobold]$right_separator_black#[fg=$whoami_fg,bg=$whoami_bg,nobold] #(whoami) $right_separator_black#[fg=$host_fg,bg=$host_bg,bold] #h "
# tmux_conf_theme_battery=${tmux_conf_theme_battery:-enabled}
# tmux_conf_theme_time=${tmux_conf_theme_time:-enabled}
# tmux_conf_theme_date=${tmux_conf_theme_date:-enabled}
# tmux_conf_theme_username=${tmux_conf_theme_username:-enabled}
# tmux_conf_theme_hostname=${tmux_conf_theme_hostname:-enabled}
# battery_enabled=$( ([ x"$tmux_conf_theme_battery" = x"enabled" ] || [ -z "$tmux_conf_theme_battery" ]) && echo "true" || echo "false" )
# time_enabled=$( ([ x"$tmux_conf_theme_time" = x"enabled" ] || [ -z "$tmux_conf_theme_time" ]) && echo "true" || echo "false" )
# date_enabled=$( ([ x"$tmux_conf_theme_date" = x"enabled" ] || [ -z "$tmux_conf_theme_date" ]) && echo "true" || echo "false" )
# username_enabled=$( ([ x"$tmux_conf_theme_username" = x"enabled" ] || [ -z "$tmux_conf_theme_username" ] || ([ x"$tmux_conf_theme_username" = x"ssh" ] && ([ -n "$SSH_CLIENT" ] || [ -n "$SSH_CONNECTION" ] || [ -n "$SSH_TTY" ]))) && echo "true" || echo "false" )
# hostname_enabled=$( ([ x"$tmux_conf_theme_hostname" = x"enabled" ] || [ -z "$tmux_conf_theme_hostname" ] || ([ x"$tmux_conf_theme_hostname" = x"ssh" ] && ([ -n "$SSH_CLIENT" ] || [ -n "$SSH_CONNECTION" ] || [ -n "$SSH_TTY" ]))) && echo "true" || echo "false" )
#
# tmux_conf_theme_time_date_fg=${tmux_conf_theme_time_date_fg:-colour245} # light gray
# tmux_conf_theme_time_date_bg=${tmux_conf_theme_time_date_bg:-colour232} # dark gray
# tmux_conf_theme_username_fg=colour254 # white
# tmux_conf_theme_username_bg=colour160 # red
# tmux_conf_theme_hostname_fg=colour16 # black
# tmux_conf_theme_hostname_bg=colour254 # white
#
# if [ x"$battery_enabled" = x"true" ] ; then
# status_right_battery="${tmux_conf_battery:-#(cut -c3- ~/.tmux.conf | sh -s battery ${tmux_conf_battery_symbol:-block} ${tmux_conf_battery_symbol_count:-auto} \"${tmux_conf_battery_palette:-colour160,colour254,colour16}\" ${tmux_conf_battery_status:-enabled})} "
# has_battery=$(eval echo \$${status_right_battery#\#})
# if [ -n "$has_battery" ] && ([ x"$time_enabled" = x"true" ] || [ x"$date_enabled" = x"true" ]) ; then
# status_right_battery="${status_right_battery}#[fg=$tmux_conf_theme_time_date_fg,nobold]$right_separator"
# fi
# fi
# if [ x"$time_enabled" = x"true" ] ; then
# status_right_time="#[fg=$tmux_conf_theme_time_date_fg,nobold]${status_right_time} %R "
# if [ x"$date_enabled" = x"true" ] ; then
# status_right_time="${status_right_time}#[fg=$tmux_conf_theme_time_date_fg,nobold]$right_separator"
# fi
# fi
# if [ x"$date_enabled" = x"true" ] ; then
# status_right_date="#[fg=$tmux_conf_theme_time_date_fg,nobold] %d %b "
# fi
# if [ x"$username_enabled" = x"true" ] ; then
# status_right_username="#[fg=$tmux_conf_theme_username_bg,bg=$tmux_conf_theme_time_date_bg,nobold]$right_separator_black#[fg=$tmux_conf_theme_username_fg,bg=$tmux_conf_theme_username_bg,nobold] #(whoami) "
# fi
# if [ x"$hostname_enabled" = x"true" ] ; then
# if [ x"$username_enabled" = x"true" ] ; then
# status_right_hostname="#[bg=$tmux_conf_theme_username_bg]"
# else
# status_right_hostname="#[bg=$tmux_conf_theme_time-data_bg]"
# fi
# status_right_hostname="#[fg=$tmux_conf_theme_hostname_bg,nobold]${status_right_hostname}$right_separator_black#[fg=$tmux_conf_theme_hostname_fg,bg=$tmux_conf_theme_hostname_bg,bold] #h "
# fi
# status_right="${status_right_battery}${status_right_time}${status_right_date}${status_right_username}${status_right_hostname}"
# tmux set -g status-right-length 64 \; set -g status-right "$status_right"
#
# # clock
@ -336,25 +367,6 @@ run 'for name in $(printenv | grep -Eo ^tmux_conf_[^=]+); do tmux setenv -gu $na
# }
#
# battery() {
# battery_symbol=$1
# battery_symbol_count=$2
# battery_palette=$3
# battery_status=$4
# if [ x"$battery_symbol_count" = x"auto" ]; then
# columns=$(tmux -q display -p '#{client_width}' 2> /dev/null || echo 80)
# if [ $columns -ge 80 ]; then
# battery_symbol_count=10
# else
# battery_symbol_count=5
# fi
# fi
# battery_symbol_heart_full=♥
# battery_symbol_heart_empty=♥
# battery_symbol_block_full=◼
# battery_symbol_block_empty=◻
# eval battery_symbol_full='$battery_symbol_'"$battery_symbol"'_full'
# eval battery_symbol_empty='$battery_symbol_'"$battery_symbol"'_empty'
#
# uname_s=$(uname -s)
# if [ x"$uname_s" = x"Darwin" ]; then
# batt=$(pmset -g batt)
@ -375,7 +387,26 @@ run 'for name in $(printenv | grep -Eo ^tmux_conf_[^=]+); do tmux setenv -gu $na
# charge="$(cat $batnow) / $(cat $batfull)" || return
# fi
#
# if [ x"$battery_status" = x"1" -o x"$battery_status" = x"true" ]; then
# battery_symbol=$1
# battery_symbol_count=$2
# battery_palette=$3
# battery_status=$4
# if [ x"$battery_symbol_count" = x"auto" ]; then
# columns=$(tmux -q display -p '#{client_width}' 2> /dev/null || echo 80)
# if [ $columns -ge 80 ]; then
# battery_symbol_count=10
# else
# battery_symbol_count=5
# fi
# fi
# battery_symbol_heart_full=♥
# battery_symbol_heart_empty=♥
# battery_symbol_block_full=◼
# battery_symbol_block_empty=◻
# eval battery_symbol_full='$battery_symbol_'"$battery_symbol"'_full'
# eval battery_symbol_empty='$battery_symbol_'"$battery_symbol"'_empty'
#
# if [ x"$battery_status" = x"1"] || [ x"$battery_status" = x"true" ] || [ x"$battery_status" = x"enabled" ] ; then
# if [ x"$discharging" = x"true" ]; then
# printf "%s " 🔋
# else
@ -383,20 +414,7 @@ run 'for name in $(printenv | grep -Eo ^tmux_conf_[^=]+); do tmux setenv -gu $na
# fi
# fi
#
# if echo $battery_palette | grep -q -E '^(colour[0-9]{1,3},?){3}$'; then
# battery_full_fg=$(echo $battery_palette | cut -d, -f1)
# battery_empty_fg=$(echo $battery_palette | cut -d, -f2)
# battery_bg=$(echo $battery_palette | cut -d, -f3)
#
# full=$(printf %.0f $(awk "BEGIN{print $charge * $battery_symbol_count}"))
# [ $full -gt 0 ] && \
# printf '#[fg=%s,bg=%s]' $battery_full_fg $battery_bg && \
# printf "%0.s$battery_symbol_full" $(seq 1 $full)
# empty=$(($battery_symbol_count - $full))
# [ $empty -gt 0 ] && \
# printf '#[fg=%s,bg=%s]' $battery_empty_fg $battery_bg && \
# printf "%0.s$battery_symbol_empty" $(seq 1 $empty)
# elif echo $battery_palette | grep -q -E '^heat|gradient(,colour[0-9]{1,3})?$'; then
# if echo $battery_palette | grep -q -E '^heat|gradient(,[a-z0-9]{7,9})?$'; then
# battery_style=$(echo $battery_palette | cut -d, -f1)
# battery_bg=$(echo $battery_palette | cut -s -d, -f2)
# battery_bg=${battery_bg:-colour16}
@ -421,19 +439,32 @@ run 'for name in $(printenv | grep -Eo ^tmux_conf_[^=]+); do tmux setenv -gu $na
# [ $empty -gt 0 ] && \
# printf "#[fg=colour%s]$battery_symbol_empty" $(echo $palette | cut -d' ' -f$((full+1))-$(($full + $empty)))
# fi
# elif echo $battery_palette | grep -q -E '^([#a-z0-9]{7,9},?){3}$'; then
# battery_full_fg=$(echo $battery_palette | cut -d, -f1)
# battery_empty_fg=$(echo $battery_palette | cut -d, -f2)
# battery_bg=$(echo $battery_palette | cut -d, -f3)
#
# full=$(printf %.0f $(awk "BEGIN{print $charge * $battery_symbol_count}"))
# [ $full -gt 0 ] && \
# printf '#[fg=%s,bg=%s]' $battery_full_fg $battery_bg && \
# printf "%0.s$battery_symbol_full" $(seq 1 $full)
# empty=$(($battery_symbol_count - $full))
# [ $empty -gt 0 ] && \
# printf '#[fg=%s,bg=%s]' $battery_empty_fg $battery_bg && \
# printf "%0.s$battery_symbol_empty" $(seq 1 $empty)
# fi
# }
#
# apply_configurable_bindings() {
# windows_retain_current_path=${1:-false}
# if [ x"$windows_retain_current_path" = x"true" -o x"$windows_retain_current_path" = x"1" ] ; then
# tmux_conf_new_windows_retain_current_path=${tmux_conf_new_windows_retain_current_path:-false}
# if [ x"$tmux_conf_new_windows_retain_current_path" = x"true" ] || [ x"$tmux_conf_new_windows_retain_current_path" = x"1" ] ; then
# tmux bind c new-window -c '#{pane_current_path}'
# else
# tmux bind c new-window
# fi
#
# panes_retain_current_path=${2:-true}
# if [ x"$panes_retain_current_path" = x"true" -o x"$panes_retain_current_path" = x"1" ] ; then
# tmux_conf_new_panes_retain_current_path=${tmux_conf_new_panes_retain_current_path:-true}
# if [ x"$tmux_conf_new_panes_retain_current_path" = x"true" ] || [ x"$tmux_conf_new_panes_retain_current_path" = x"1" ] ; then
# tmux bind '"' split-window -v -c "#{pane_current_path}" \;\
# bind % split-window -h -c "#{pane_current_path}" \;\
# bind - split-window -v -c "#{pane_current_path}" \;\

View File

@ -1,24 +1,80 @@
# use the powerline patched font variant of the theme
#tmux_conf_theme=powerline_patched_font
# use the powerline patched font variant of the theme, possible values are:
# - default
# - powerline
tmux_conf_theme=default
#tmux_conf_theme=powerline
# use 5 hearts for the battery status
# display the battery information in the status line, possible values are:
# - enabled
# - disabled
tmux_conf_theme_battery=enabled
#tmux_conf_theme_battery=disabled
# symbols to use for battery status, possible values are:
# - block
# - heart
tmux_conf_battery_symbol=block
#tmux_conf_battery_symbol=heart
# number of symbols to use for battery status
tmux_conf_battery_symbol_count=auto
#tmux_conf_battery_symbol_count=5
# use the heat palette for the battery status
# palette used for the battery status, possible values are:
# - 'colour_full_fg,colour_empty_fg,colour_bg'
# - heat
# - gradient
tmux_conf_battery_palette='#d70000,#e4e4e4,#000000'
#tmux_conf_battery_palette=colour160,colour254,colour16
#tmux_conf_battery_palette=heat
# use the gradient palette for the battery status
#tmux_conf_battery_palette=gradient
# display the battery status: charging (U+26A1) / discharging (U+1F50B)
#tmux_conf_battery_status=true
tmux_conf_battery_status=enabled
#tmux_conf_battery_status=disabled
# or alternatively use an external tool, e.g. https://github.com/Goles/Battery
#tmux_conf_battery='#(battery -t) '
# new windows and new panes optionally retain current path
#tmux_conf_new_windows_retain_current_path=false
#tmux_conf_new_panes_retain_current_path=true
# display the time in the status line, possible values are:
# - enabled
# - disabled
tmux_conf_theme_time=enabled
#tmux_conf_theme_time=disabled
# display the date in the status line, possible values are:
# - enabled
# - disabled
tmux_conf_theme_date=enabled
#tmux_conf_theme_date=disabled
# display the username in the status line, possible values are:
# - enabled
# - disabled
# - ssh
tmux_conf_theme_username=enabled
#tmux_conf_theme_username=disabled
#tmux_conf_theme_username=ssh
# display the hostname in the status line, possible values are:
# - enabled
# - disabled
# - ssh
tmux_conf_theme_hostname=enabled
#tmux_conf_theme_hostname=disabled
#tmux_conf_theme_hostname=ssh
# should new windows retain current path, possible values are:
# - true
# - false
tmux_conf_new_windows_retain_current_path=false
#tmux_conf_new_windows_retain_current_path=true
# should new panes reatin current path, possible values are:
# - true
# - false
tmux_conf_new_panes_retain_current_path=true
#tmux_conf_new_panes_retain_current_path=false
# if you're running tmux within iTerm2
# - and tmux is 1.9 or 1.9a

View File

@ -117,7 +117,9 @@ file:
echo "set -g history-limit 10000" >> ~/.tmux.conf.local
You will also notice the default `.tmux.conf.local` file contains variables you
can change to alter different behaviors.
can change to alter different behaviors. Pressing `<prefix> e` will open
`~/.tmux.conf.local` with the editor defined by the `$EDITOR` environment
variable (defaults to `vim` when empty).
### Enabling the Powerline like visual theme
@ -143,44 +145,101 @@ To make use of these symbols, there are several options:
Please see the [powerline manual] for further details.
Then edit the `~/.tmux.conf.local` file and uncomment the following line:
Then edit the `~/.tmux.conf.local` file (`<prefix> e`) and adjust the
`tmux_conf_theme` variable:
#tmux_conf_theme=powerline_patched_font
tmux_conf_theme=powerline
The possible values for `tmux_conf_theme` are `default` and `powerline`.
[fonts patched with powerline symbols]: https://github.com/Lokaltog/powerline-fonts
[powerline manual]: http://powerline.readthedocs.org/en/latest/installation.html#fonts-installation
### Configuring the battery indicator
Edit the `~/.tmux.conf.local` file and uncomment the following lines:
To enable or disable the battery indicator, edit the `~/.tmux.conf.local` file
(`<prefix> e`) and adjust the `tmux_conf_theme_battery` variable:
#tmux_conf_battery_symbol=heart
#tmux_conf_battery_symbol_count=5
tmux_conf_theme_battery=enabled
The possible values for `tmux_conf_battery_symbol` are `heart` or `block`
(default).
The possible values for `tmux_conf_theme_battery` are `enabled` (default) or
`disabled`.
To use the heat palette for the battery indicator, edit the `~/.tmux.conf.local`
file and uncomment the following line:
You can also customize the symbol used in the battery bar as well as their
number by adjusting the `tmux_conf_battery_symbol` and
`tmux_conf_battery_symbol_count` variables.
tmux_conf_battery_symbol=heart
tmux_conf_battery_symbol_count=5
The possible values for `tmux_conf_battery_symbol` are `block` (default) or
`block`. The default number of symbol displayed is `10`.
To customize the battery bar colors, adjust the `tmux_conf_battery_palette`
variable. You can either specify a `'colour_full_fg,colour_empty_fg,colour_bg'`
colour triplet or one of the `heat` or `gradient` aliases. See tmux manual for
colours definition:
> The colour is one of: black, red, green, yellow, blue, magenta, cyan, white,
> aixterm bright variants (if supported: brightred, brightgreen, and so on),
> colour0 to colour255 from the 256-colour set, default, or a hexadecimal RGB
> string such as `#ffffff`, which chooses the closest match from the default
> 256-colour set.
To use the heat palette for the battery indicator, use:
tmux_conf_battery_palette=heat
To use the gradient palette for the battery indicator, use:
#tmux_conf_battery_palette=heat
To use the gradient palette for the battery indicator, edit the
`~/.tmux.conf.local` file and uncomment the following line:
To disable the battery charging (⚡ U+26A1) / discharging
(🔋 U+1F50B) status, adjust the `tmux_conf_battery_status` variable:
#tmux_conf_battery_palette=heat
tmux_conf_battery_status=disabled
To display the battery charging (⚡ U+26A1) / discharging (🔋 U+1F50B) status
indicators, edit the `~/.tmux.conf.local` file and uncomment the following line:
The possible values for `tmux_conf_battery_status` are `enabled` (defaut) or
`disabled`.
#tmux_conf_battery_status=true
### Configuring the date and time
To disable the display of date and time, edit the `~/.tmux.conf.local` file
(`<prefix> e`) and adjust the `tmux_conf_theme_date` and
`tmux_conf_theme_time` variables:
tmux_conf_theme_time=disabled
tmux_conf_theme_date=disabled
The possible values for `tmux_conf_theme_date` and `tmux_conf_theme_time` are
`enabled` (defaut) or `disabled`.
### Configuring the username and hostname
To disable the display of username and hostname, edit the `~/.tmux.conf.local`
file (`<prefix> e`) and adjust the `tmux_conf_theme_username` and
`tmux_conf_theme_hostname` variables:
tmux_conf_theme_username=disabled tmux_conf_theme_hostname=disabled
The possible values for `tmux_conf_theme_username` and
`tmux_conf_theme_hostname` are `enabled` (default) or `disabled`, or `ssh`.
When you set `tmux_conf_theme_username` or `tmux_conf_theme_hostname` to `ssh`,
information is displayed only if you're inside an SSH session.
### Configuring new windows and new panes creation
Edit the `~/.tmux.conf.local` file and uncomment the following lines:
To configure whether creating new windows and new panes retains the current
path, edit the `~/.tmux.conf.local` (`<prefix> e`) and adjust the
`tmux_conf_new_windows_retain_current_path` and
`tmux_conf_new_panes_retain_current_path` variables:
#tmux_conf_new_windows_retain_current_path=false
#tmux_conf_new_panes_retain_current_path=true
tmux_conf_new_windows_retain_current_path=false
tmux_conf_new_panes_retain_current_path=true
The possible values for `tmux_conf_new_windows_retain_current_path` and
`tmux_conf_new_panes_retain_current_path` are `true` or `false`.
### Accessing the Mac OSX clipboard from within tmux sessions