diff --git a/nvim/after/ftplugin/markdown.lua b/nvim/after/ftplugin/markdown.lua new file mode 100644 index 0000000..85c5c4a --- /dev/null +++ b/nvim/after/ftplugin/markdown.lua @@ -0,0 +1,8 @@ +vim.opt_local.wrap = true +vim.opt_local.linebreak = true +vim.opt_local.breakindent = true +vim.opt_local.breakindentopt = "list:-1" + +local opts = { buffer = true, expr = true, silent = true } +vim.keymap.set({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", opts) +vim.keymap.set({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", opts) diff --git a/nvim/lua/plugins/render-markdown.lua b/nvim/lua/plugins/render-markdown.lua index 3af005e..cc3fd36 100644 --- a/nvim/lua/plugins/render-markdown.lua +++ b/nvim/lua/plugins/render-markdown.lua @@ -3,10 +3,10 @@ return { ft = { "markdown" }, dependencies = { "nvim-treesitter/nvim-treesitter" }, opts = { + render_modes = true, win_options = { - wrap = { default = false, rendered = true }, - linebreak = { default = false, rendered = true }, - breakindent = { default = false, rendered = true }, + conceallevel = { default = vim.o.conceallevel, rendered = 2 }, + concealcursor = { default = vim.o.concealcursor, rendered = "nc" }, }, }, }