I was wondering where I should locate I very small set of functions I ended up writing (resembling to a plugin hence, but not installed via any of the available plugin managers), but that I want to load using require("plugin-name") in an autocommand when something specific fires.
I tried the built-in Vim directory as in the title, but didn’t work.
Create a directory called lua in the plugins directory, then put the code into a file named plugin_name.lua. In the lua return your functions in an object.
Alternatively instead of one file, you can create directory which name should be plugin_name and add an init.lua function to it.
Then you can call require('plugin_name').function_name()
For example pack/plugins/opt/asdf/lua/asdf.lua or pack/plugins/opt/asdf/lua/asfd/init.lua
It might be an issues that it’s in opt folder, so it won’t load automatically. You might want to call :packadd asdf first or put into the start folder instead