packer.nvim
packer.nvim copied to clipboard
I can't use packer without sourcing the file
Everytime I need to user packer or any of its commands I need to source the file, then use the command.
Can you clarify on what you mean by source
the file. What file? How have you installed packer? Is it needing to packadd packer?
I have a similar issue. I need to go to my packer.lua
file and run :so
to get the :Packer
commands to appear. It also does not appear when I run :checkhealth
but I am not sure if its supposed to.
Where is your plugin.lua file? If it is under your lua folder is it being required correctly? When adding a print statement in that file does it appear when you startup?
I have a packer.lua
which is where I initialize packer. I don't have a plugin.lua
file. The packer.lua
is .config/nvim/lua/fed/packer.lua
. When I added the print, it didn't appear on startup. When I required the packer.lua
in my init.lua
file it appeared, which also resolves the problem. Should I rename the packer.lua
file to plugin.lua
I would recommend reading :h runtimepath
for details on how vim loads files on startup.
Because your lua file is under the lua
folder and not the plugin
folder it will not be auto sourced on startup. You have to use lua to require that file. In your init.lua
(or any other file that has been already required) you need to have require("fed.packer")
. This will require that file and load its contents.