Powerline extension is a code that tells powerline how to highlight and display segments in some set of applications. Specifically this means
Creating a :py
powerline.Powerline
subclass that knows how to obtainlocal configuration overrides <local-configuration-overrides>
. It also knows how to load local themes, but not when to apply them.Instance of this class is the only instance that interacts directly with bindings code, so it has a proxy :py
This subclass must be placed directly inpowerline.Powerline.render
and :pypowerline.Powerline.shutdown
methods and other methods which may be useful for bindings.powerline
directory (e.g. inpowerline/vim.py
) and named likeVimPowerline
(version of the file name without directory and extension and first capital letterPowerline
). There is no technical reason for naming classes like this.
Creating a :py
powerline.renderer.Renderer
subclass that knows how to highlight a segment or reset highlighting to the default value (only makes sense in prompts). It is also responsible for selecting local themes and computing text width.This subclass must be placed directly in
powerline/renderers
directory (for powerline extensions developed for a set of applications usepowerline/renderers/{ext}/*.py
) and named likeExtRenderer
orAppPromptRenderer
. For technical reasons the class itself must be referenced inrenderer
module attribute thus allowing only one renderer per one module.- Creating an extension bindings. These are to be placed in
powerline/bindings/{ext}
and may contain virtually anything which may be required for powerline to work inside given applications, assuming it does not fit in other places.
powerline.Powerline
powerline.renderer.Renderer