From 5bdce5f1a834882963e0185f2f3043e8be914e47 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Thu, 12 Mar 2026 20:46:00 +0545 Subject: [PATCH] feat(lua/plugins): improve markdown-preview and treesitter setup Enhancements: - Refined markdown-preview configuration to use command toggles and lazy loading - Simplified treesitter setup by using direct nvim-treesitter API New Features: - Added support for MarkdownPreviewStop command - Updated ft configuration to use a table for markdown filetypes Bug Fixes: - None --- lua/plugins/editor.lua | 9 ++++----- lua/plugins/syntax.lua | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lua/plugins/editor.lua b/lua/plugins/editor.lua index 5335b63..1ab7a73 100644 --- a/lua/plugins/editor.lua +++ b/lua/plugins/editor.lua @@ -106,11 +106,10 @@ return { -- markdown preview { 'iamcco/markdown-preview.nvim', - build = 'cd app && yarn install', - init = function() - vim.g.mkdp_filetypes = { 'markdown' } + cmd = { 'MarkdownPreviewToggle', 'MarkdownPreview', 'MarkdownPreviewStop' }, + ft = { 'markdown' }, + build = function() + vim.fn['mkdp#util#install']() end, - ft = 'markdown', - cmd = { 'MarkdownPreviewToggle', 'MarkdownPreview' }, }, } diff --git a/lua/plugins/syntax.lua b/lua/plugins/syntax.lua index e4e9fb2..c7a91bb 100644 --- a/lua/plugins/syntax.lua +++ b/lua/plugins/syntax.lua @@ -6,7 +6,7 @@ return { build = ':TSUpdate', event = { 'BufReadPost', 'BufNewFile' }, config = function() - require('nvim-treesitter.configs').setup({ + require('nvim-treesitter').setup({ ensure_installed = require('config.extensions').ts_parsers, auto_install = true, highlight = {