From b9efd12e47150e59197aa06183badb7d3b01d28a Mon Sep 17 00:00:00 2001 From: Pratik Tripathy Date: Sat, 22 Nov 2025 23:38:42 +0530 Subject: [PATCH] feat(nvim): Markdown handling improvements - marksman: Trimmed config file: removed comments, remove default settings - fix: ftplugin for codelens: provide current buffer - new: Add obsidian.nvim plugin to replace markdown-oxide lsp --- common/.config/marksman/config.toml | 31 +++---------------- .../.config/nvim/after/ftplugin/markdown.lua | 2 +- common/.config/nvim/lsp/markdown_oxide.lua | 14 --------- .../nvim/lua/plugins/lang-markdown.lua | 24 ++++++++++++++ 4 files changed, 30 insertions(+), 41 deletions(-) delete mode 100644 common/.config/nvim/lsp/markdown_oxide.lua diff --git a/common/.config/marksman/config.toml b/common/.config/marksman/config.toml index ab8188d..939e57a 100644 --- a/common/.config/marksman/config.toml +++ b/common/.config/marksman/config.toml @@ -1,36 +1,15 @@ [core] markdown.file_extensions = ["md", "markdown"] -# Configures text sync protocol between the editor (LSP client) -# and Marksman (LSP server). -# Can be either 'full' or `incremental`: -# * full: the whole copy of a document is sent by the editor -# on every update, -# * incremental: only the changed parts are sent by -# the editor. This will result in less trafic between -# the editor and Marksman, but the overall performance -# impact is marginal. -# Defaults to `full` because the editors have bugs in incremental -# sync which result in slightly correpted state and are really hard -# to diagnose. -text_sync = "incremental" -# Use incremental resolution of project-wide references. -# This is much more efficient but is currently experimental -incremental_references = true -# For debugging only! Enables extra validation checks around -# incremental state updates. SIGNIFICANTLY IMPACTS PERFORMANCE +text_sync = "full" +title_from_heading = true +incremental_references = false paranoid = false [code_action] -# Enable/disable "Table of Contents" code action toc.enable = true - -# Enable/disable "Create missing linked file" code action create_missing_file.enable = false [completion] -# The style of wiki links completion. -# Other values include: -# * "file-stem" to complete using file name without an extension, -# * "file-path-stem" same as above but using file path. -wiki.style = "title-slug" +candidates = 50 +wiki.style = "file-path-stem" diff --git a/common/.config/nvim/after/ftplugin/markdown.lua b/common/.config/nvim/after/ftplugin/markdown.lua index cff6732..48d6b02 100644 --- a/common/.config/nvim/after/ftplugin/markdown.lua +++ b/common/.config/nvim/after/ftplugin/markdown.lua @@ -11,7 +11,7 @@ local function check_codelens_support() end vim.api.nvim_create_autocmd({ "TextChanged", "InsertLeave", "CursorHold", "LspAttach", "BufEnter" }, { - buffer = bufnr, + buffer = vim.api.nvim_get_current_buf(), callback = function() if check_codelens_support() then vim.lsp.codelens.refresh({ bufnr = 0 }) diff --git a/common/.config/nvim/lsp/markdown_oxide.lua b/common/.config/nvim/lsp/markdown_oxide.lua deleted file mode 100644 index 118f70f..0000000 --- a/common/.config/nvim/lsp/markdown_oxide.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - cmd = { "markdown-oxide" }, - filetypes = { "markdown" }, - root_dir = function() - return vim.fn.getcwd() - end, - settings = { - workspace = { - didChangeWatchedFiles = { - dynamicRegistration = true, - }, - }, - }, -} diff --git a/common/.config/nvim/lua/plugins/lang-markdown.lua b/common/.config/nvim/lua/plugins/lang-markdown.lua index d622e3c..8ab267f 100644 --- a/common/.config/nvim/lua/plugins/lang-markdown.lua +++ b/common/.config/nvim/lua/plugins/lang-markdown.lua @@ -69,6 +69,30 @@ return { end, }, + { + "obsidian-nvim/obsidian.nvim", + version = "*", + enabled = true, + opts = { + workspaces = { + { + name = "personal", + path = "~/Code/Notes", + }, + }, + completions = { + blink = true, + nvim_cmp = false, + }, + comment = { enabled = true }, + attachments = { img_folder = ".artifacts/img" }, + footer = { format = "{{backlinks}} backlinks" }, + legacy_commands = false, + ui = { enable = false }, + frontmatter = { enabled = false }, + }, + }, + { "bullets-vim/bullets.vim", ft = { "markdown", "text", "gitcommit", "scratch" },