From 5b450f940215bf54d0d2bb7826be5e53596e50ab Mon Sep 17 00:00:00 2001 From: iGor milhit Date: Tue, 6 Aug 2024 09:00:25 +0200 Subject: [PATCH] quarto: try to adapt config for quarto Co-Authored-by: iGor milhit --- after/ftplugin/markdown.lua | 13 +++++ after/ftplugin/pandoc.lua | 6 --- init.lua | 51 +++++++++++++++---- lua/custom/plugins/mkdnflow.lua | 3 ++ .../plugins/{pandoc.lua => pandoc.lua.save} | 0 lua/custom/plugins/quarto.lua | 18 +++++++ lua/custom/plugins/vim-markdown.lua | 10 ++++ 7 files changed, 84 insertions(+), 17 deletions(-) create mode 100644 after/ftplugin/markdown.lua delete mode 100644 after/ftplugin/pandoc.lua rename lua/custom/plugins/{pandoc.lua => pandoc.lua.save} (100%) create mode 100644 lua/custom/plugins/quarto.lua create mode 100644 lua/custom/plugins/vim-markdown.lua diff --git a/after/ftplugin/markdown.lua b/after/ftplugin/markdown.lua new file mode 100644 index 0000000..93edabd --- /dev/null +++ b/after/ftplugin/markdown.lua @@ -0,0 +1,13 @@ +-- Specific settings for markdown files + +-- Enable the autowrite feature for all commands +-- See :h awa +vim.opt.awa=true + +-- Conceal some syntax +vim.opt.conceallevel = 2 + +-- Use treesitter to fold markdown syntax +-- vim.opt.markdown_folding = 1 +-- vim.opt.foldmethod = 'expr' +-- vim.opt.foldexpr = 'v:lua.vim.treesitter.foldexpr()' diff --git a/after/ftplugin/pandoc.lua b/after/ftplugin/pandoc.lua deleted file mode 100644 index 7390e13..0000000 --- a/after/ftplugin/pandoc.lua +++ /dev/null @@ -1,6 +0,0 @@ --- Specific settings for markdown files (pandoc filetype) --- Enable the autowrite feature for all commands --- See :h awa - -vim.opt.awa=true -vim.opt.foldlevel = 1 diff --git a/init.lua b/init.lua index 7f9ec57..8fb6065 100644 --- a/init.lua +++ b/init.lua @@ -338,7 +338,33 @@ vim.keymap.set('n', 'ss', require'telescope'.extensions.luasnip.luasnip -- See `:help nvim-treesitter` require('nvim-treesitter.configs').setup { -- Add languages to be installed here that you want installed for treesitter - ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'vimdoc', 'vim', 'json' }, + ensure_installed = { + 'bash', + 'c', + 'cpp', + 'css', + 'dot', + 'go', + 'html', + 'javascript', + 'json', + 'julia', + 'latex', + 'lua', + 'markdown', + 'markdown_inline', + 'mermaid', + 'norg', + 'python', + 'query', + 'r', + 'rust', + 'tsx', + 'typescript', + 'vimdoc', + 'vim', + 'yaml', + }, -- Do not install parses synchronously sync_install = false, @@ -348,17 +374,20 @@ require('nvim-treesitter.configs').setup { -- List of parsers to ignore installing ignore_install = { - "markdown" + -- "markdown" }, - -- Required property, but empr? + -- Required property, but empty modules = {}, highlight = { enable = true, - disable = { "markdown" }, + -- disable = { "markdown" }, + additional_vim_regex_highlighting = false, + }, + indent = { + enable = true, }, - indent = { enable = true, disable = { 'python' } }, incremental_selection = { enable = true, keymaps = { @@ -477,12 +506,12 @@ local servers = { -- rust_analyzer = {}, -- tsserver = {}, - -- marksman = { - -- ft = { - -- 'markdown', - -- 'pandoc' - -- } - -- }, + marksman = { + ft = { + 'markdown', + 'pandoc' + } + }, lua_ls = { Lua = { diff --git a/lua/custom/plugins/mkdnflow.lua b/lua/custom/plugins/mkdnflow.lua index 4531df8..d78db50 100644 --- a/lua/custom/plugins/mkdnflow.lua +++ b/lua/custom/plugins/mkdnflow.lua @@ -16,6 +16,9 @@ return { lazy = true, config = function () require('mkdnflow').setup({ + modules = { + foldtext = false + }, filetypes = { md = true, rmd = true, diff --git a/lua/custom/plugins/pandoc.lua b/lua/custom/plugins/pandoc.lua.save similarity index 100% rename from lua/custom/plugins/pandoc.lua rename to lua/custom/plugins/pandoc.lua.save diff --git a/lua/custom/plugins/quarto.lua b/lua/custom/plugins/quarto.lua new file mode 100644 index 0000000..87c0597 --- /dev/null +++ b/lua/custom/plugins/quarto.lua @@ -0,0 +1,18 @@ +-- plugins/quarto.lua. +-- This plugin integrates or configure tools to work with quarto. +-- https://quarto.org/docs/tools/neovim.html +-- https://github.com/quarto-dev/quarto-neovim +-- https://github.com/jmbuhr/quarto-nvim-kickstarter + +return { + { + "quarto-dev/quarto-nvim", + filetype = { 'quarto' }, + dev = false, + opts = {}, + dependencies = { + "jmbuhr/otter.nvim", + "nvim-treesitter/nvim-treesitter", + }, + }, +} diff --git a/lua/custom/plugins/vim-markdown.lua b/lua/custom/plugins/vim-markdown.lua new file mode 100644 index 0000000..c78078e --- /dev/null +++ b/lua/custom/plugins/vim-markdown.lua @@ -0,0 +1,10 @@ +return { + "preservim/vim-markdown", + ft = { + 'markdown', + 'quarto' + }, + lazy = true, + config = function () + end, +}