diff options
| author | HumanEntity <human_entity@icloud.com> | 2023-12-25 12:21:59 +0100 |
|---|---|---|
| committer | HumanEntity <human_entity@icloud.com> | 2023-12-25 12:21:59 +0100 |
| commit | 0eda0af22f91adfa781a3a08c1b46064a7f060dc (patch) | |
| tree | e5a623f3f378c59dea9d677dbdadd1a7e97b3c97 | |
| parent | ebca541f572cafb01a2f6daf8237492791f33891 (diff) | |
| download | simple-denote.nvim-0eda0af22f91adfa781a3a08c1b46064a7f060dc.tar.gz | |
Added user command
| -rw-r--r-- | lua/denote/cmd.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lua/denote/cmd.lua b/lua/denote/cmd.lua new file mode 100644 index 0000000..9359a2f --- /dev/null +++ b/lua/denote/cmd.lua @@ -0,0 +1,16 @@ +local api = require("denote.api") + +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, +}) |
