# Local themes

From the user point of view local themes are the regular themes with a specific scope where they are applied (i.e. specific vim window or specific kind of prompt). Used themes are defined in local_themes key.

## Vim local themes

Vim is the only available extension that has a wide variaty of options for local themes. It is the only extension where local theme key refers to a function as described in local_themes value documentation.

This function always takes a single value named `matcher_info` which is the same dictionary as segment_info dictionary. Unlike segments it takes this single argument as a positional argument, not as a keyword one.

Matcher function should return a boolean value: `True` if theme applies for the given `matcher_info` dictionary or `False` if it is not. When one of the matcher functions returns `True` powerline takes the corresponding theme at uses it for the given window. Matchers are not tested in any particular order.

In addition to local_themes configuration key developer of some plugin which wishes to support powerline without including his code in powerline tree may use `powerline.vim.VimPowerline.add_local_theme()` method. It accepts two arguments: matcher name (same as in local_themes) and dictionary with theme. This dictionary is merged with top theme and `powerline/themes/vim/__main__.json`. Note that if user already specified the matcher in his configuration file `KeyError` is raised.

## Other local themes

Except for Vim only IPython and shells have local themes. Unlike Vim these themes are names with no special meaning (they do not refer to or cause loading of any Python functions):

Extension | Theme name | Description
Shell | continuation | Shown for unfinished command (unclosed quote, unfinished cycle).
select | Shown for `select` command available in some shells.
IPython | in2 | Continuation prompt: shown for unfinished (multiline) expression, unfinished class or function definition.
out | Displayed before the result.
rewrite | Displayed before the actually executed code when `autorewrite` IPython feature is enabled.