Skip to content

Commit 2133680

Browse files
committed
Add custom plugin markview
1 parent e49f56f commit 2133680

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ require('lazy').setup({
737737
--
738738
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
739739
-- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins`
740-
-- { import = 'custom.plugins' },
740+
{ import = 'custom.plugins' },
741741
}, {
742742
ui = {
743743
-- If you are using a Nerd Font: set icons to an empty table which will use the

lua/custom/plugins/init.lua

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,35 @@
22
-- I promise not to create any merge conflicts in this directory :)
33
--
44
-- See the kickstart.nvim README for more information
5-
return {}
5+
return {
6+
{
7+
'OXY2DEV/markview.nvim',
8+
lazy = false, -- Recommended
9+
-- ft = "markdown" -- If you decide to lazy-load anyway
10+
11+
dependencies = {
12+
'nvim-treesitter/nvim-treesitter',
13+
'nvim-tree/nvim-web-devicons',
14+
},
15+
16+
opts = {
17+
initial_state = false,
18+
},
19+
config = function(_, opts)
20+
require('markview').setup(opts)
21+
22+
local splitToggle_state = false
23+
vim.keymap.set('n', '<C-ö>', function()
24+
if not splitToggle_state then
25+
-- The split toggle will not work unless markview is disabled in the initial window beforehand
26+
vim.cmd 'Markview disableAll'
27+
vim.cmd 'Markview splitEnable'
28+
splitToggle_state = true
29+
else
30+
vim.cmd 'Markview splitDisable'
31+
splitToggle_state = false
32+
end
33+
end, { silent = true, desc = 'Toggle Markview split view' })
34+
end,
35+
},
36+
}

0 commit comments

Comments
 (0)