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

[Request] Integration with vim-airline #64

Closed
jamespharvey20 opened this issue Jun 9, 2019 · 9 comments
Closed

[Request] Integration with vim-airline #64

jamespharvey20 opened this issue Jun 9, 2019 · 9 comments

Comments

@jamespharvey20
Copy link
Contributor

jamespharvey20 commented Jun 9, 2019

Your wiki shows how to integrate with lightline.

I'd love to see this integrated with vim-airline, to support showing both cursor and extended mode. I see g:Vm.is_active can be used to show in lightline that the plugin is active. How would one differentiate further, to tell between cursor and extended modes?

Integration would probably require changes in vim-airline code. Once I know how to differentiate between cursor and extended modes, I can open an issue with vim-airline and see if they'll add support for it.

EDIT: Ahh, I see. g:Vm.is_active then use g:Vm.extend_mode to differentiate. Opened an issue with vim-airline asking for support.

Up to you if you want to close this, help contribute to vim-airline, or leave this open for a while to see what they do.

@mg979
Copy link
Owner

mg979 commented Jun 9, 2019

Rather than checking g:Vm.is_active I'd use

" check if VM is active
return exists('b:VM_Selection') && !empty('b:VM_Selection')

I'm sure it's possible to achieve airline integration, but I don't know how since I don't use it. I'll add a function that returns some infos that can be useful for statusline integration.

mg979 added a commit that referenced this issue Jun 9, 2019
@mg979
Copy link
Owner

mg979 commented Jun 9, 2019

You can call a new function now, it returns a dictionary with useful infos for a statusline. You should be able to build a statusline section with those. If you have more questions you can reopen this.

@mg979 mg979 closed this as completed Jun 9, 2019
@Shatur
Copy link

Shatur commented Jun 25, 2020

@mg979, What does the status key in the VMInfos() function correspond to? It usually returns 'Hsv'.

@mg979
Copy link
Owner

mg979 commented Jun 25, 2020

:h vm-infoline

It's a bit outdated, it's m for mappings, s for single region mode, v for multiline mode, uppercase when the option is active.

@Shatur
Copy link

Shatur commented Jun 25, 2020

Yes, I saw this, but was not sure because of the H in Hsv. H stands for "mapping enabled", right?

@mg979
Copy link
Owner

mg979 commented Jun 25, 2020

It's M not H

@Shatur
Copy link

Shatur commented Jun 25, 2020

Oh, sorry, for unknown reason I thought it was H. Yes, it's M. Thank you for the explanations.

@mohityadav7
Copy link

You can call a new function now, it returns a dictionary with useful infos for a statusline. You should be able to build a statusline section with those. If you have more questions you can reopen this.

Hi, It seems like the wiki is missing for statusline integration. I want to integrate with lualine. Could you please help with that?

@mg979
Copy link
Owner

mg979 commented Jan 26, 2022

:help g:VM_set_statusline

You can use built-in statusline, change this value to 3 if it gets overwritten. Or you can use the aforementioned function inside lualine, but I can't help you with that.

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

4 participants