sotte / presenting.vim

A simple tool for presenting slides in vim based on text files.
MIT License
300 stars 50 forks source link

Custom statusline #13

Closed lzh9102 closed 8 years ago

lzh9102 commented 8 years ago

I added an option g:presenting_statusline to customize the statusline in the presentation buffer. With this option, the user can display useful information in the statusline like:

let g:presenting_statusline = '%l, %c'

To make the state of the presentation available to the statusline, I set the following variables in the buffer:

variable meaning
`b:presenting_page_current The current page index (starting from 1)
`b:presenting_page_total Total number of pages in the presentation

The user can then make the statusline display the format Page: <current>/<total> by:

let g:presenting_statusline = 'Page: %{b:presenting_page_current}/%{b:presenting_page_total}'
sotte commented 8 years ago

Very cool, thanks a lot!