tpope / vim-obsession

obsession.vim: continuously updated session files
http://www.vim.org/scripts/script.php?script_id=4472
1.76k stars 70 forks source link

How about just one working example of new statusline or titlestring? #21

Closed RichardDooling closed 9 years ago

RichardDooling commented 9 years ago

I like the idea, but don't see how it works.

Let's say I wanted to use an asterisk as my indicator? And add it to the titlestring.

What would I add to .vimrc?

:set titlestring=%t%(\ %M%)%(\ (%F)%)%a\ -\ VIM

And how to add the obsession indicator?

%{ObsessionIndicator('[%s]')}

tpope commented 9 years ago

Not sure I understand your confusion; literally all you have to do is add that %{...} expression to 'titlestring'.

Custom indicators aren't officially supported but I just now pushed a commit that makes it possible to do something like

set titlestring=...%{['','-','*'][ObsessionStatus()]}...