From 09f2f9f74b077821f02d4d5808299478a5f501c5 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Thu, 1 May 2025 16:53:02 +0300 Subject: Markdown-toggle plugin is now lazy loaded --- .config/nvim/lua/plugins/markdown-toggle.lua | 33 ++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 9 deletions(-) (limited to '.config') diff --git a/.config/nvim/lua/plugins/markdown-toggle.lua b/.config/nvim/lua/plugins/markdown-toggle.lua index 39a932c..816d8d3 100644 --- a/.config/nvim/lua/plugins/markdown-toggle.lua +++ b/.config/nvim/lua/plugins/markdown-toggle.lua @@ -1,12 +1,27 @@ return { 'roodolv/markdown-toggle.nvim', - event = 'VeryLazy', - config = function() - require('markdown-toggle').setup() - local opts = { silent = true, noremap = true } - local toggle = require('markdown-toggle') - vim.keymap.set({ 'n', 'x' }, 'tu', toggle.list, opts) - vim.keymap.set({ 'n', 'x' }, 'to', toggle.olist, opts) - vim.keymap.set({ 'n', 'x' }, 'tm', toggle.checkbox, opts) - end, + opts = {}, + keys = { + { + 'tu', + function() + require('markdown-toggle').list() + end, + mode = { 'n', 'x' }, + }, + { + 'to', + function() + require('markdown-toggle').olist() + end, + mode = { 'n', 'x' }, + }, + { + 'tm', + function() + require('markdown-toggle').checkbox() + end, + mode = { 'n', 'x' }, + }, + }, } -- cgit v1.3.1