SuperBo / fugit2.nvim

Neovim git GUI powered by libgit2
MIT License
352 stars 7 forks source link

add diffview.nvim as an explicit dependency in lazy.nvim config example #22

Closed ceuk closed 4 months ago

ceuk commented 4 months ago

Trying to invoke diffview (dd) before diffview has been used will fail silently unless diffview is explicitly included in the deps for this plugin

SuperBo commented 4 months ago

Hi @ceuk, If you check latest README, diffview.nvim is already added to install instruction.

Thank you. Don't you mind if I close this?

ceuk commented 4 months ago

I already had diffview.nvim installed, but because it's lazy loaded dd didn't do anything unless I had already run something like :DiffviewOpen before-hand. Adding it as a dependency in the lazy config ensures diffview.nvim is loaded when Fugit2 is activated

SuperBo commented 4 months ago

@ceuk, if you have diffview installed before hand you can config it separately as following:

{
  'sindrets/diffview.nvim',
   dependencies = { 'nvim-tree/nvim-web-devicons' },
   cmd = {
      'DiffviewFileHistory', 'DiffviewOpen', 'DiffviewToggleFiles', 'DiffviewFocusFiles', 'DiffviewRefresh'
   }
}

The key config here is cmd. I used these cmds to trigger Diffview panel. With this kind of setup, you can achieve maximum lazy, diffview will not be loaded until the time you press "dd".

SuperBo commented 4 months ago

Hi @ceuk , please check latest installation guide, I updated diffview.nvim setup to acquire true laziness.

https://github.com/SuperBo/fugit2.nvim#lazy

ceuk commented 4 months ago

Even better approach, thanks!