feat(neovim): Markdown-oxide configured

- Makes the Obsidian-like markdown work in Neovim
This commit is contained in:
Pratik Tripathy
2025-09-01 11:57:05 +05:30
parent 3be53f130a
commit 0373234cc9
2 changed files with 35 additions and 0 deletions

View File

@@ -1 +1,22 @@
require("shared.text_settings").setup()
local function check_codelens_support()
local clients = vim.lsp.get_active_clients({ bufnr = 0 })
for _, c in ipairs(clients) do
if c.server_capabilities.codeLensProvider then
return true
end
end
return false
end
vim.api.nvim_create_autocmd({ "TextChanged", "InsertLeave", "CursorHold", "LspAttach", "BufEnter" }, {
buffer = bufnr,
callback = function()
if check_codelens_support() then
vim.lsp.codelens.refresh({ bufnr = 0 })
end
end,
})
-- trigger codelens refresh
vim.api.nvim_exec_autocmds("User", { pattern = "LspAttached" })

View File

@@ -0,0 +1,14 @@
return {
cmd = { "markdown-oxide" },
filetypes = { "markdown" },
root_dir = function()
return vim.fn.getcwd()
end,
settings = {
workspace = {
didChangeWatchedFiles = {
dynamicRegistration = true,
},
},
},
}