From c868f9c2559f8eb95c99359867cb4e0bbb5ea66f Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 6 Jan 2015 15:25:18 +0300 Subject: [PATCH] Rename `attr` to `attrs` Fixes #1199 --- docs/source/configuration/reference.rst | 2 +- powerline/bindings/config.py | 14 +-- powerline/colorscheme.py | 20 +-- .../config_files/colorschemes/default.json | 80 ++++++------ .../colorschemes/ipython/default.json | 4 +- .../colorschemes/shell/default.json | 16 +-- .../colorschemes/shell/solarized.json | 10 +- .../config_files/colorschemes/solarized.json | 26 ++-- .../colorschemes/tmux/default.json | 20 +-- .../colorschemes/vim/default.json | 76 +++++------ .../colorschemes/vim/solarized.json | 118 +++++++++--------- .../colorschemes/vim/solarizedlight.json | 118 +++++++++--------- powerline/lint/__init__.py | 2 +- powerline/renderer.py | 6 +- powerline/renderers/i3bar.py | 2 +- powerline/renderers/pango_markup.py | 10 +- powerline/renderers/shell/__init__.py | 12 +- powerline/renderers/tmux.py | 30 ++--- powerline/renderers/vim.py | 40 +++--- powerline/theme.py | 2 +- tests/lib/config_mock.py | 10 +- tests/test_config_merging.py | 4 +- tests/test_config_reload.py | 12 +- tests/test_configuration.py | 14 +-- 24 files changed, 324 insertions(+), 324 deletions(-) diff --git a/docs/source/configuration/reference.rst b/docs/source/configuration/reference.rst index b19c38e5..8f7b846a 100644 --- a/docs/source/configuration/reference.rst +++ b/docs/source/configuration/reference.rst @@ -250,7 +250,7 @@ override those from each previous file. It is required that either Background color. Must be defined in :ref:`colors `. - ``attr`` + ``attrs`` List of attributes. Valid values are one or more of ``bold``, ``italic`` and ``underline``. Note that some attributes may be unavailable in some applications or terminal emulators. If you do not diff --git a/powerline/bindings/config.py b/powerline/bindings/config.py index ea961d38..11a4b2d8 100644 --- a/powerline/bindings/config.py +++ b/powerline/bindings/config.py @@ -12,7 +12,7 @@ from powerline.tmux import TmuxPowerline from powerline.lib.shell import which from powerline.bindings.tmux import TmuxVersionInfo, run_tmux_command, set_tmux_environment, get_tmux_version from powerline.lib.encoding import get_preferred_output_encoding -from powerline.renderers.tmux import attr_to_tmux_attr +from powerline.renderers.tmux import attrs_to_tmux_attrs CONFIG_FILE_NAME = re.compile(r'powerline_tmux_(?P\d+)\.(?P\d+)(?P[a-z]+)?(?:_(?Pplus|minus))?\.conf') @@ -116,26 +116,26 @@ def init_environment(pl, args): powerline.renderer.hlstyle( fg=prev_highlight['bg'], bg=next_highlight['bg'], - attr=0, + attrs=0, )[2:-1] ) for varname, attr, group in ( ('_POWERLINE_ACTIVE_WINDOW_FG', 'fg', 'active_window_status'), ('_POWERLINE_WINDOW_STATUS_FG', 'fg', 'window_status'), ('_POWERLINE_ACTIVITY_STATUS_FG', 'fg', 'activity_status'), - ('_POWERLINE_ACTIVITY_STATUS_ATTR', 'attr', 'activity_status'), + ('_POWERLINE_ACTIVITY_STATUS_ATTR', 'attrs', 'activity_status'), ('_POWERLINE_BELL_STATUS_FG', 'fg', 'bell_status'), - ('_POWERLINE_BELL_STATUS_ATTR', 'attr', 'bell_status'), + ('_POWERLINE_BELL_STATUS_ATTR', 'attrs', 'bell_status'), ('_POWERLINE_BACKGROUND_FG', 'fg', 'background'), ('_POWERLINE_BACKGROUND_BG', 'bg', 'background'), ('_POWERLINE_SESSION_FG', 'fg', 'session'), ('_POWERLINE_SESSION_BG', 'bg', 'session'), - ('_POWERLINE_SESSION_ATTR', 'attr', 'session'), + ('_POWERLINE_SESSION_ATTR', 'attrs', 'session'), ('_POWERLINE_SESSION_PREFIX_FG', 'fg', 'session:prefix'), ('_POWERLINE_SESSION_PREFIX_BG', 'bg', 'session:prefix'), - ('_POWERLINE_SESSION_PREFIX_ATTR', 'attr', 'session:prefix'), + ('_POWERLINE_SESSION_PREFIX_ATTR', 'attrs', 'session:prefix'), ): - if attr == 'attr': + if attr == 'attrs': attrs = attr_to_tmux_attr(get_highlighting(group)[attr]) set_tmux_environment(varname, ']#['.join(attrs)) set_tmux_environment(varname + '_LEGACY', ','.join(attrs)) diff --git a/powerline/colorscheme.py b/powerline/colorscheme.py index 8d718863..66416b55 100644 --- a/powerline/colorscheme.py +++ b/powerline/colorscheme.py @@ -12,16 +12,16 @@ ATTR_ITALIC = 2 ATTR_UNDERLINE = 4 -def get_attr_flag(attributes): +def get_attrs_flag(attrs): '''Convert an attribute array to a renderer flag.''' - attr_flag = 0 - if 'bold' in attributes: - attr_flag |= ATTR_BOLD - if 'italic' in attributes: - attr_flag |= ATTR_ITALIC - if 'underline' in attributes: - attr_flag |= ATTR_UNDERLINE - return attr_flag + attrs_flag = 0 + if 'bold' in attrs: + attrs_flag |= ATTR_BOLD + if 'italic' in attrs: + attrs_flag |= ATTR_ITALIC + if 'underline' in attrs: + attrs_flag |= ATTR_UNDERLINE + return attrs_flag def pick_gradient_value(grad_list, gradient_level): @@ -112,7 +112,7 @@ class Colorscheme(object): return { 'fg': pick_color(group_props['fg']), 'bg': pick_color(group_props['bg']), - 'attr': get_attr_flag(group_props.get('attr', [])), + 'attrs': get_attrs_flag(group_props.get('attrs', [])), } diff --git a/powerline/config_files/colorschemes/default.json b/powerline/config_files/colorschemes/default.json index 899f162a..fbea5532 100644 --- a/powerline/config_files/colorschemes/default.json +++ b/powerline/config_files/colorschemes/default.json @@ -1,45 +1,45 @@ { "name": "Default", "groups": { - "background": { "fg": "white", "bg": "gray0", "attr": [] }, - "background:divider": { "fg": "gray5", "bg": "gray0", "attr": [] }, - "session": { "fg": "black", "bg": "gray10", "attr": ["bold"] }, - "date": { "fg": "gray8", "bg": "gray2", "attr": [] }, - "time": { "fg": "gray10", "bg": "gray2", "attr": ["bold"] }, - "time:divider": { "fg": "gray5", "bg": "gray2", "attr": [] }, - "email_alert": { "fg": "white", "bg": "brightred", "attr": ["bold"] }, - "email_alert_gradient": { "fg": "white", "bg": "yellow_orange_red", "attr": ["bold"] }, - "hostname": { "fg": "black", "bg": "gray10", "attr": ["bold"] }, - "weather": { "fg": "gray8", "bg": "gray0", "attr": [] }, - "weather_temp_gradient": { "fg": "blue_red", "bg": "gray0", "attr": [] }, - "weather_condition_hot": { "fg": "khaki1", "bg": "gray0", "attr": [] }, - "weather_condition_snowy": { "fg": "skyblue1", "bg": "gray0", "attr": [] }, - "weather_condition_rainy": { "fg": "skyblue1", "bg": "gray0", "attr": [] }, - "uptime": { "fg": "gray8", "bg": "gray0", "attr": [] }, - "external_ip": { "fg": "gray8", "bg": "gray0", "attr": [] }, - "internal_ip": { "fg": "gray8", "bg": "gray0", "attr": [] }, - "network_load": { "fg": "gray8", "bg": "gray0", "attr": [] }, - "network_load_gradient": { "fg": "green_yellow_orange_red", "bg": "gray0", "attr": [] }, - "system_load": { "fg": "gray8", "bg": "gray0", "attr": [] }, - "system_load_gradient": { "fg": "green_yellow_orange_red", "bg": "gray0", "attr": [] }, - "environment": { "fg": "gray8", "bg": "gray0", "attr": [] }, - "cpu_load_percent": { "fg": "gray8", "bg": "gray0", "attr": [] }, - "cpu_load_percent_gradient": { "fg": "green_yellow_orange_red", "bg": "gray0", "attr": [] }, - "battery": { "fg": "gray8", "bg": "gray0", "attr": [] }, - "battery_gradient": { "fg": "white_red", "bg": "gray0", "attr": [] }, - "battery_full": { "fg": "red", "bg": "gray0", "attr": [] }, - "battery_empty": { "fg": "white", "bg": "gray0", "attr": [] }, - "player": { "fg": "gray10", "bg": "black", "attr": [] }, - "user": { "fg": "white", "bg": "darkblue", "attr": ["bold"] }, - "superuser": { "fg": "white", "bg": "brightred", "attr": ["bold"] }, - "branch": { "fg": "gray9", "bg": "gray2", "attr": [] }, - "branch_dirty": { "fg": "brightyellow", "bg": "gray2", "attr": [] }, - "branch_clean": { "fg": "gray9", "bg": "gray2", "attr": [] }, - "branch:divider": { "fg": "gray7", "bg": "gray2", "attr": [] }, - "cwd": { "fg": "gray9", "bg": "gray4", "attr": [] }, - "cwd:current_folder": { "fg": "gray10", "bg": "gray4", "attr": ["bold"] }, - "cwd:divider": { "fg": "gray7", "bg": "gray4", "attr": [] }, - "virtualenv": { "fg": "white", "bg": "darkcyan", "attr": [] }, - "attached_clients": { "fg": "gray8", "bg": "gray0", "attr": [] } + "background": { "fg": "white", "bg": "gray0", "attrs": [] }, + "background:divider": { "fg": "gray5", "bg": "gray0", "attrs": [] }, + "session": { "fg": "black", "bg": "gray10", "attrs": ["bold"] }, + "date": { "fg": "gray8", "bg": "gray2", "attrs": [] }, + "time": { "fg": "gray10", "bg": "gray2", "attrs": ["bold"] }, + "time:divider": { "fg": "gray5", "bg": "gray2", "attrs": [] }, + "email_alert": { "fg": "white", "bg": "brightred", "attrs": ["bold"] }, + "email_alert_gradient": { "fg": "white", "bg": "yellow_orange_red", "attrs": ["bold"] }, + "hostname": { "fg": "black", "bg": "gray10", "attrs": ["bold"] }, + "weather": { "fg": "gray8", "bg": "gray0", "attrs": [] }, + "weather_temp_gradient": { "fg": "blue_red", "bg": "gray0", "attrs": [] }, + "weather_condition_hot": { "fg": "khaki1", "bg": "gray0", "attrs": [] }, + "weather_condition_snowy": { "fg": "skyblue1", "bg": "gray0", "attrs": [] }, + "weather_condition_rainy": { "fg": "skyblue1", "bg": "gray0", "attrs": [] }, + "uptime": { "fg": "gray8", "bg": "gray0", "attrs": [] }, + "external_ip": { "fg": "gray8", "bg": "gray0", "attrs": [] }, + "internal_ip": { "fg": "gray8", "bg": "gray0", "attrs": [] }, + "network_load": { "fg": "gray8", "bg": "gray0", "attrs": [] }, + "network_load_gradient": { "fg": "green_yellow_orange_red", "bg": "gray0", "attrs": [] }, + "system_load": { "fg": "gray8", "bg": "gray0", "attrs": [] }, + "system_load_gradient": { "fg": "green_yellow_orange_red", "bg": "gray0", "attrs": [] }, + "environment": { "fg": "gray8", "bg": "gray0", "attrs": [] }, + "cpu_load_percent": { "fg": "gray8", "bg": "gray0", "attrs": [] }, + "cpu_load_percent_gradient": { "fg": "green_yellow_orange_red", "bg": "gray0", "attrs": [] }, + "battery": { "fg": "gray8", "bg": "gray0", "attrs": [] }, + "battery_gradient": { "fg": "white_red", "bg": "gray0", "attrs": [] }, + "battery_full": { "fg": "red", "bg": "gray0", "attrs": [] }, + "battery_empty": { "fg": "white", "bg": "gray0", "attrs": [] }, + "player": { "fg": "gray10", "bg": "black", "attrs": [] }, + "user": { "fg": "white", "bg": "darkblue", "attrs": ["bold"] }, + "superuser": { "fg": "white", "bg": "brightred", "attrs": ["bold"] }, + "branch": { "fg": "gray9", "bg": "gray2", "attrs": [] }, + "branch_dirty": { "fg": "brightyellow", "bg": "gray2", "attrs": [] }, + "branch_clean": { "fg": "gray9", "bg": "gray2", "attrs": [] }, + "branch:divider": { "fg": "gray7", "bg": "gray2", "attrs": [] }, + "cwd": { "fg": "gray9", "bg": "gray4", "attrs": [] }, + "cwd:current_folder": { "fg": "gray10", "bg": "gray4", "attrs": ["bold"] }, + "cwd:divider": { "fg": "gray7", "bg": "gray4", "attrs": [] }, + "virtualenv": { "fg": "white", "bg": "darkcyan", "attrs": [] }, + "attached_clients": { "fg": "gray8", "bg": "gray0", "attrs": [] } } } diff --git a/powerline/config_files/colorschemes/ipython/default.json b/powerline/config_files/colorschemes/ipython/default.json index 54987c48..a5da8ffc 100644 --- a/powerline/config_files/colorschemes/ipython/default.json +++ b/powerline/config_files/colorschemes/ipython/default.json @@ -1,7 +1,7 @@ { "name": "Default color scheme for IPython prompt", "groups": { - "prompt": { "fg": "gray9", "bg": "gray4", "attr": [] }, - "prompt_count": { "fg": "white", "bg": "gray4", "attr": [] } + "prompt": { "fg": "gray9", "bg": "gray4", "attrs": [] }, + "prompt_count": { "fg": "white", "bg": "gray4", "attrs": [] } } } diff --git a/powerline/config_files/colorschemes/shell/default.json b/powerline/config_files/colorschemes/shell/default.json index bb9e0d59..09f3d211 100644 --- a/powerline/config_files/colorschemes/shell/default.json +++ b/powerline/config_files/colorschemes/shell/default.json @@ -1,18 +1,18 @@ { "name": "Default color scheme for shell prompts", "groups": { - "hostname": { "fg": "brightyellow", "bg": "mediumorange", "attr": [] }, - "jobnum": { "fg": "brightyellow", "bg": "mediumorange", "attr": [] }, - "exit_fail": { "fg": "white", "bg": "darkestred", "attr": [] }, - "exit_success": { "fg": "white", "bg": "darkestgreen", "attr": [] }, - "environment": { "fg": "white", "bg": "darkestgreen", "attr": [] }, - "mode": { "fg": "darkestgreen", "bg": "brightgreen", "attr": ["bold"] }, - "attached_clients": { "fg": "white", "bg": "darkestgreen", "attr": [] } + "hostname": { "fg": "brightyellow", "bg": "mediumorange", "attrs": [] }, + "jobnum": { "fg": "brightyellow", "bg": "mediumorange", "attrs": [] }, + "exit_fail": { "fg": "white", "bg": "darkestred", "attrs": [] }, + "exit_success": { "fg": "white", "bg": "darkestgreen", "attrs": [] }, + "environment": { "fg": "white", "bg": "darkestgreen", "attrs": [] }, + "mode": { "fg": "darkestgreen", "bg": "brightgreen", "attrs": ["bold"] }, + "attached_clients": { "fg": "white", "bg": "darkestgreen", "attrs": [] } }, "mode_translations": { "vicmd": { "groups": { - "mode": {"fg": "darkestcyan", "bg": "white", "attr": ["bold"]} + "mode": {"fg": "darkestcyan", "bg": "white", "attrs": ["bold"]} } } } diff --git a/powerline/config_files/colorschemes/shell/solarized.json b/powerline/config_files/colorschemes/shell/solarized.json index e9059bd6..43b1666a 100644 --- a/powerline/config_files/colorschemes/shell/solarized.json +++ b/powerline/config_files/colorschemes/shell/solarized.json @@ -1,15 +1,15 @@ { "name": "Solarized dark for shell", "groups": { - "jobnum": { "fg": "solarized:base3", "bg": "solarized:base01", "attr": [] }, - "exit_fail": { "fg": "solarized:base3", "bg": "solarized:red", "attr": [] }, - "exit_success": { "fg": "solarized:base3", "bg": "solarized:green", "attr": [] }, - "mode": { "fg": "solarized:base3", "bg": "solarized:green", "attr": ["bold"] } + "jobnum": { "fg": "solarized:base3", "bg": "solarized:base01", "attrs": [] }, + "exit_fail": { "fg": "solarized:base3", "bg": "solarized:red", "attrs": [] }, + "exit_success": { "fg": "solarized:base3", "bg": "solarized:green", "attrs": [] }, + "mode": { "fg": "solarized:base3", "bg": "solarized:green", "attrs": ["bold"] } }, "mode_translations": { "vicmd": { "groups": { - "mode": { "fg": "solarized:base3", "bg": "solarized:blue", "attr": ["bold"] } + "mode": { "fg": "solarized:base3", "bg": "solarized:blue", "attrs": ["bold"] } } } } diff --git a/powerline/config_files/colorschemes/solarized.json b/powerline/config_files/colorschemes/solarized.json index 9c015ccd..9730e825 100644 --- a/powerline/config_files/colorschemes/solarized.json +++ b/powerline/config_files/colorschemes/solarized.json @@ -1,18 +1,18 @@ { "name": "Solarized dark", "groups": { - "background": { "fg": "solarized:base3", "bg": "solarized:base02", "attr": [] }, - "user": { "fg": "solarized:base3", "bg": "solarized:blue", "attr": ["bold"] }, - "superuser": { "fg": "solarized:base3", "bg": "solarized:red", "attr": ["bold"] }, - "virtualenv": { "fg": "solarized:base3", "bg": "solarized:green", "attr": [] }, - "branch": { "fg": "solarized:base1", "bg": "solarized:base02", "attr": [] }, - "branch_dirty": { "fg": "solarized:yellow", "bg": "solarized:base02", "attr": [] }, - "branch_clean": { "fg": "solarized:base1", "bg": "solarized:base02", "attr": [] }, - "cwd": { "fg": "solarized:base2", "bg": "solarized:base01", "attr": [] }, - "cwd:current_folder": { "fg": "solarized:base3", "bg": "solarized:base01", "attr": ["bold"] }, - "cwd:divider": { "fg": "solarized:base1", "bg": "solarized:base01", "attr": [] }, - "hostname": { "fg": "solarized:base3", "bg": "solarized:base01", "attr": [] }, - "environment": { "fg": "solarized:base3", "bg": "solarized:green", "attr": [] }, - "attached_clients": { "fg": "solarized:base3", "bg": "solarized:green", "attr": [] } + "background": { "fg": "solarized:base3", "bg": "solarized:base02", "attrs": [] }, + "user": { "fg": "solarized:base3", "bg": "solarized:blue", "attrs": ["bold"] }, + "superuser": { "fg": "solarized:base3", "bg": "solarized:red", "attrs": ["bold"] }, + "virtualenv": { "fg": "solarized:base3", "bg": "solarized:green", "attrs": [] }, + "branch": { "fg": "solarized:base1", "bg": "solarized:base02", "attrs": [] }, + "branch_dirty": { "fg": "solarized:yellow", "bg": "solarized:base02", "attrs": [] }, + "branch_clean": { "fg": "solarized:base1", "bg": "solarized:base02", "attrs": [] }, + "cwd": { "fg": "solarized:base2", "bg": "solarized:base01", "attrs": [] }, + "cwd:current_folder": { "fg": "solarized:base3", "bg": "solarized:base01", "attrs": ["bold"] }, + "cwd:divider": { "fg": "solarized:base1", "bg": "solarized:base01", "attrs": [] }, + "hostname": { "fg": "solarized:base3", "bg": "solarized:base01", "attrs": [] }, + "environment": { "fg": "solarized:base3", "bg": "solarized:green", "attrs": [] }, + "attached_clients": { "fg": "solarized:base3", "bg": "solarized:green", "attrs": [] } } } diff --git a/powerline/config_files/colorschemes/tmux/default.json b/powerline/config_files/colorschemes/tmux/default.json index e936f2ce..8525fb05 100644 --- a/powerline/config_files/colorschemes/tmux/default.json +++ b/powerline/config_files/colorschemes/tmux/default.json @@ -1,14 +1,14 @@ { "groups": { - "active_window_status": {"fg": "darkblue", "bg": "gray0", "attr": []}, - "window_status": {"fg": "gray70", "bg": "gray0", "attr": []}, - "activity_status": {"fg": "yellow", "bg": "gray0", "attr": []}, - "bell_status": {"fg": "red", "bg": "gray0", "attr": []}, - "window": {"fg": "gray6", "bg": "gray0", "attr": []}, - "window:divider": {"fg": "gray4", "bg": "gray0", "attr": []}, - "window:current": {"fg": "mediumcyan", "bg": "darkblue", "attr": []}, - "window_name": {"fg": "white", "bg": "darkblue", "attr": ["bold"]}, - "session": {"fg": "black", "bg": "gray90", "attr": ["bold"]}, - "session:prefix": {"fg": "gray90", "bg": "darkblue", "attr": ["bold"]} + "active_window_status": {"fg": "darkblue", "bg": "gray0", "attrs": []}, + "window_status": {"fg": "gray70", "bg": "gray0", "attrs": []}, + "activity_status": {"fg": "yellow", "bg": "gray0", "attrs": []}, + "bell_status": {"fg": "red", "bg": "gray0", "attrs": []}, + "window": {"fg": "gray6", "bg": "gray0", "attrs": []}, + "window:divider": {"fg": "gray4", "bg": "gray0", "attrs": []}, + "window:current": {"fg": "mediumcyan", "bg": "darkblue", "attrs": []}, + "window_name": {"fg": "white", "bg": "darkblue", "attrs": ["bold"]}, + "session": {"fg": "black", "bg": "gray90", "attrs": ["bold"]}, + "session:prefix": {"fg": "gray90", "bg": "darkblue", "attrs": ["bold"]} } } diff --git a/powerline/config_files/colorschemes/vim/default.json b/powerline/config_files/colorschemes/vim/default.json index dd62fdb0..979ddc3f 100644 --- a/powerline/config_files/colorschemes/vim/default.json +++ b/powerline/config_files/colorschemes/vim/default.json @@ -1,38 +1,38 @@ { "name": "Default color scheme", "groups": { - "information:unimportant": { "fg": "gray8", "bg": "gray2", "attr": [] }, - "information:additional": { "fg": "gray9", "bg": "gray4", "attr": [] }, - "background": { "fg": "white", "bg": "gray2", "attr": [] }, - "background:divider": { "fg": "gray6", "bg": "gray2", "attr": [] }, - "mode": { "fg": "darkestgreen", "bg": "brightgreen", "attr": ["bold"] }, - "visual_range": { "fg": "brightestorange", "bg": "darkorange", "attr": ["bold"] }, - "modified_indicator": { "fg": "brightyellow", "bg": "gray4", "attr": ["bold"] }, - "paste_indicator": { "fg": "white", "bg": "mediumorange", "attr": ["bold"] }, - "readonly_indicator": { "fg": "brightestred", "bg": "gray4", "attr": [] }, - "branch_dirty": { "fg": "brightyellow", "bg": "gray4", "attr": [] }, - "branch:divider": { "fg": "gray7", "bg": "gray4", "attr": [] }, - "file_name": { "fg": "white", "bg": "gray4", "attr": ["bold"] }, - "window_title": { "fg": "white", "bg": "gray4", "attr": [] }, - "file_name_no_file": { "fg": "gray9", "bg": "gray4", "attr": ["bold"] }, - "file_vcs_status": { "fg": "brightestred", "bg": "gray4", "attr": [] }, - "file_vcs_status_M": { "fg": "brightyellow", "bg": "gray4", "attr": [] }, - "file_vcs_status_A": { "fg": "brightgreen", "bg": "gray4", "attr": [] }, - "line_percent": { "fg": "gray9", "bg": "gray4", "attr": [] }, - "line_percent_gradient": { "fg": "dark_green_gray", "bg": "gray4", "attr": [] }, - "position": { "fg": "gray9", "bg": "gray4", "attr": [] }, - "position_gradient": { "fg": "green_yellow_red", "bg": "gray4", "attr": [] }, - "line_current": { "fg": "gray1", "bg": "gray10", "attr": ["bold"] }, - "line_current_symbol": { "fg": "gray1", "bg": "gray10", "attr": [] }, - "virtcol_current_gradient": { "fg": "dark_GREEN_Orange_red", "bg": "gray10", "attr": [] }, - "col_current": { "fg": "gray6", "bg": "gray10", "attr": [] }, - "modified_buffers": { "fg": "brightyellow", "bg": "gray2", "attr": [] }, - "attached_clients": { "fg": "gray8", "bg": "gray2", "attr": [] }, - "error": { "fg": "brightestred", "bg": "darkred", "attr": ["bold"] }, - "warning": { "fg": "brightyellow", "bg": "darkorange", "attr": ["bold"] }, - "current_tag": { "fg": "gray9", "bg": "gray2", "attr": [] }, + "information:unimportant": { "fg": "gray8", "bg": "gray2", "attrs": [] }, + "information:additional": { "fg": "gray9", "bg": "gray4", "attrs": [] }, + "background": { "fg": "white", "bg": "gray2", "attrs": [] }, + "background:divider": { "fg": "gray6", "bg": "gray2", "attrs": [] }, + "mode": { "fg": "darkestgreen", "bg": "brightgreen", "attrs": ["bold"] }, + "visual_range": { "fg": "brightestorange", "bg": "darkorange", "attrs": ["bold"] }, + "modified_indicator": { "fg": "brightyellow", "bg": "gray4", "attrs": ["bold"] }, + "paste_indicator": { "fg": "white", "bg": "mediumorange", "attrs": ["bold"] }, + "readonly_indicator": { "fg": "brightestred", "bg": "gray4", "attrs": [] }, + "branch_dirty": { "fg": "brightyellow", "bg": "gray4", "attrs": [] }, + "branch:divider": { "fg": "gray7", "bg": "gray4", "attrs": [] }, + "file_name": { "fg": "white", "bg": "gray4", "attrs": ["bold"] }, + "window_title": { "fg": "white", "bg": "gray4", "attrs": [] }, + "file_name_no_file": { "fg": "gray9", "bg": "gray4", "attrs": ["bold"] }, + "file_vcs_status": { "fg": "brightestred", "bg": "gray4", "attrs": [] }, + "file_vcs_status_M": { "fg": "brightyellow", "bg": "gray4", "attrs": [] }, + "file_vcs_status_A": { "fg": "brightgreen", "bg": "gray4", "attrs": [] }, + "line_percent": { "fg": "gray9", "bg": "gray4", "attrs": [] }, + "line_percent_gradient": { "fg": "dark_green_gray", "bg": "gray4", "attrs": [] }, + "position": { "fg": "gray9", "bg": "gray4", "attrs": [] }, + "position_gradient": { "fg": "green_yellow_red", "bg": "gray4", "attrs": [] }, + "line_current": { "fg": "gray1", "bg": "gray10", "attrs": ["bold"] }, + "line_current_symbol": { "fg": "gray1", "bg": "gray10", "attrs": [] }, + "virtcol_current_gradient": { "fg": "dark_GREEN_Orange_red", "bg": "gray10", "attrs": [] }, + "col_current": { "fg": "gray6", "bg": "gray10", "attrs": [] }, + "modified_buffers": { "fg": "brightyellow", "bg": "gray2", "attrs": [] }, + "attached_clients": { "fg": "gray8", "bg": "gray2", "attrs": [] }, + "error": { "fg": "brightestred", "bg": "darkred", "attrs": ["bold"] }, + "warning": { "fg": "brightyellow", "bg": "darkorange", "attrs": ["bold"] }, + "current_tag": { "fg": "gray9", "bg": "gray2", "attrs": [] }, - "tab_nc:modified_indicator": { "fg": "brightyellow", "bg": "gray2", "attr": ["bold"] } + "tab_nc:modified_indicator": { "fg": "brightyellow", "bg": "gray2", "attrs": ["bold"] } }, "mode_translations": { "nc": { @@ -71,29 +71,29 @@ "dark_green_gray": "light_green_gray" }, "groups": { - "mode": { "fg": "darkestcyan", "bg": "white", "attr": ["bold"] }, - "background:divider": { "fg": "darkcyan", "bg": "darkestblue", "attr": [] }, - "branch:divider": { "fg": "darkcyan", "bg": "darkblue", "attr": [] } + "mode": { "fg": "darkestcyan", "bg": "white", "attrs": ["bold"] }, + "background:divider": { "fg": "darkcyan", "bg": "darkestblue", "attrs": [] }, + "branch:divider": { "fg": "darkcyan", "bg": "darkblue", "attrs": [] } } }, "v": { "groups": { - "mode": { "fg": "darkorange", "bg": "brightestorange", "attr": ["bold"] } + "mode": { "fg": "darkorange", "bg": "brightestorange", "attrs": ["bold"] } } }, "V": { "groups": { - "mode": { "fg": "darkorange", "bg": "brightestorange", "attr": ["bold"] } + "mode": { "fg": "darkorange", "bg": "brightestorange", "attrs": ["bold"] } } }, "^V": { "groups": { - "mode": { "fg": "darkorange", "bg": "brightestorange", "attr": ["bold"] } + "mode": { "fg": "darkorange", "bg": "brightestorange", "attrs": ["bold"] } } }, "R": { "groups": { - "mode": { "fg": "white", "bg": "brightred", "attr": ["bold"] } + "mode": { "fg": "white", "bg": "brightred", "attrs": ["bold"] } } } } diff --git a/powerline/config_files/colorschemes/vim/solarized.json b/powerline/config_files/colorschemes/vim/solarized.json index b0fa497d..bf603851 100644 --- a/powerline/config_files/colorschemes/vim/solarized.json +++ b/powerline/config_files/colorschemes/vim/solarized.json @@ -1,37 +1,37 @@ { "name": "Solarized dark for vim", "groups": { - "information:additional": { "fg": "solarized:base2", "bg": "solarized:base01", "attr": [] }, - "information:unimportant": { "fg": "solarized:base3", "bg": "solarized:base01", "attr": [] }, - "background": { "fg": "solarized:base3", "bg": "solarized:base02", "attr": [] }, - "background:divider": { "fg": "solarized:base00", "bg": "solarized:base02", "attr": [] }, - "mode": { "fg": "solarized:base3", "bg": "solarized:green", "attr": ["bold"] }, - "visual_range": { "fg": "solarized:green", "bg": "solarized:base3", "attr": ["bold"] }, - "modified_indicator": { "fg": "solarized:yellow", "bg": "solarized:base01", "attr": ["bold"] }, - "paste_indicator": { "fg": "solarized:base3", "bg": "solarized:orange", "attr": ["bold"] }, - "readonly_indicator": { "fg": "solarized:red", "bg": "solarized:base01", "attr": [] }, - "branch_dirty": { "fg": "solarized:yellow", "bg": "solarized:base01", "attr": [] }, - "branch:divider": { "fg": "solarized:base1", "bg": "solarized:base01", "attr": [] }, - "file_name": { "fg": "solarized:base3", "bg": "solarized:base01", "attr": ["bold"] }, - "window_title": { "fg": "solarized:base3", "bg": "solarized:base01", "attr": [] }, - "file_name_no_file": { "fg": "solarized:base3", "bg": "solarized:base01", "attr": ["bold"] }, - "file_format": { "fg": "solarized:base1", "bg": "solarized:base02", "attr": [] }, - "file_vcs_status": { "fg": "solarized:red", "bg": "solarized:base01", "attr": [] }, - "file_vcs_status_M": { "fg": "solarized:yellow", "bg": "solarized:base01", "attr": [] }, - "file_vcs_status_A": { "fg": "solarized:green", "bg": "solarized:base01", "attr": [] }, - "line_percent": { "fg": "solarized:base3", "bg": "solarized:base00", "attr": [] }, - "line_percent_gradient": { "fg": "green_yellow_orange_red", "bg": "solarized:base00", "attr": [] }, - "position": { "fg": "solarized:base3", "bg": "solarized:base00", "attr": [] }, - "position_gradient": { "fg": "green_yellow_orange_red", "bg": "solarized:base00", "attr": [] }, - "line_current": { "fg": "solarized:base03", "bg": "solarized:base2", "attr": ["bold"] }, - "line_current_symbol": { "fg": "solarized:base03", "bg": "solarized:base2", "attr": [] }, - "virtcol_current_gradient": { "fg": "GREEN_Orange_red", "bg": "solarized:base2", "attr": [] }, - "col_current": { "fg": "solarized:base0", "bg": "solarized:base2", "attr": [] }, - "environment": { "fg": "solarized:base1", "bg": "solarized:base02", "attr": [] }, - "attached_clients": { "fg": "solarized:base1", "bg": "solarized:base02", "attr": [] }, - "error": { "fg": "solarized:base3", "bg": "solarized:red", "attr": ["bold"] }, - "warning": { "fg": "solarized:base3", "bg": "solarized:orange", "attr": ["bold"] }, - "current_tag": { "fg": "solarized:base3", "bg": "solarized:base02", "attr": ["bold"] } + "information:additional": { "fg": "solarized:base2", "bg": "solarized:base01", "attrs": [] }, + "information:unimportant": { "fg": "solarized:base3", "bg": "solarized:base01", "attrs": [] }, + "background": { "fg": "solarized:base3", "bg": "solarized:base02", "attrs": [] }, + "background:divider": { "fg": "solarized:base00", "bg": "solarized:base02", "attrs": [] }, + "mode": { "fg": "solarized:base3", "bg": "solarized:green", "attrs": ["bold"] }, + "visual_range": { "fg": "solarized:green", "bg": "solarized:base3", "attrs": ["bold"] }, + "modified_indicator": { "fg": "solarized:yellow", "bg": "solarized:base01", "attrs": ["bold"] }, + "paste_indicator": { "fg": "solarized:base3", "bg": "solarized:orange", "attrs": ["bold"] }, + "readonly_indicator": { "fg": "solarized:red", "bg": "solarized:base01", "attrs": [] }, + "branch_dirty": { "fg": "solarized:yellow", "bg": "solarized:base01", "attrs": [] }, + "branch:divider": { "fg": "solarized:base1", "bg": "solarized:base01", "attrs": [] }, + "file_name": { "fg": "solarized:base3", "bg": "solarized:base01", "attrs": ["bold"] }, + "window_title": { "fg": "solarized:base3", "bg": "solarized:base01", "attrs": [] }, + "file_name_no_file": { "fg": "solarized:base3", "bg": "solarized:base01", "attrs": ["bold"] }, + "file_format": { "fg": "solarized:base1", "bg": "solarized:base02", "attrs": [] }, + "file_vcs_status": { "fg": "solarized:red", "bg": "solarized:base01", "attrs": [] }, + "file_vcs_status_M": { "fg": "solarized:yellow", "bg": "solarized:base01", "attrs": [] }, + "file_vcs_status_A": { "fg": "solarized:green", "bg": "solarized:base01", "attrs": [] }, + "line_percent": { "fg": "solarized:base3", "bg": "solarized:base00", "attrs": [] }, + "line_percent_gradient": { "fg": "green_yellow_orange_red", "bg": "solarized:base00", "attrs": [] }, + "position": { "fg": "solarized:base3", "bg": "solarized:base00", "attrs": [] }, + "position_gradient": { "fg": "green_yellow_orange_red", "bg": "solarized:base00", "attrs": [] }, + "line_current": { "fg": "solarized:base03", "bg": "solarized:base2", "attrs": ["bold"] }, + "line_current_symbol": { "fg": "solarized:base03", "bg": "solarized:base2", "attrs": [] }, + "virtcol_current_gradient": { "fg": "GREEN_Orange_red", "bg": "solarized:base2", "attrs": [] }, + "col_current": { "fg": "solarized:base0", "bg": "solarized:base2", "attrs": [] }, + "environment": { "fg": "solarized:base1", "bg": "solarized:base02", "attrs": [] }, + "attached_clients": { "fg": "solarized:base1", "bg": "solarized:base02", "attrs": [] }, + "error": { "fg": "solarized:base3", "bg": "solarized:red", "attrs": ["bold"] }, + "warning": { "fg": "solarized:base3", "bg": "solarized:orange", "attrs": ["bold"] }, + "current_tag": { "fg": "solarized:base3", "bg": "solarized:base02", "attrs": ["bold"] } }, "mode_translations": { "nc": { @@ -46,50 +46,50 @@ }, "i": { "groups": { - "background": { "fg": "solarized:base3", "bg": "solarized:base01", "attr": [] }, - "background:divider": { "fg": "solarized:base2", "bg": "solarized:base01", "attr": [] }, - "mode": { "fg": "solarized:base3", "bg": "solarized:blue", "attr": ["bold"] }, - "modified_indicator": { "fg": "solarized:yellow", "bg": "solarized:base2", "attr": ["bold"] }, - "paste_indicator": { "fg": "solarized:base3", "bg": "solarized:orange", "attr": ["bold"] }, - "readonly_indicator": { "fg": "solarized:red", "bg": "solarized:base2", "attr": [] }, - "branch": { "fg": "solarized:base01", "bg": "solarized:base2", "attr": [] }, - "branch:divider": { "fg": "solarized:base00", "bg": "solarized:base2", "attr": [] }, - "file_directory": { "fg": "solarized:base01", "bg": "solarized:base2", "attr": [] }, - "file_name": { "fg": "solarized:base02", "bg": "solarized:base2", "attr": ["bold"] }, - "file_size": { "fg": "solarized:base02", "bg": "solarized:base2", "attr": [] }, - "file_name_no_file": { "fg": "solarized:base02", "bg": "solarized:base2", "attr": ["bold"] }, - "file_name_empty": { "fg": "solarized:base02", "bg": "solarized:base2", "attr": [] }, - "file_format": { "fg": "solarized:base2", "bg": "solarized:base01", "attr": [] }, - "file_vcs_status": { "fg": "solarized:red", "bg": "solarized:base2", "attr": [] }, - "file_vcs_status_M": { "fg": "solarized:yellow", "bg": "solarized:base2", "attr": [] }, - "file_vcs_status_A": { "fg": "solarized:green", "bg": "solarized:base2", "attr": [] }, - "line_percent": { "fg": "solarized:base3", "bg": "solarized:base1", "attr": [] }, - "line_percent_gradient": { "fg": "solarized:base3", "bg": "solarized:base1", "attr": [] }, - "position": { "fg": "solarized:base3", "bg": "solarized:base1", "attr": [] }, - "position_gradient": { "fg": "solarized:base3", "bg": "solarized:base1", "attr": [] }, - "line_current": { "fg": "solarized:base03", "bg": "solarized:base3", "attr": ["bold"] }, - "line_current_symbol": { "fg": "solarized:base03", "bg": "solarized:base3", "attr": [] }, - "col_current": { "fg": "solarized:base0", "bg": "solarized:base3", "attr": [] } + "background": { "fg": "solarized:base3", "bg": "solarized:base01", "attrs": [] }, + "background:divider": { "fg": "solarized:base2", "bg": "solarized:base01", "attrs": [] }, + "mode": { "fg": "solarized:base3", "bg": "solarized:blue", "attrs": ["bold"] }, + "modified_indicator": { "fg": "solarized:yellow", "bg": "solarized:base2", "attrs": ["bold"] }, + "paste_indicator": { "fg": "solarized:base3", "bg": "solarized:orange", "attrs": ["bold"] }, + "readonly_indicator": { "fg": "solarized:red", "bg": "solarized:base2", "attrs": [] }, + "branch": { "fg": "solarized:base01", "bg": "solarized:base2", "attrs": [] }, + "branch:divider": { "fg": "solarized:base00", "bg": "solarized:base2", "attrs": [] }, + "file_directory": { "fg": "solarized:base01", "bg": "solarized:base2", "attrs": [] }, + "file_name": { "fg": "solarized:base02", "bg": "solarized:base2", "attrs": ["bold"] }, + "file_size": { "fg": "solarized:base02", "bg": "solarized:base2", "attrs": [] }, + "file_name_no_file": { "fg": "solarized:base02", "bg": "solarized:base2", "attrs": ["bold"] }, + "file_name_empty": { "fg": "solarized:base02", "bg": "solarized:base2", "attrs": [] }, + "file_format": { "fg": "solarized:base2", "bg": "solarized:base01", "attrs": [] }, + "file_vcs_status": { "fg": "solarized:red", "bg": "solarized:base2", "attrs": [] }, + "file_vcs_status_M": { "fg": "solarized:yellow", "bg": "solarized:base2", "attrs": [] }, + "file_vcs_status_A": { "fg": "solarized:green", "bg": "solarized:base2", "attrs": [] }, + "line_percent": { "fg": "solarized:base3", "bg": "solarized:base1", "attrs": [] }, + "line_percent_gradient": { "fg": "solarized:base3", "bg": "solarized:base1", "attrs": [] }, + "position": { "fg": "solarized:base3", "bg": "solarized:base1", "attrs": [] }, + "position_gradient": { "fg": "solarized:base3", "bg": "solarized:base1", "attrs": [] }, + "line_current": { "fg": "solarized:base03", "bg": "solarized:base3", "attrs": ["bold"] }, + "line_current_symbol": { "fg": "solarized:base03", "bg": "solarized:base3", "attrs": [] }, + "col_current": { "fg": "solarized:base0", "bg": "solarized:base3", "attrs": [] } } }, "v": { "groups": { - "mode": { "fg": "solarized:base3", "bg": "solarized:orange", "attr": ["bold"] } + "mode": { "fg": "solarized:base3", "bg": "solarized:orange", "attrs": ["bold"] } } }, "V": { "groups": { - "mode": { "fg": "solarized:base3", "bg": "solarized:orange", "attr": ["bold"] } + "mode": { "fg": "solarized:base3", "bg": "solarized:orange", "attrs": ["bold"] } } }, "^V": { "groups": { - "mode": { "fg": "solarized:base3", "bg": "solarized:orange", "attr": ["bold"] } + "mode": { "fg": "solarized:base3", "bg": "solarized:orange", "attrs": ["bold"] } } }, "R": { "groups": { - "mode": { "fg": "solarized:base3", "bg": "solarized:red", "attr": ["bold"] } + "mode": { "fg": "solarized:base3", "bg": "solarized:red", "attrs": ["bold"] } } } } diff --git a/powerline/config_files/colorschemes/vim/solarizedlight.json b/powerline/config_files/colorschemes/vim/solarizedlight.json index f6c1e178..2dcbb23d 100644 --- a/powerline/config_files/colorschemes/vim/solarizedlight.json +++ b/powerline/config_files/colorschemes/vim/solarizedlight.json @@ -1,36 +1,36 @@ { "name": "Solarized light for vim", "groups": { - "information:additional": { "fg": "solarized:base02", "bg": "solarized:base2", "attr": [] }, - "information:unimportant": { "fg": "solarized:base1", "bg": "solarized:base01", "attr": [] }, - "background": { "fg": "solarized:base03", "bg": "solarized:base01", "attr": [] }, - "background:divider": { "fg": "solarized:base0", "bg": "solarized:base01", "attr": [] }, - "mode": { "fg": "solarized:base3", "bg": "solarized:green", "attr": ["bold"] }, - "visual_range": { "fg": "solarized:green", "bg": "solarized:base3", "attr": ["bold"] }, - "modified_indicator": { "fg": "solarized:yellow", "bg": "solarized:base2", "attr": ["bold"] }, - "paste_indicator": { "fg": "solarized:red", "bg": "solarized:base2", "attr": ["bold"] }, - "readonly_indicator": { "fg": "solarized:red", "bg": "solarized:base2", "attr": [] }, - "branch_dirty": { "fg": "solarized:yellow", "bg": "solarized:base2", "attr": [] }, - "branch:divider": { "fg": "solarized:base1", "bg": "solarized:base2", "attr": [] }, - "file_name": { "fg": "solarized:base03", "bg": "solarized:base2", "attr": ["bold"] }, - "window_title": { "fg": "solarized:base03", "bg": "solarized:base2", "attr": [] }, - "file_size": { "fg": "solarized:base03", "bg": "solarized:base2", "attr": [] }, - "file_name_no_file": { "fg": "solarized:base03", "bg": "solarized:base2", "attr": ["bold"] }, - "file_name_empty": { "fg": "solarized:base03", "bg": "solarized:base2", "attr": [] }, - "file_vcs_status": { "fg": "solarized:red", "bg": "solarized:base2", "attr": [] }, - "file_vcs_status_M": { "fg": "solarized:yellow", "bg": "solarized:base2", "attr": [] }, - "file_vcs_status_A": { "fg": "solarized:green", "bg": "solarized:base2", "attr": [] }, - "line_percent": { "fg": "solarized:base03", "bg": "solarized:base2", "attr": [] }, - "line_percent_gradient": { "fg": "green_yellow_orange_red", "bg": "solarized:base2", "attr": [] }, - "position": { "fg": "solarized:base03", "bg": "solarized:base2", "attr": [] }, - "position_gradient": { "fg": "green_yellow_orange_red", "bg": "solarized:base2", "attr": [] }, - "line_current": { "fg": "solarized:base3", "bg": "solarized:base02", "attr": ["bold"] }, - "line_current_symbol": { "fg": "solarized:base3", "bg": "solarized:base02", "attr": [] }, - "virtcol_current_gradient": { "fg": "yellow_orange_red", "bg": "solarized:base02", "attr": [] }, - "col_current": { "fg": "solarized:base00", "bg": "solarized:base02", "attr": [] }, - "error": { "fg": "solarized:base03", "bg": "solarized:red", "attr": ["bold"] }, - "warning": { "fg": "solarized:base03", "bg": "solarized:base2", "attr": ["bold"] }, - "current_tag": { "fg": "solarized:base03", "bg": "solarized:base01", "attr": ["bold"] } + "information:additional": { "fg": "solarized:base02", "bg": "solarized:base2", "attrs": [] }, + "information:unimportant": { "fg": "solarized:base1", "bg": "solarized:base01", "attrs": [] }, + "background": { "fg": "solarized:base03", "bg": "solarized:base01", "attrs": [] }, + "background:divider": { "fg": "solarized:base0", "bg": "solarized:base01", "attrs": [] }, + "mode": { "fg": "solarized:base3", "bg": "solarized:green", "attrs": ["bold"] }, + "visual_range": { "fg": "solarized:green", "bg": "solarized:base3", "attrs": ["bold"] }, + "modified_indicator": { "fg": "solarized:yellow", "bg": "solarized:base2", "attrs": ["bold"] }, + "paste_indicator": { "fg": "solarized:red", "bg": "solarized:base2", "attrs": ["bold"] }, + "readonly_indicator": { "fg": "solarized:red", "bg": "solarized:base2", "attrs": [] }, + "branch_dirty": { "fg": "solarized:yellow", "bg": "solarized:base2", "attrs": [] }, + "branch:divider": { "fg": "solarized:base1", "bg": "solarized:base2", "attrs": [] }, + "file_name": { "fg": "solarized:base03", "bg": "solarized:base2", "attrs": ["bold"] }, + "window_title": { "fg": "solarized:base03", "bg": "solarized:base2", "attrs": [] }, + "file_size": { "fg": "solarized:base03", "bg": "solarized:base2", "attrs": [] }, + "file_name_no_file": { "fg": "solarized:base03", "bg": "solarized:base2", "attrs": ["bold"] }, + "file_name_empty": { "fg": "solarized:base03", "bg": "solarized:base2", "attrs": [] }, + "file_vcs_status": { "fg": "solarized:red", "bg": "solarized:base2", "attrs": [] }, + "file_vcs_status_M": { "fg": "solarized:yellow", "bg": "solarized:base2", "attrs": [] }, + "file_vcs_status_A": { "fg": "solarized:green", "bg": "solarized:base2", "attrs": [] }, + "line_percent": { "fg": "solarized:base03", "bg": "solarized:base2", "attrs": [] }, + "line_percent_gradient": { "fg": "green_yellow_orange_red", "bg": "solarized:base2", "attrs": [] }, + "position": { "fg": "solarized:base03", "bg": "solarized:base2", "attrs": [] }, + "position_gradient": { "fg": "green_yellow_orange_red", "bg": "solarized:base2", "attrs": [] }, + "line_current": { "fg": "solarized:base3", "bg": "solarized:base02", "attrs": ["bold"] }, + "line_current_symbol": { "fg": "solarized:base3", "bg": "solarized:base02", "attrs": [] }, + "virtcol_current_gradient": { "fg": "yellow_orange_red", "bg": "solarized:base02", "attrs": [] }, + "col_current": { "fg": "solarized:base00", "bg": "solarized:base02", "attrs": [] }, + "error": { "fg": "solarized:base03", "bg": "solarized:red", "attrs": ["bold"] }, + "warning": { "fg": "solarized:base03", "bg": "solarized:base2", "attrs": ["bold"] }, + "current_tag": { "fg": "solarized:base03", "bg": "solarized:base01", "attrs": ["bold"] } }, "mode_translations": { "nc": { @@ -45,51 +45,51 @@ }, "i": { "groups": { - "background": { "fg": "solarized:base03", "bg": "solarized:base2", "attr": [] }, - "background:divider": { "fg": "solarized:base02", "bg": "solarized:base2", "attr": [] }, - "mode": { "fg": "solarized:base3", "bg": "solarized:blue", "attr": ["bold"] }, - "modified_indicator": { "fg": "solarized:yellow", "bg": "solarized:base02", "attr": ["bold"] }, - "paste_indicator": { "fg": "solarized:base3", "bg": "solarized:orange", "attr": ["bold"] }, - "readonly_indicator": { "fg": "solarized:red", "bg": "solarized:base02", "attr": [] }, - "branch": { "fg": "solarized:base2", "bg": "solarized:base02", "attr": [] }, - "branch:divider": { "fg": "solarized:base0", "bg": "solarized:base02", "attr": [] }, - "file_directory": { "fg": "solarized:base2", "bg": "solarized:base02", "attr": [] }, - "file_name": { "fg": "solarized:base01", "bg": "solarized:base02", "attr": ["bold"] }, - "file_size": { "fg": "solarized:base01", "bg": "solarized:base02", "attr": [] }, - "file_name_no_file": { "fg": "solarized:base01", "bg": "solarized:base02", "attr": ["bold"] }, - "file_name_empty": { "fg": "solarized:base01", "bg": "solarized:base02", "attr": [] }, - "file_format": { "fg": "solarized:base02", "bg": "solarized:base2", "attr": [] }, - "file_vcs_status": { "fg": "solarized:red", "bg": "solarized:base02", "attr": [] }, - "file_vcs_status_M": { "fg": "solarized:yellow", "bg": "solarized:base02", "attr": [] }, - "file_vcs_status_A": { "fg": "solarized:green", "bg": "solarized:base02", "attr": [] }, - "line_percent": { "fg": "solarized:base03", "bg": "solarized:base1", "attr": [] }, - "line_percent_gradient": { "fg": "solarized:base03", "bg": "solarized:base1", "attr": [] }, - "position": { "fg": "solarized:base03", "bg": "solarized:base1", "attr": [] }, - "position_gradient": { "fg": "solarized:base03", "bg": "solarized:base1", "attr": [] }, - "line_current": { "fg": "solarized:base3", "bg": "solarized:base03", "attr": ["bold"] }, - "line_current_symbol": { "fg": "solarized:base3", "bg": "solarized:base03", "attr": [] }, - "virtcol_current_gradient": { "fg": "yellow_orange_red", "bg": "solarized:base03", "attr": [] }, - "col_current": { "fg": "solarized:base00", "bg": "solarized:base03", "attr": [] } + "background": { "fg": "solarized:base03", "bg": "solarized:base2", "attrs": [] }, + "background:divider": { "fg": "solarized:base02", "bg": "solarized:base2", "attrs": [] }, + "mode": { "fg": "solarized:base3", "bg": "solarized:blue", "attrs": ["bold"] }, + "modified_indicator": { "fg": "solarized:yellow", "bg": "solarized:base02", "attrs": ["bold"] }, + "paste_indicator": { "fg": "solarized:base3", "bg": "solarized:orange", "attrs": ["bold"] }, + "readonly_indicator": { "fg": "solarized:red", "bg": "solarized:base02", "attrs": [] }, + "branch": { "fg": "solarized:base2", "bg": "solarized:base02", "attrs": [] }, + "branch:divider": { "fg": "solarized:base0", "bg": "solarized:base02", "attrs": [] }, + "file_directory": { "fg": "solarized:base2", "bg": "solarized:base02", "attrs": [] }, + "file_name": { "fg": "solarized:base01", "bg": "solarized:base02", "attrs": ["bold"] }, + "file_size": { "fg": "solarized:base01", "bg": "solarized:base02", "attrs": [] }, + "file_name_no_file": { "fg": "solarized:base01", "bg": "solarized:base02", "attrs": ["bold"] }, + "file_name_empty": { "fg": "solarized:base01", "bg": "solarized:base02", "attrs": [] }, + "file_format": { "fg": "solarized:base02", "bg": "solarized:base2", "attrs": [] }, + "file_vcs_status": { "fg": "solarized:red", "bg": "solarized:base02", "attrs": [] }, + "file_vcs_status_M": { "fg": "solarized:yellow", "bg": "solarized:base02", "attrs": [] }, + "file_vcs_status_A": { "fg": "solarized:green", "bg": "solarized:base02", "attrs": [] }, + "line_percent": { "fg": "solarized:base03", "bg": "solarized:base1", "attrs": [] }, + "line_percent_gradient": { "fg": "solarized:base03", "bg": "solarized:base1", "attrs": [] }, + "position": { "fg": "solarized:base03", "bg": "solarized:base1", "attrs": [] }, + "position_gradient": { "fg": "solarized:base03", "bg": "solarized:base1", "attrs": [] }, + "line_current": { "fg": "solarized:base3", "bg": "solarized:base03", "attrs": ["bold"] }, + "line_current_symbol": { "fg": "solarized:base3", "bg": "solarized:base03", "attrs": [] }, + "virtcol_current_gradient": { "fg": "yellow_orange_red", "bg": "solarized:base03", "attrs": [] }, + "col_current": { "fg": "solarized:base00", "bg": "solarized:base03", "attrs": [] } } }, "v": { "groups": { - "mode": { "fg": "solarized:base3", "bg": "solarized:orange", "attr": ["bold"] } + "mode": { "fg": "solarized:base3", "bg": "solarized:orange", "attrs": ["bold"] } } }, "V": { "groups": { - "mode": { "fg": "solarized:base3", "bg": "solarized:orange", "attr": ["bold"] } + "mode": { "fg": "solarized:base3", "bg": "solarized:orange", "attrs": ["bold"] } } }, "^V": { "groups": { - "mode": { "fg": "solarized:base3", "bg": "solarized:orange", "attr": ["bold"] } + "mode": { "fg": "solarized:base3", "bg": "solarized:orange", "attrs": ["bold"] } } }, "R": { "groups": { - "mode": { "fg": "solarized:base3", "bg": "solarized:red", "attr": ["bold"] } + "mode": { "fg": "solarized:base3", "bg": "solarized:red", "attrs": ["bold"] } } } } diff --git a/powerline/lint/__init__.py b/powerline/lint/__init__.py index 04368c0a..e422b876 100644 --- a/powerline/lint/__init__.py +++ b/powerline/lint/__init__.py @@ -142,7 +142,7 @@ group_name_spec = Spec().ident().copy group_spec = Spec().either(Spec( fg=color_spec(), bg=color_spec(), - attr=Spec().list(Spec().type(unicode).oneof(set(('bold', 'italic', 'underline')))), + attrs=Spec().list(Spec().type(unicode).oneof(set(('bold', 'italic', 'underline')))), ), group_name_spec().func(check_group)).copy groups_spec = Spec().unknown_spec( group_name_spec(), diff --git a/powerline/renderer.py b/powerline/renderer.py index 6c60fc79..6d9b56a7 100644 --- a/powerline/renderer.py +++ b/powerline/renderer.py @@ -492,7 +492,7 @@ class Renderer(object): ''' return string.translate(self.character_translations) - def hlstyle(fg=None, bg=None, attr=None): + def hlstyle(fg=None, bg=None, attrs=None): '''Output highlight style string. Assuming highlighted string looks like ``{style}{contents}`` this method @@ -501,10 +501,10 @@ class Renderer(object): ''' raise NotImplementedError - def hl(self, contents, fg=None, bg=None, attr=None): + def hl(self, contents, fg=None, bg=None, attrs=None): '''Output highlighted chunk. This implementation just outputs ``.hlstyle()`` joined with ``contents``. ''' - return self.hlstyle(fg, bg, attr) + (contents or '') + return self.hlstyle(fg, bg, attrs) + (contents or '') diff --git a/powerline/renderers/i3bar.py b/powerline/renderers/i3bar.py index 9fbdaa0b..dd180941 100644 --- a/powerline/renderers/i3bar.py +++ b/powerline/renderers/i3bar.py @@ -17,7 +17,7 @@ class I3barRenderer(Renderer): # We don’t need to explicitly reset attributes, so skip those calls return '' - def hl(self, contents, fg=None, bg=None, attr=None): + def hl(self, contents, fg=None, bg=None, attrs=None): segment = { 'full_text': contents, 'separator': False, diff --git a/powerline/renderers/pango_markup.py b/powerline/renderers/pango_markup.py index e0dfa481..1b7d624b 100644 --- a/powerline/renderers/pango_markup.py +++ b/powerline/renderers/pango_markup.py @@ -15,7 +15,7 @@ class PangoMarkupRenderer(Renderer): # We don’t need to explicitly reset attributes, so skip those calls return '' - def hl(self, contents, fg=None, bg=None, attr=None): + def hl(self, contents, fg=None, bg=None, attrs=None): '''Highlight a segment.''' awesome_attr = [] if fg is not None: @@ -24,12 +24,12 @@ class PangoMarkupRenderer(Renderer): if bg is not None: if bg is not False and bg[1] is not False: awesome_attr += ['background="#{0:06x}"'.format(bg[1])] - if attr is not None and attr is not False: - if attr & ATTR_BOLD: + if attrs is not None and attrs is not False: + if attrs & ATTR_BOLD: awesome_attr += ['font_weight="bold"'] - if attr & ATTR_ITALIC: + if attrs & ATTR_ITALIC: awesome_attr += ['font_style="italic"'] - if attr & ATTR_UNDERLINE: + if attrs & ATTR_UNDERLINE: awesome_attr += ['underline="single"'] return '' + contents + '' diff --git a/powerline/renderers/shell/__init__.py b/powerline/renderers/shell/__init__.py index 90aa83ad..21b5130e 100644 --- a/powerline/renderers/shell/__init__.py +++ b/powerline/renderers/shell/__init__.py @@ -85,7 +85,7 @@ class ShellRenderer(Renderer): else: return ret - def hlstyle(self, fg=None, bg=None, attr=None): + def hlstyle(self, fg=None, bg=None, attrs=None): '''Highlight a segment. If an argument is None, the argument is ignored. If an argument is @@ -111,17 +111,17 @@ class ShellRenderer(Renderer): ansi += [48, 2] + list(int_to_rgb(bg[1])) else: ansi += [48, 5, bg[0]] - if attr is not None: - if attr is False: + if attrs is not None: + if attrs is False: ansi += [22] else: - if attr & ATTR_BOLD: + if attrs & ATTR_BOLD: ansi += [1] - elif attr & ATTR_ITALIC: + elif attrs & ATTR_ITALIC: # Note: is likely not to work or even be inverse in place of # italic. Omit using this in colorschemes. ansi += [3] - elif attr & ATTR_UNDERLINE: + elif attrs & ATTR_UNDERLINE: ansi += [4] if is_fbterm: r = [] diff --git a/powerline/renderers/tmux.py b/powerline/renderers/tmux.py index 7e7d5abd..ef832877 100644 --- a/powerline/renderers/tmux.py +++ b/powerline/renderers/tmux.py @@ -5,20 +5,20 @@ from powerline.renderer import Renderer from powerline.colorscheme import ATTR_BOLD, ATTR_ITALIC, ATTR_UNDERLINE -def attr_to_tmux_attr(attr): - if attr is False: +def attrs_to_tmux_attrs(attrs): + if attrs is False: return ['nobold', 'noitalics', 'nounderscore'] else: ret = [] - if attr & ATTR_BOLD: + if attrs & ATTR_BOLD: ret += ['bold'] else: ret += ['nobold'] - if attr & ATTR_ITALIC: + if attrs & ATTR_ITALIC: ret += ['italics'] else: ret += ['noitalics'] - if attr & ATTR_UNDERLINE: + if attrs & ATTR_UNDERLINE: ret += ['underscore'] else: ret += ['nounderscore'] @@ -31,25 +31,25 @@ class TmuxRenderer(Renderer): character_translations = Renderer.character_translations.copy() character_translations[ord('#')] = '##[]' - def hlstyle(self, fg=None, bg=None, attr=None): + def hlstyle(self, fg=None, bg=None, attrs=None): '''Highlight a segment.''' # We don’t need to explicitly reset attributes, so skip those calls - if not attr and not bg and not fg: + if not attrs and not bg and not fg: return '' - tmux_attr = [] + tmux_attrs = [] if fg is not None: if fg is False or fg[0] is False: - tmux_attr += ['fg=default'] + tmux_attrs += ['fg=default'] else: - tmux_attr += ['fg=colour' + str(fg[0])] + tmux_attrs += ['fg=colour' + str(fg[0])] if bg is not None: if bg is False or bg[0] is False: - tmux_attr += ['bg=default'] + tmux_attrs += ['bg=default'] else: - tmux_attr += ['bg=colour' + str(bg[0])] - if attr is not None: - tmux_attr += attr_to_tmux_attr(attr) - return '#[' + ','.join(tmux_attr) + ']' + tmux_attrs += ['bg=colour' + str(bg[0])] + if attrs is not None: + tmux_attrs += attrs_to_tmux_attrs(attrs) + return '#[' + ','.join(tmux_attrs) + ']' def get_segment_info(self, segment_info, mode): r = self.segment_info.copy() diff --git a/powerline/renderers/vim.py b/powerline/renderers/vim.py index 0656d0b6..281177ce 100644 --- a/powerline/renderers/vim.py +++ b/powerline/renderers/vim.py @@ -123,7 +123,7 @@ class VimRenderer(Renderer): def reset_highlight(self): self.hl_groups.clear() - def hlstyle(self, fg=None, bg=None, attr=None): + def hlstyle(self, fg=None, bg=None, attrs=None): '''Highlight a segment. If an argument is None, the argument is ignored. If an argument is @@ -132,23 +132,23 @@ class VimRenderer(Renderer): ''' # In order not to hit E541 two consequent identical highlighting # specifiers may be squashed into one. - attr = attr or 0 # Normalize `attr` - if (fg, bg, attr) == self.prev_highlight: + attrs = attrs or 0 # Normalize `attrs` + if (fg, bg, attrs) == self.prev_highlight: return '' - self.prev_highlight = (fg, bg, attr) + self.prev_highlight = (fg, bg, attrs) # We don’t need to explicitly reset attributes in vim, so skip those # calls - if not attr and not bg and not fg: + if not attrs and not bg and not fg: return '' - if not (fg, bg, attr) in self.hl_groups: + if not (fg, bg, attrs) in self.hl_groups: hl_group = { 'ctermfg': 'NONE', 'guifg': None, 'ctermbg': 'NONE', 'guibg': None, - 'attr': ['NONE'], + 'attrs': ['NONE'], 'name': '', } if fg is not None and fg is not False: @@ -157,32 +157,32 @@ class VimRenderer(Renderer): if bg is not None and bg is not False: hl_group['ctermbg'] = bg[0] hl_group['guibg'] = bg[1] - if attr: - hl_group['attr'] = [] - if attr & ATTR_BOLD: - hl_group['attr'].append('bold') - if attr & ATTR_ITALIC: - hl_group['attr'].append('italic') - if attr & ATTR_UNDERLINE: - hl_group['attr'].append('underline') + if attrs: + hl_group['attrs'] = [] + if attrs & ATTR_BOLD: + hl_group['attrs'].append('bold') + if attrs & ATTR_ITALIC: + hl_group['attrs'].append('italic') + if attrs & ATTR_UNDERLINE: + hl_group['attrs'].append('underline') hl_group['name'] = ( 'Pl_' + str(hl_group['ctermfg']) + '_' + str(hl_group['guifg']) + '_' + str(hl_group['ctermbg']) + '_' + str(hl_group['guibg']) + '_' - + ''.join(hl_group['attr']) + + ''.join(hl_group['attrs']) ) - self.hl_groups[(fg, bg, attr)] = hl_group - vim.command('hi {group} ctermfg={ctermfg} guifg={guifg} guibg={guibg} ctermbg={ctermbg} cterm={attr} gui={attr}'.format( + self.hl_groups[(fg, bg, attrs)] = hl_group + vim.command('hi {group} ctermfg={ctermfg} guifg={guifg} guibg={guibg} ctermbg={ctermbg} cterm={attrs} gui={attrs}'.format( group=hl_group['name'], ctermfg=hl_group['ctermfg'], guifg='#{0:06x}'.format(hl_group['guifg']) if hl_group['guifg'] is not None else 'NONE', ctermbg=hl_group['ctermbg'], guibg='#{0:06x}'.format(hl_group['guibg']) if hl_group['guibg'] is not None else 'NONE', - attr=','.join(hl_group['attr']), + attrs=','.join(hl_group['attrs']), )) - return '%#' + self.hl_groups[(fg, bg, attr)]['name'] + '#' + return '%#' + self.hl_groups[(fg, bg, attrs)]['name'] + '#' renderer = VimRenderer diff --git a/powerline/theme.py b/powerline/theme.py index 0557e799..26b67a3b 100644 --- a/powerline/theme.py +++ b/powerline/theme.py @@ -72,7 +72,7 @@ class Theme(object): self.segments = [] self.EMPTY_SEGMENT = { 'contents': None, - 'highlight': {'fg': False, 'bg': False, 'attr': 0} + 'highlight': {'fg': False, 'bg': False, 'attrs': 0} } self.pl = pl theme_configs = [theme_config] diff --git a/tests/lib/config_mock.py b/tests/lib/config_mock.py index 7161ea28..dd19ff11 100644 --- a/tests/lib/config_mock.py +++ b/tests/lib/config_mock.py @@ -114,16 +114,16 @@ class Logger(object): class SimpleRenderer(Renderer): - def hlstyle(self, fg=None, bg=None, attr=None): - return '<{fg} {bg} {attr}>'.format(fg=fg and fg[0], bg=bg and bg[0], attr=attr) + def hlstyle(self, fg=None, bg=None, attrs=None): + return '<{fg} {bg} {attrs}>'.format(fg=fg and fg[0], bg=bg and bg[0], attrs=attrs) class EvenSimplerRenderer(Renderer): - def hlstyle(self, fg=None, bg=None, attr=None): - return '{{{fg}{bg}{attr}}}'.format( + def hlstyle(self, fg=None, bg=None, attrs=None): + return '{{{fg}{bg}{attrs}}}'.format( fg=fg and fg[0] or '-', bg=bg and bg[0] or '-', - attr=attr if attr else '', + attrs=attrs if attrs else '', ) diff --git a/tests/test_config_merging.py b/tests/test_config_merging.py index dd8860bf..e0f3d80d 100644 --- a/tests/test_config_merging.py +++ b/tests/test_config_merging.py @@ -44,7 +44,7 @@ colors_config = lambda: { colorscheme_config = lambda: { 'groups': { - 'g': {'fg': 'c1', 'bg': 'c2', 'attr': []}, + 'g': {'fg': 'c1', 'bg': 'c2', 'attrs': []}, } } @@ -246,7 +246,7 @@ class TestMerging(TestCase): with WithConfigTree(mdc(main_tree(), { '2/colorschemes/default': { 'groups': { - 'g': {'fg': 'c2', 'bg': 'c1', 'attr': []}, + 'g': {'fg': 'c2', 'bg': 'c1', 'attrs': []}, } }, })) as p: diff --git a/tests/test_config_reload.py b/tests/test_config_reload.py index 442cde00..6c835c2c 100644 --- a/tests/test_config_reload.py +++ b/tests/test_config_reload.py @@ -34,14 +34,14 @@ config = { }, 'colorschemes/test/default': { 'groups': { - "str1": {"fg": "col1", "bg": "col2", "attr": ["bold"]}, - "str2": {"fg": "col3", "bg": "col4", "attr": ["underline"]}, + 'str1': {'fg': 'col1', 'bg': 'col2', 'attrs': ['bold']}, + 'str2': {'fg': 'col3', 'bg': 'col4', 'attrs': ['underline']}, }, }, 'colorschemes/test/2': { 'groups': { - "str1": {"fg": "col2", "bg": "col3", "attr": ["bold"]}, - "str2": {"fg": "col1", "bg": "col4", "attr": ["underline"]}, + 'str1': {'fg': 'col2', 'bg': 'col3', 'attrs': ['bold']}, + 'str2': {'fg': 'col1', 'bg': 'col4', 'attrs': ['underline']}, }, }, 'themes/test/default': { @@ -227,8 +227,8 @@ class TestConfigReload(TestCase): config['colorschemes/nonexistentraise'] = {} config['colorschemes/test/nonexistentraise'] = { 'groups': { - "str1": {"fg": "col1", "bg": "col3", "attr": ["bold"]}, - "str2": {"fg": "col2", "bg": "col4", "attr": ["underline"]}, + 'str1': {'fg': 'col1', 'bg': 'col3', 'attrs': ['bold']}, + 'str2': {'fg': 'col2', 'bg': 'col4', 'attrs': ['underline']}, }, } while not p._will_create_renderer(): diff --git a/tests/test_configuration.py b/tests/test_configuration.py index 25656859..221d852a 100644 --- a/tests/test_configuration.py +++ b/tests/test_configuration.py @@ -67,20 +67,20 @@ config = { 'groups': { 'm1': 'g1', 'm2': 'g3', - 'm3': {'fg': 'col11', 'bg': 'col12', 'attr': []}, + 'm3': {'fg': 'col11', 'bg': 'col12', 'attrs': []}, } }, 'colorschemes/default': { 'groups': { - 'g1': {'fg': 'col5', 'bg': 'col6', 'attr': []}, - 'g2': {'fg': 'col7', 'bg': 'col8', 'attr': []}, - 'g3': {'fg': 'col9', 'bg': 'col10', 'attr': []}, + 'g1': {'fg': 'col5', 'bg': 'col6', 'attrs': []}, + 'g2': {'fg': 'col7', 'bg': 'col8', 'attrs': []}, + 'g3': {'fg': 'col9', 'bg': 'col10', 'attrs': []}, } }, 'colorschemes/test/default': { 'groups': { - 'str1': {'fg': 'col1', 'bg': 'col2', 'attr': ['bold']}, - 'str2': {'fg': 'col3', 'bg': 'col4', 'attr': ['underline']}, + 'str1': {'fg': 'col1', 'bg': 'col2', 'attrs': ['bold']}, + 'str2': {'fg': 'col3', 'bg': 'col4', 'attrs': ['underline']}, 'd1': 'g2', 'd2': 'm2', 'd3': 'm3', @@ -88,7 +88,7 @@ config = { }, 'colorschemes/vim/default': { 'groups': { - 'environment': {'fg': 'col3', 'bg': 'col4', 'attr': ['underline']}, + 'environment': {'fg': 'col3', 'bg': 'col4', 'attrs': ['underline']}, }, }, 'themes/test/default': {