Update markview keyboard shortcut
- Update the keyboard shortcut to imitate Joplin behavior
This commit is contained in:
parent
21336806ff
commit
4812bdd7dc
|
@ -3,34 +3,37 @@
|
|||
--
|
||||
-- See the kickstart.nvim README for more information
|
||||
return {
|
||||
{
|
||||
'OXY2DEV/markview.nvim',
|
||||
lazy = false, -- Recommended
|
||||
-- ft = "markdown" -- If you decide to lazy-load anyway
|
||||
{
|
||||
'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', '<C-ö>', 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,
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
},
|
||||
|
||||
opts = {
|
||||
initial_state = false,
|
||||
},
|
||||
config = function(_, opts)
|
||||
require('markview').setup(opts)
|
||||
|
||||
-- This function imitates the behavior of Joplin when rendering notes
|
||||
local splitToggle_state = 0
|
||||
vim.keymap.set('n', '<C-ö>', function()
|
||||
if splitToggle_state == 0 then
|
||||
vim.cmd 'Markview enableAll'
|
||||
splitToggle_state = 1
|
||||
elseif splitToggle_state == 1 then
|
||||
vim.cmd 'Markview splitEnable'
|
||||
splitToggle_state = 2
|
||||
else
|
||||
vim.cmd 'Markview splitDisable'
|
||||
vim.cmd 'Markview disableAll'
|
||||
splitToggle_state = 0
|
||||
end
|
||||
end, { silent = true, desc = 'Toggle Markview split view' })
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue