mirror of
https://github.com/powerline/powerline.git
synced 2025-04-08 19:25:04 +02:00
This example only does a single type of highlighting (normal mode) but demonstrates nicely how rendering a statusline with Python could work. This also utilizes the new width functionality to crop away less important segment if the window is too small, and do the padding with Python instead of using vim's split segment. Some optimization will probably be necessary, as calling Python for each statusline redraw is quite expensive. A solution could be evaluating the segments in Python once and then calculating the width and crop away/pad the segments, and then sending the statusline with unevaluated segments to vim for rendering without calling Python. Only some events (like CursorHold, InsertEnter/InsertLeave, etc.) would trigger a re-render with Python, a recalculation of the width and cropping/padding.
The file is empty.
Languages
Python
90.7%
Shell
7.1%
Vim Script
1.8%
C
0.4%