diff --git a/docs/source/configuration.rst b/docs/source/configuration.rst index 9517d7a7..d4f47551 100644 --- a/docs/source/configuration.rst +++ b/docs/source/configuration.rst @@ -16,7 +16,9 @@ Powerline provides default configurations in the following locations: `Main configuration`_ :file:`powerline/config.json` `Colorschemes`_ - :file:`powerline/colorschemes/{extension}/default.json` + :file:`powerline/colorschemes/{name}.json`, + :file:`powerline/colorscheme/__main__.json`, + :file:`powerline/colorschemes/{extension}/{name}.json` `Themes`_ :file:`powerline/themes/{extension}/default.json` @@ -248,7 +250,14 @@ Color definitions Colorschemes ============ -:Location: :file:`powerline/colorschemes/{extension}/{name}.json` +:Location: :file:`powerline/colorschemes/{name}.json`, + :file:`powerline/colorscheme/__main__.json`, + :file:`powerline/colorschemes/{extension}/{name}.json` + +Colorscheme files are processed in order given: definitions from each next file +override those from each previous file. It is required that either +:file:`powerline/colorschemes/{name}.json`, or +:file:`powerline/colorschemes/{extension}/{name}.json` exists. ``name`` Name of the colorscheme. @@ -258,21 +267,26 @@ Colorschemes ``groups`` Segment highlighting groups, consisting of a dict where the key is the name of the highlighting group (usually the function name for function - segments), and the value is a dict that defines the foreground color, - background color and optional attributes: + segments), and the value is either - ``fg`` - Foreground color. Must be defined in :ref:`colors - `. + #) a dict that defines the foreground color, background color and optional + attributes: - ``bg`` - Background color. Must be defined in :ref:`colors - `. + ``fg`` + Foreground color. Must be defined in :ref:`colors + `. - ``attr`` - Optional 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. + ``bg`` + Background color. Must be defined in :ref:`colors + `. + + ``attr`` + 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. + + #) a string (an alias): a name of existing group. This group’s definition + will be used when this color is requested. ``mode_translations`` Mode-specific highlighting for extensions that support it (e.g. the vim diff --git a/powerline/__init__.py b/powerline/__init__.py index e982375d..bf3e1212 100644 --- a/powerline/__init__.py +++ b/powerline/__init__.py @@ -494,6 +494,8 @@ class Powerline(object): else: if not cfg_path.endswith('__'): loaded += 1 + # TODO Either make sure `attr` list is always present or make + # mergedicts not merge group definitions. mergedicts(config, lvl_config) if not loaded: for exception in exceptions: