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

gitblame_enabled=0 not working in lunar vim #65

Closed
yannk opened this issue Nov 9, 2022 · 6 comments
Closed

gitblame_enabled=0 not working in lunar vim #65

yannk opened this issue Nov 9, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@yannk
Copy link

yannk commented Nov 9, 2022

Similar to #55 I see the configuration in lunar vimdocs not working

https://www.lunarvim.org/docs/plugins/extra-plugins#git-blame

lvim.plugins = {
    {
        "f-person/git-blame.nvim",
        event = "BufRead",
        config = function()
            vim.cmd "highlight default link gitblame SpecialComment"
            vim.g.gitblame_enabled = 0
        end,
    },

versions:

NVIM v0.8.0
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by brew@HMBRW-A-001-M1-002.local
@f-person
Copy link
Owner

Hi! Thanks for your report! My guess is once the config() function is called, the plugin is already initialized which causes the problem. A hack, for now, would be calling require('gitblame').disable() in the lunar config. I'll check how I can solve this though

@f-person f-person added the bug Something isn't working label Jan 10, 2023
@f-person
Copy link
Owner

Hey! Would implementing #69 be good enough for this use case? I want to switch to a setup function style without breaking the current configurations, so I'm thinking about implementing setup that will configure everything required but setting vim.g.gitblame_enabled to 0 still won't work. When a setup function is implemented, I'll make a PR to lunarvim to update their docs to use setup.

@innateessence
Copy link

@f-person I think implementing a setup function would be sufficient

@ghost
Copy link

ghost commented Mar 18, 2023

For me calling require('gitblame').disable() does not work either.

Instead running vim.cmd("GitBlameDisable") works and disables git blame on startup.

Note: I am using regular NeoVim and not LunarVim.

@scott-b-gilbert
Copy link

scott-b-gilbert commented Apr 13, 2023

I was having the same issue on neovim 0.9. Running the cmd as @moizalicious indicated somewhat worked. I was still getting one git blame on the first line of the first file that I opened. 🤷‍♂️

I fixed it with init'ing with lazy.nvim when loading the function. Hopefully this will help @yannk and others.

 {
   "f-person/git-blame.nvim",
    init = function()
      vim.g.gitblame_message_template = ' <author> - <date> - <summary> - <sha>'
      vim.g.gitblame_enabled = 0
    end,
}

f-person added a commit to f-person/lunarvim.org that referenced this issue Aug 19, 2023
There was an [issue](f-person/git-blame.nvim#65)
on git-blame.nvim about `vim.g.gitblame_disable = 0` not working with
Lunar.

I recently implemented a setup function which solves this issue.
This commit uses `setup`, instead of legacy vim.g in order to avoid any
confusions for users who wanna use git-blame :).
@f-person
Copy link
Owner

This is fixed now! You should switch to setup:

require("gitblame").setup { enabled = false }

Also opened a PR for LunarVim docs: LunarVim/lunarvim.org#421

LostNeophyte pushed a commit to LunarVim/lunarvim.org that referenced this issue Aug 26, 2023
There was an [issue](f-person/git-blame.nvim#65)
on git-blame.nvim about `vim.g.gitblame_disable = 0` not working with
Lunar.

I recently implemented a setup function which solves this issue.
This commit uses `setup`, instead of legacy vim.g in order to avoid any
confusions for users who wanna use git-blame :).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants