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

buffer-local settings #568

Closed
goerz opened this issue Jan 7, 2019 · 4 comments
Closed

buffer-local settings #568

goerz opened this issue Jan 7, 2019 · 4 comments

Comments

@goerz
Copy link

goerz commented Jan 7, 2019

Is there a way to disable gitgutter for a particular buffer? It appears that all the options (e.g. :gitgutter_enabled, which is set by GitGutterDisable) are global.

My problem is that gitgutter produces nonsense signs when the text in the buffer doesn't actually reflect the content of the file on disk, such as in the jupytext.vim plugin of which I'm the author. Thus, I'd like to turn off gitgutter for *.ipynb files only, respectively in jupytext.vim for the "current buffer".

Alternatively, if there was some way to communicate to gitgutter how to get the correct diff (compare against the baseline filtered through jupytext), that would be even better. But that would also be a buffer-local setting.

Version info:

  • What is the latest commit SHA in your installed vim-gitgutter?

    1d422b9

  • What vim/nvim version are you on?

    NVIM v0.3.2-dev

@goerz
Copy link
Author

goerz commented Jan 7, 2019

I realized that for the particular use case of disabling nonsensical signs, set signcolumn=no is probably a good workaround. But still, it seems like maybe it would be possible to get the correct diff by setting buffer-local versions of g:gitgutter_git_executable, g:gitgutter_git_args, etc.

@airblade
Copy link
Owner

airblade commented Jan 8, 2019

I've just added GitGutterBufferDisable, GitGutterBufferEnable, and GitGutterBufferToggle in 2dce8e0.

I don't think there's a nice way to get the correct diff with your plugin. You'd have to pipe one side of the diff only (the file from the index) through your conversion command, which would complicate the code generally for this special case.

@airblade airblade closed this as completed Jan 8, 2019
@lukelbd
Copy link
Contributor

lukelbd commented Feb 22, 2022

Thanks for the buffer-local commands! Just wanted to point out they are not currently mentioned in the documentation.

@airblade
Copy link
Owner

@lukelbd Oops, thanks for letting me know :) 18d1298

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