Add vim statusline example

This is currently rendered with the terminal renderer, and is just
a simple proof-of-concept of how vim statuslines can be defined with the
Python API.
This commit is contained in:
Kim Silkebækken 2012-11-08 12:44:46 +01:00
parent cf88b086c0
commit 99ded1d0c6
1 changed files with 29 additions and 0 deletions

29
powerline-vim-example.py Executable file
View File

@ -0,0 +1,29 @@
#!/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))