diff options
| author | DefaultGen <gravel.justness270@slmail.me> | 2024-06-01 22:35:39 -0400 |
|---|---|---|
| committer | DefaultGen <gravel.justness270@slmail.me> | 2024-06-01 22:35:39 -0400 |
| commit | bde89bcfe9ceb6d312a02d3361fb817c304544f6 (patch) | |
| tree | 104d9e2b83130001e373206ba9378bf07a0c0b13 /lua/denote/cmd.lua | |
| parent | 22818fd95f438f83d32f6e1d482c6c2ef58772a0 (diff) | |
| download | simple-denote.nvim-bde89bcfe9ceb6d312a02d3361fb817c304544f6.tar.gz | |
Initial commit
Diffstat (limited to 'lua/denote/cmd.lua')
| -rw-r--r-- | lua/denote/cmd.lua | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/lua/denote/cmd.lua b/lua/denote/cmd.lua index 6489f0c..91ca96e 100644 --- a/lua/denote/cmd.lua +++ b/lua/denote/cmd.lua @@ -1,23 +1,26 @@ local M = { - commands = { "note", "search" }, + commands = { "note", "retitle", "retag" }, } + local api = require("denote.api") -function M.load_cmd() - vim.api.nvim_create_user_command("Denote", function(opts) - if opts.fargs[1] == "note" then - api.note() - elseif opts.fargs[1] == "search" then - api.search() - else - error("Unsupported operation " .. opts.fargs[1]) - end - end, { - nargs = 1, - complete = function() - return { "note", "search" } - end, - }) +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 |
