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

FR: Sidebar shown on the right of the current pane, when vim is split vertically #806

Open
fvisin opened this issue Jan 20, 2022 · 2 comments
Labels

Comments

@fvisin
Copy link

fvisin commented Jan 20, 2022

When vim is split vertically (multiple panes), the sidebar always shows in the rightmost part of the window. It would be useful to have an option to show the sidebar on the right of the pane it was opened in.

Example: with two panes, and tagbar opened in the first pane:

Current behavior:

|        |        |         |
| pane 1 | pane 2 | sidebar |    
|        |        |         |    

Desired behavior:

|        |         |        |
| pane 1 | sidebar | pane 2 |    
|        |         |        |    

Additionally, it would be very helpful to have a way to make the pane the tagbar relates to fixed (currently tagbar shows the tags of the pane with the active focus. I would rather have the tagbar stay keep its focus and potentially open a second one in the second pane if I need it)

@raven42
Copy link
Collaborator

raven42 commented Jan 20, 2022

The window position can be controlled via the g:tagbar_position configuration. You can look at the help for :help split for more info about the possible values for the window position, but based on the example you provided, I believe this is the setting you would be looking for:

let g:tagbar_position = 'rightbelow vertical'

Regarding the active focus, there is no option currently that disables only the s:AutoUpdate() call, but if you set the g:tagbar_no_autocmds option, then that will disable the autoupdate as well as some other commands related to cursor movement and such. That might get the behavior you want. Currently tagbar is setup to only operate on the active file being operated on. So when you change to a different window with a different file, the active file in vim also changes. We might be able to do something to change this, but it would require a little bit of a rework.

@fvisin
Copy link
Author

fvisin commented Jan 21, 2022

Thank you for the immediate reply!!
I confirm that the g:tagbar_position setting does exactly what I wanted, thank you!
I am not sure what keyword I used to search the docs, but somehow I missed that.

For what concerns preventing updates when the focus changes, I want to keep autoupdate so setting g:tagbar_no_autocmds won't work for me.

If you find the time to work on this feature, it would be great if opening tagbar from pane 1 and then again from pane 2 led to this:

|        |           |        |           |    
| pane 1 | sidebar 1 | pane 2 | sidebar 2 | 
|        |           |        |           |    

i.e., each pane is considered independently, and the sidebar associated to the pane currently in focus can be opened or closed with :TagbarToggle.

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

No branches or pull requests

3 participants