powerline/powerline-vim-example.py
Kim Silkebækken 59a760c3c6 Join the fg/bg/attr methods of the renderers
This change joins the fg/bg/attr methods into a single hl method in the
renderers. This provides the same functionality, and it simplifies the
terminal rendering by being able to join all the attributes into one
escape sequence.

It's also a necessary change for the vim renderer, as this renderer
needs to log all the highlighting and create separate highlighting
classes for every single color and attribute combination. The only way
to do this is to have a single highlighting method.
2012-11-08 13:16:22 +01:00

30 lines
744 B
Python
Executable File

#!/usr/bin/env python
'''Powerline vim statusline example.
'''
from lib.core import Segment
from lib.renderers import TerminalSegmentRenderer
powerline = Segment([
Segment('NORMAL', 22, 148, attr=Segment.ATTR_BOLD),
Segment('⭠ develop', 247, 240),
Segment([
Segment(' ~/projects/powerline/lib/'),
Segment('core.py ', 231, attr=Segment.ATTR_BOLD),
], 250, 240, separate=False, padding=''),
Segment(),
Segment([
Segment('unix'),
Segment('utf-8'),
Segment('python'),
Segment(' 83%', 247, 240),
Segment([
Segment('', 239),
Segment('23', attr=Segment.ATTR_BOLD),
Segment(':1 ', 244),
], 235, 252, separate=False, padding=''),
], 245, side='r'),
], bg=236)
print(powerline.render(TerminalSegmentRenderer()))