aboutsummaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
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,
+})