Closed hiddenruins closed 3 years ago
Hey @hiddenruins! Unfortunately, I don't know too much about opt
packages. Is it correct that the only difference is that you need to packadd mypackage
for it to be registered/started?
Would it make sense to make nvim-ts-context-commenstring
a dependency of nvim-treesitter
?
use {
'nvim-treesitter/nvim-treesitter',
opt = true,
run = ':TSUpdate',
requires = {'JoosepAlviste/nvim-ts-context-commentstring'},
}
Then, Packer should make this plugin opt
as well if I understand correctly (transitive_opt = true, -- Make dependencies of opt plugins also opt by default
in Packer default conf) and load it when nvim-treesitter
is loaded. Does that work for you?
I'm not sure what could be done in this plugin. Do you have any ideas?
I think what you want is wants
to make sure nvim-treesitter
is loaded before ntcc
(your plugin's name is too long :P):
use {
'JoosepAlviste/nvim-ts-context-commentstring', cmd = '...',
wants = 'nvim-treesitter'
}
This is assuming you have nvim-treesitter
already set up separately.
(Presumably you want to lazy-load this plugin (which implies opt
, so no need to specify it), otherwise there is no point in putting this -- and nvim-treesitter
, which is a hard requirement -- in opt
instead of start.)
Thank you @clason @JoosepAlviste . Adding after="nvim-treesitter"
in use
seemed to do the trick.
Hi, thanks for the awesome plugin. Neovim shows an error when
nvim-treesitter
is made an optional package in packer.nvim.Here's the error message
Relevant Packer config
Treesitter config