From 66e09991470e1b4eb35244a7bf73dcca04bfd202 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 13 Jul 2014 23:27:44 +0400 Subject: [PATCH] Document configuration merging --- docs/source/configuration.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/source/configuration.rst b/docs/source/configuration.rst index 50b39e54..8d21db77 100644 --- a/docs/source/configuration.rst +++ b/docs/source/configuration.rst @@ -30,6 +30,24 @@ corresponds to :file:`~/.config/powerline` on both platforms. If you need per-instance configuration please refer to :ref:`Local configuration overrides `. +.. note:: If you have multiple configuration files with the same name in + different directories then these files will be merged. Merging happens in + the following order: + + * :file:`{powerline_root}/powerline/config_files` is checked for + configuration first. Configuration from this source has least priority. + * :file:`$XDG_CONFIG_DIRS/powerline` directories are the next ones to check. + Checking happens in the reversed order: directories mentioned last are + checked before directories mentioned first. Each new found file is merged + with the result of previous merge. + * :file:`$XDG_CONFIG_HOME/powerline` directory is the last to check. + Configuration from there has top priority. + + When merging configuration only dictionaries are merged and they are merged + recursively: keys from next file overrule those from the previous unless + corresponding values are both dictionaries in which case these dictionaries + are merged and key is assigned the result of the merge. + .. _quick-guide: Quick setup guide