aboutsummaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorHumanEntity <human_entity@icloud.com>2023-12-25 12:21:59 +0100
committerHumanEntity <human_entity@icloud.com>2023-12-25 12:21:59 +0100
commit0eda0af22f91adfa781a3a08c1b46064a7f060dc (patch)
treee5a623f3f378c59dea9d677dbdadd1a7e97b3c97 /lua
parentebca541f572cafb01a2f6daf8237492791f33891 (diff)
downloadsimple-denote.nvim-0eda0af22f91adfa781a3a08c1b46064a7f060dc.tar.gz
Added user command
Diffstat (limited to 'lua')
-rw-r--r--lua/denote/cmd.lua16
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,
+})