Open SephVelut opened 2 years ago
some plugins behave differently then others when they are designed without lazy loading in mind
generally some plugins will work out of the box while others might not
as for me if i use the ft option for lazy loading it works with all my packages
if you're sure that the ft lazyloading is not properly working in packer you might as well
set the package to opt = true
and add a ftplugin/lua.lua in which you add
vim.cmd("packadd catppuccin")
which lazyloads also on ft opening
This might be a general misconception held by me about opt/ft options, but I have a plugin (vim-solidity
in the below example) that has:
{
ft = 'solidity',
opt = true,
}
But when I check my startup logs I can see that this plugin is loaded at startup as well. I thought adding these two options would make this plugin only be loaded when I open a solidity file. Anyone able to clarify, or is this a bug?
EDIT: Also, if anyone has any suggestions to debugging why my startup is insanely slow any help would be greatly appreciated. As you can see my startup can be nearly unbearably slow.
@avegancafe vim-solidity
, in particular, does not need ft
lazyloading - it already uses ftplugin
, and packer
is loading parts of it because it provides ftdetect
scripts which are necessary to discover the solidity
filetype to begin with. For debugging your start time, I would suggest using a plugin like https://github.com/dstein64/vim-startuptime to identify the main culprits.
@SephVelut I'm not really able to reproduce this, using the config you pasted. Is this still a problem for you?
Also @avegancafe: note that ft
implies opt
, so you don't need to manually mark opt = true
.
@SephVelut Note that I'm testing with :lua require 'catppuccin'.setup()
, which correctly fails (with impatient.nvim
disabled, as that cache can interfere) for non-Lua files and correctly executes for Lua files in my experiments. I do not see catppuccin
in :scriptnames
, but I'm not sure if Lua scripts sourced via packadd
show there?
NVIM v0.8.0-dev I'm on packer.nvim commit 4dedd3b (5 weeks ago)
Given only this use call
I expect catppuccin to be loaded when lua files are opened. Currently,
:scriptnames
does not show catppuccin is loaded when a lua file is opened. Can be "fixed" by removingft = "lua"
reinstall recompile. Or simply manually moving catppuccin from/pack/packer/opt
to/pack/packer/start
.set filetype?
returnsfiletype=lua
just fine.