Move all configuration to powerline-base.conf

Reasoning: for some reason it does not work after `powerline-config tmux
setcolors`.

Fixes #717
This commit is contained in:
ZyX 2014-11-29 13:32:54 +03:00
parent e6fc2911c2
commit f3ba38e53d
3 changed files with 14 additions and 13 deletions

View File

@ -29,8 +29,7 @@ CONFIG_PRIORITY = {
def list_all_tmux_configs():
'''List all version-specific tmux configuration files'''
directory = TMUX_CONFIG_DIRECTORY
for root, dirs, files in os.walk(directory):
for root, dirs, files in os.walk(TMUX_CONFIG_DIRECTORY):
dirs[:] = ()
for fname in files:
match = CONFIG_FILE_NAME.match(fname)
@ -67,6 +66,7 @@ def source_tmux_files(pl, args):
sourced, then _plus files and then files without _minus or _plus suffixes.
'''
version = get_tmux_version(pl)
run_tmux_command('source', os.path.join(TMUX_CONFIG_DIRECTORY, 'powerline-base.conf'))
for fname, priority in sorted(get_tmux_configs(version), key=(lambda v: v[1])):
run_tmux_command('source', fname)
if not os.environ.get('POWERLINE_COMMAND'):

View File

@ -0,0 +1,12 @@
set -g status on
set -g status-utf8 on
set -g status-interval 2
set -g status-left-length 20
set -g status-right '#(eval $POWERLINE_COMMAND tmux right -R pane_id=`tmux display -p "#D"`)'
set -g status-right-length 150
set -g window-status-format "#[$_POWERLINE_WINDOW_COLOR] #I #[$_POWERLINE_WINDOW_DIVIDER_COLOR] #[default]#W "
set -g window-status-current-format "#[$_POWERLINE_WINDOW_CURRENT_HARD_DIVIDER_COLOR]#[$_POWERLINE_WINDOW_CURRENT_COLOR] #I  #[$_POWERLINE_WINDOW_NAME_COLOR]#W #[$_POWERLINE_WINDOW_CURRENT_HARD_DIVIDER_NEXT_COLOR]"
# Legacy status-left definition to be overwritten for tmux Versions 1.8+
set -g status-left "#[$_POWERLINE_SESSION_COLOR] #S #[$_POWERLINE_SESSION_HARD_DIVIDER_NEXT_COLOR]#(eval \$POWERLINE_COMMAND tmux left)"
# vim: ft=tmux

View File

@ -1,17 +1,6 @@
if-shell 'test -z "$POWERLINE_CONFIG_COMMAND"' 'set-environment -g POWERLINE_CONFIG_COMMAND powerline-config'
run-shell 'eval $POWERLINE_CONFIG_COMMAND tmux setcolors'
set -g status on
set -g status-utf8 on
set -g status-interval 2
set -g status-left-length 20
set -g status-right '#(eval $POWERLINE_COMMAND tmux right -R pane_id=`tmux display -p "#D"`)'
set -g status-right-length 150
set -g window-status-format "#[$_POWERLINE_WINDOW_COLOR] #I #[$_POWERLINE_WINDOW_DIVIDER_COLOR] #[default]#W "
set -g window-status-current-format "#[$_POWERLINE_WINDOW_CURRENT_HARD_DIVIDER_COLOR]#[$_POWERLINE_WINDOW_CURRENT_COLOR] #I  #[$_POWERLINE_WINDOW_NAME_COLOR]#W #[$_POWERLINE_WINDOW_CURRENT_HARD_DIVIDER_NEXT_COLOR]"
# Legacy status-left definition to be overwritten for tmux Versions 1.8+
set -g status-left "#[$_POWERLINE_SESSION_COLOR] #S #[$_POWERLINE_SESSION_HARD_DIVIDER_NEXT_COLOR]#(eval \$POWERLINE_COMMAND tmux left)"
# Simplify tmux version checking by using multiple config files. Source these
# config files based on the version in which tmux features were added and/or