diff options
| author | Giuseppe Gadola <67549788+giusgad@users.noreply.github.com> | 2023-01-28 14:34:42 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-28 14:34:42 +0100 |
| commit | 1c414d807e36af4520912c88f9b8ef93467dce38 (patch) | |
| tree | 22ab604e3824624018c43e28b57b7e8768b7d910 /lua | |
Initial commit
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/plugin_name.lua | 22 | ||||
| -rw-r--r-- | lua/plugin_name/module.lua | 8 |
2 files changed, 30 insertions, 0 deletions
diff --git a/lua/plugin_name.lua b/lua/plugin_name.lua new file mode 100644 index 0000000..5320823 --- /dev/null +++ b/lua/plugin_name.lua @@ -0,0 +1,22 @@ +-- main module file +local module = require("plugin_name.module") + +local M = {} +M.config = { + -- default config + opt = "Hello!", +} + +-- setup is the public method to setup your plugin +M.setup = function(args) + -- you can define your setup function here. Usually configurations can be merged, accepting outside params and + -- you can also put some validation here for those. + M.config = vim.tbl_deep_extend("force", M.config, args or {}) +end + +-- "hello" is a public method for the plugin +M.hello = function() + module.my_first_function() +end + +return M diff --git a/lua/plugin_name/module.lua b/lua/plugin_name/module.lua new file mode 100644 index 0000000..441e923 --- /dev/null +++ b/lua/plugin_name/module.lua @@ -0,0 +1,8 @@ +-- module represents a lua module for the plugin +local M = {} + +M.my_first_function = function() + return "hello world!" +end + +return M |