render markdown added + keybinds for rendermarkdown in init.lua
This commit is contained in:
parent
fa0aae5a48
commit
a31276bcdd
16
init.lua
16
init.lua
|
|
@ -103,6 +103,22 @@ vim.keymap.set('n', '<leader>tw', function()
|
|||
print('Wrap ' .. (vim.wo.wrap and 'enabled' or 'disabled'))
|
||||
end, { desc = 'Toggle line wrap' })
|
||||
|
||||
vim.keymap.set('n', '<leader>tr', function()
|
||||
-- Ensure line wrapping is enabled
|
||||
if vim.bo.filetype ~= 'markdown' then
|
||||
return
|
||||
end
|
||||
|
||||
vim.opt_local.wrap = true
|
||||
vim.opt_local.linebreak = true
|
||||
|
||||
-- Toggle RenderMarkdown
|
||||
vim.cmd 'RenderMarkdown toggle'
|
||||
|
||||
print 'RenderMarkdown enabled with line wrap'
|
||||
end, { desc = 'Toggle RenderMarkdown + enable wrap' })
|
||||
|
||||
vim.keymap.set('n', '<leader>tp', '<cmd>RenderMarkdown preview<CR>', { desc = 'Toggle Render md preview' })
|
||||
-- [[ Basic Autocommands ]]
|
||||
-- See `:help lua-guide-autocommands`
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
return {
|
||||
'MeanderingProgrammer/render-markdown.nvim',
|
||||
dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-mini/mini.nvim' }, -- if you use the mini.nvim suite
|
||||
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-mini/mini.icons' }, -- if you use standalone mini plugins
|
||||
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons
|
||||
---@module 'render-markdown'
|
||||
---@type render.md.UserConfig
|
||||
opts = {
|
||||
render_modes = {},
|
||||
},
|
||||
}
|
||||
Loading…
Reference in New Issue