diff --git a/init.lua b/init.lua index db7731c2..d3d6cbfc 100644 --- a/init.lua +++ b/init.lua @@ -737,7 +737,7 @@ require('lazy').setup({ -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, }, { ui = { -- If you are using a Nerd Font: set icons to an empty table which will use the diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index be0eb9d8..d8dfd9b1 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -2,4 +2,35 @@ -- I promise not to create any merge conflicts in this directory :) -- -- See the kickstart.nvim README for more information -return {} +return { + { + 'OXY2DEV/markview.nvim', + lazy = false, -- Recommended + -- ft = "markdown" -- If you decide to lazy-load anyway + + dependencies = { + 'nvim-treesitter/nvim-treesitter', + 'nvim-tree/nvim-web-devicons', + }, + + opts = { + initial_state = false, + }, + config = function(_, opts) + require('markview').setup(opts) + + local splitToggle_state = false + vim.keymap.set('n', '', function() + if not splitToggle_state then + -- The split toggle will not work unless markview is disabled in the initial window beforehand + vim.cmd 'Markview disableAll' + vim.cmd 'Markview splitEnable' + splitToggle_state = true + else + vim.cmd 'Markview splitDisable' + splitToggle_state = false + end + end, { silent = true, desc = 'Toggle Markview split view' }) + end, + }, +}