Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom status variables not working when status bar generated by running vim #98

Open
dvdmuckle opened this issue Feb 15, 2019 · 2 comments

Comments

@dvdmuckle
Copy link

I have a plugin that adds the variable #{spotify_track} as well as other Spotify variables. My status line looks like:

let g:tmuxline_preset = {
      \'a'    : ['#S', '#I'],
      \'b'    : '#W',
      \'x'    : ['#(mpc current)', '#{spotify_artist} #{spotify_status} #{spotify_track}'],
      \'y'    : '%H:%M',
      \'z'    : '#H'}

If I use :TmuxlineSnapshot to save this to a file and source it from Tmux, the status bar looks fine.
image
However, if I load up Vim, the status bar is overwritten, and the variables seem to disappear.
image
Is there a way to either fix this behavior or keep Vim from recreating the status bar?

@alexzaizar09
Copy link

where did you write the presets, inside the vimrc?

@vegerot
Copy link
Contributor

vegerot commented Dec 21, 2019

As an MWE, I have

let g:tmuxline_preset = {
      \'z'    : '#{track}'}

in my vimrc, and am using the tmux-music plugin.

I think the bug here is that when tmuxline looks at tmuxline_preset, it only looks at the predefined values it knows of, and does not try to get other possible variables that could be exposed. That's why taking a Snapshot and putting in the tmux.conf is a workaround, since those variables will be exposed there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants