From b313e4516f82c609a2c6105381070d177a055dfd Mon Sep 17 00:00:00 2001 From: Martin Date: Thu, 24 Jul 2025 19:50:58 +0200 Subject: [PATCH] Add nvim render markdown --- nix/user/nvim.nix | 3 ++- nvim/plugins.lua | 25 ++++++++++++++++++------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/nix/user/nvim.nix b/nix/user/nvim.nix index 44ee223..140783e 100644 --- a/nix/user/nvim.nix +++ b/nix/user/nvim.nix @@ -21,6 +21,7 @@ mini-splitjoin mini-move mini-ai + mini-icons flash-nvim trouble-nvim conform-nvim @@ -62,7 +63,7 @@ zen-mode-nvim plantuml-syntax obsidian-nvim - markdown-preview-nvim + render-markdown-nvim image-nvim img-clip-nvim vim-nix diff --git a/nvim/plugins.lua b/nvim/plugins.lua index 133d784..d975167 100644 --- a/nvim/plugins.lua +++ b/nvim/plugins.lua @@ -46,13 +46,17 @@ cmp.setup({ [''] = cmp.mapping.abort(), [''] = cmp.mapping(function(fallback) if cmp.visible() then - if ls.expandable() then - ls.expand() - else - cmp.confirm({ - select = true, - }) - end + if cmp.get_selected_entry() then + if ls.expandable() then + ls.expand() + else + cmp.confirm({ + select = false, + }) + end + else + fallback() + end else fallback() end @@ -426,3 +430,10 @@ require("obsidian").setup({ end, daily_notes = daily_notes, }) + +require('render-markdown').setup({ + enabled = true, + file_types = { 'markdown'}, + completions = { lsp = { enabled = true } }, + render_modes = { 'n', 'c', 't' }, +})