Closed Kxnr closed 1 month ago
Thank you!
this is developing nicely!
running lua vim.lsp.buf.execute_command({command="jump", arguments={"today"}})
will make it work;
there is also
lua vim.lsp.buf.execute_command({command="jump", arguments={"yesterday"}})
lua vim.lsp.buf.execute_command({command="jump", arguments={"3 days ago"}})
that fuzzydate lib is really special
Right now we can do
require("lspconfig").markdown_oxide.setup({
-- ...
capabilities = capabilities,
on_attach = on_attach,
commands = {
Today = {
function()
vim.lsp.buf.execute_command({command="jump", arguments={"today"}})
end,
description = "Open today's daily note"
},
Tomorrow = {
function()
vim.lsp.buf.execute_command({command="jump", arguments={"tomorrow"}})
end,
description = "Open tomorrow's daily note"
},
Yesterday = {
function()
vim.lsp.buf.execute_command({command="jump", arguments={"yesterday"}})
end,
description = "Open yesterday's daily note"
},
}
})
but cannot provide a default command for entering the jump arguments.
A dedicated plugin would be so helpful for this; right now, the user will have to modify their on_attach to enable this (which we can provide snippets for). Either we make our own, or continue the developments in #65 (or both?). This would be helpful for the other non-ideal nvim-cmp and capabilities configuration.
I think "both" is the way to go: #95
With this snippet, users can open daily notes with natural language Daily two days ago
if client.name == "markdown_oxide" then
vim.api.nvim_create_user_command(
"Daily",
function(args)
local input = args.args
vim.lsp.buf.execute_command({command="jump", arguments={input}})
end,
{desc = 'Open daily note', nargs = "*"}
)
end
Let me know what you think and we'll merge right in
I wanted to get it closed :smile:
We can talk more on the main issue
close #99