From 3c7f0e66db4e25afaa145c6c6026928814190f1f Mon Sep 17 00:00:00 2001 From: CronyAkatsuki Date: Wed, 27 Dec 2023 22:16:07 +0100 Subject: [PATCH] Create user command on plugin load. --- plugin/init.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 plugin/init.lua diff --git a/plugin/init.lua b/plugin/init.lua new file mode 100644 index 0000000..3aa11d5 --- /dev/null +++ b/plugin/init.lua @@ -0,0 +1,13 @@ +if vim.fn.exists("g:loaded_md-tools") == 0 then + local user_cmd = vim.api.nvim_create_user_command + + user_cmd("HeaderPromote", function (opts) + require("md-tools").promote() + end, {}) + + user_cmd("HeaderDemote", function (opts) + require("md-tools").demote() + end, {}) + + vim.api.nvim_set_var("loaded_md-tools", true) +end