diff options
| author | workhorse <gravel.justness270@slmail.me> | 2024-06-03 16:48:36 -0400 |
|---|---|---|
| committer | workhorse <gravel.justness270@slmail.me> | 2024-06-03 16:48:36 -0400 |
| commit | 516bc5e46c8e8a4f63df0a21bf7efbe835bdec2a (patch) | |
| tree | bca5f5d8c72b25a0db65d28f42cd3eb7bd8ef6ae /lua/simple-denote/cmd.lua | |
| parent | 1bf7bc5b79636814db73a9148998c72fbe554d58 (diff) | |
| download | simple-denote.nvim-516bc5e46c8e8a4f63df0a21bf7efbe835bdec2a.tar.gz | |
Fixed heading config
Diffstat (limited to 'lua/simple-denote/cmd.lua')
| -rw-r--r-- | lua/simple-denote/cmd.lua | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lua/simple-denote/cmd.lua b/lua/simple-denote/cmd.lua new file mode 100644 index 0000000..177db88 --- /dev/null +++ b/lua/simple-denote/cmd.lua @@ -0,0 +1,26 @@ +local M = { + commands = { "note", "retitle", "retag" }, +} + +local api = require("simple-denote.api") + +function M.load_cmd(options) + vim.api.nvim_create_user_command("Denote", function(opts) + if opts.fargs[1] == "note" then + api.note(options) + elseif opts.fargs[1] == "retitle" then + api.retitle(options) + elseif opts.fargs[1] == "retag" then + api.retag(options) + else + error("Unsupported operation " .. opts.fargs[1]) + end + end, { + nargs = 1, + complete = function() + return M.commands + end, + }) +end + +return M |
