From adf9812f614cb4fcfa9cc7418cac3d13a7c34967 Mon Sep 17 00:00:00 2001 From: CronyAkatsuki Date: Thu, 28 Dec 2023 14:22:10 +0100 Subject: [PATCH] Add TodoToggle command and format code. --- plugin/init.lua | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/plugin/init.lua b/plugin/init.lua index 7993bb9..1675ccc 100644 --- a/plugin/init.lua +++ b/plugin/init.lua @@ -1,13 +1,17 @@ if vim.fn.exists("g:loaded_md-tools") == 0 then - local user_cmd = vim.api.nvim_create_user_command + local user_cmd = vim.api.nvim_create_user_command - user_cmd("HeaderPromote", function (opts) - require("md-tools").headerControl('promote') - end, {}) + user_cmd("HeaderPromote", function(opts) + require("md-tools").headerControl("promote") + end, {}) - user_cmd("HeaderDemote", function (opts) - require("md-tools").headerControl('demote') - end, {}) + user_cmd("HeaderDemote", function(opts) + require("md-tools").headerControl("demote") + end, {}) - vim.api.nvim_set_var("loaded_md-tools", true) + user_cmd("ToDoToggle", function(opts) + require("md-tools").toggleTodo() + end, {}) + + vim.api.nvim_set_var("loaded_md-tools", true) end