Skip to content

Gitsigns does not automatically attach #903

@fabivs

Description

@fabivs

Description

With Neo-tree and Gitsigns installed, when I open neovim with nvim ., when opening any buffer Gitsigns does not automatically attach and does not work until I run :Gitsigns attach manually.

Neovim version

v0.9.2

Operating system and version

Mac OS Ventura 13.5 (22G74)

Expected behavior

No response

Actual behavior

See description.

Minimal config

for name, url in pairs{
  gitsigns = 'https://github.com/lewis6991/gitsigns.nvim',
  plenary = 'https://github.com/nvim-lua/plenary.nvim',
  nui = 'https://github.com/MunifTanjim/nui.nvim',
  neotree = 'https://github.com/nvim-neo-tree/neo-tree.nvim'
} do
  local install_path = vim.fn.fnamemodify('gitsigns_issue/'..name, ':p')
  if vim.fn.isdirectory(install_path) == 0 then
    vim.fn.system { 'git', 'clone', '--depth=1', url, install_path }
  end
  vim.opt.runtimepath:append(install_path)
end

require('gitsigns').setup{
  debug_mode = true, -- You must add this to enable debug messages
}

require('neo-tree').setup({
  source_selector = {
    winbar = true
  },
  filesystem = {
    filtered_items = {
      hide_dotfiles = false,
      hide_gitignored = false
    },
    follow_current_file = {
      enabled = true,
      leave_dirs_open = true
    }
  }
})

Steps to reproduce

  1. nvim --clean -u minimal.lua
  2. nvim . # inside a .git folder
  3. open a buffer for any version controlled file

Gitsigns debug messages

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingunable to reproduceUnable to reproduce problem

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions