diff --git a/nvim/.config/nvim/lua/plugins/formatting.lua b/nvim/.config/nvim/lua/plugins/formatting.lua index 238de55..c434b55 100644 --- a/nvim/.config/nvim/lua/plugins/formatting.lua +++ b/nvim/.config/nvim/lua/plugins/formatting.lua @@ -29,7 +29,7 @@ return { vim.keymap.set({ "n", "v" }, "mp", function() conform.format({ lsp_fallback = true, - async = false, + async = true, timeout_ms = 500, }) end, { desc = "Format file or range (in visual mode)" }) diff --git a/nvim/.config/nvim/lua/plugins/treesitter.lua b/nvim/.config/nvim/lua/plugins/treesitter.lua index 473b4b9..80e5865 100644 --- a/nvim/.config/nvim/lua/plugins/treesitter.lua +++ b/nvim/.config/nvim/lua/plugins/treesitter.lua @@ -1,14 +1,44 @@ return { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - config = function () - local configs = require("nvim-treesitter.configs") + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + config = function() + local configs = require("nvim-treesitter.configs") - configs.setup({ - ensure_installed = { "lua", "vim", "vimdoc", "javascript", "html", "python", "dockerfile", "latex", "yaml", "regex", "bash", "markdown", "markdown_inline" }, - sync_install = false, - highlight = { enable = true }, - indent = { enable = true }, - }) - end + configs.setup({ + ensure_installed = { + "lua", + "vim", + "vimdoc", + "javascript", + "html", + "python", + "dockerfile", + "latex", + "yaml", + "regex", + "bash", + "markdown", + "markdown_inline", + }, + sync_install = false, + highlight = { enable = true }, + indent = { enable = true }, + }) + end, + opts = function(_, opts) + vim.treesitter.language.register("markdown", "mdx") + -- vim.list_extend(opts.highlight.disable, { "tsx" }) + if type(opts.ensure_installed) == "table" then + vim.list_extend(opts.ensure_installed, { + "bibtex", + "latex", + -- you can add more here + }) + end + if type(opts.highlight.disable) == "table" then + vim.list_extend(opts.highlight.disable, { "latex", "bibtex" }) + else + opts.highlight.disable = { "latex", "bibtex" } + end + end, } diff --git a/nvim/.config/nvim/lua/plugins/vimtex.lua b/nvim/.config/nvim/lua/plugins/vimtex.lua new file mode 100644 index 0000000..0138818 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/vimtex.lua @@ -0,0 +1,27 @@ +return { + { + "lervag/vimtex", + lazy = false, -- lazy-loading will disable inverse search + config = function() + vim.api.nvim_create_autocmd({ "FileType" }, { + group = vim.api.nvim_create_augroup("lazyvim_vimtex_conceal", { clear = true }), + pattern = { "bib", "tex" }, + callback = function() + vim.wo.conceallevel = 0 + end, + }) + vim.g.vimtex_mappings_disable = { ["n"] = { "K" } } -- disable `K` as it conflicts with LSP hover + vim.g.vimtex_quickfix_method = vim.fn.executable("pplatex") == 1 and "pplatex" or "latexlog" + + vim.g.vimtex_view_method = "zathura" -- <== macos specific, you can use zathura or sumatra or something else. + vim.g.vimtex_view_skim_sync = 1 + vim.g.vimtex_view_skim_activate = 1 + vim.g.vimtex_view_skim_reading_bar = 1 + + vim.g.vimtex_compiler_latexmk = { + aux_dir = "./aux", + out_dir = "./out", + } + end, + }, +}