fidget.nvim icon indicating copy to clipboard operation
fidget.nvim copied to clipboard

Nvim-Tree when used like netrw results in a weird position

Open djmittens opened this issue 1 year ago • 3 comments

Im going to try my best to describe my issue. I browsed through issues and noticed there is nvim tree specific logic included in fidget.

I dont use nvim-tree like ohers do, i instead opt for the following shortcut to open it inside the current buffer:

      vim.keymap.set("n", "<leader>e",
        function() require("nvim-tree.api").tree.open({ current_window = true, find_file = true }) end, {})

So basically i split the buffer vertically then issue <leader>e to pop open the tree like i do with netrw, then i filter the files for the one i am looking for open, pop it open in the existing buffer with :

        on_attach = function(buffnr)
          local api = require("nvim-tree.api")
          api.config.mappings.default_on_attach(buffnr)
          vim.keymap.set("n", "<CR>", api.node.open.replace_tree_buffer,
            { buffer = buffnr, noremap = true, silent = true, nowait = true })
        end,

and now fidget is permanently in the middle of my whole screen, doesnt matter hat i do with splits or the tree from that point on. I switched from netrw to nvim-tree so that i get saner defaults for tree view and icons, but this bug is driving me crazy

image

djmittens avatar Jan 13 '25 20:01 djmittens

Thanks for filing this issue! Since you're basically using nvim-tree like a buffer already, have you tried turning off the nvim-tree integration? That should stop Fidget from scooting over the notifications window whenever nvim-tree is opened.

j-hui avatar Jan 13 '25 21:01 j-hui

can you help me to do this ? I am not familiar with the code base. Also perhaps ill try out a different plugin too : oil.nvim seems to be better for my use case since i have arrived at the same conclusion as this article http://vimcasts.org/blog/2013/01/oil-and-vinegar-split-windows-and-project-drawer/

file drawer style design is just not very useful for vim 😅

djmittens avatar Jan 13 '25 22:01 djmittens

can you help me to do this ? I am not familiar with the code base.

It depends on how you are calling fidget.setup(). For example:

require("fidget").setup({
  -- (other options)
  integration = {
    ["nvim-tree"] = {
      enable = false
    }
  }
})

That said, oil.nvim does seem to better suit your use case. It's what I use too.

j-hui avatar Jan 16 '25 15:01 j-hui