diff --git a/lua/lsp/cmp.lua b/lua/lsp/cmp.lua index e34e1a2..8c794ee 100644 --- a/lua/lsp/cmp.lua +++ b/lua/lsp/cmp.lua @@ -82,5 +82,5 @@ local cmp_autopairs = require("nvim-autopairs.completion.cmp") cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) -- use friendly snippet -require("luasnip.loaders.from_vscode").lazy_load() +require("luasnip.loaders.from_vscode").lazy_load({ exclude = { "tex" } }) require("luasnip.loaders.from_vscode").lazy_load({ paths = "~/.config/nvim/snippets" }) diff --git a/lua/plugin-config/indent-blankline.lua b/lua/plugin-config/indent-blankline.lua index 4cd0d5e..750f9b6 100644 --- a/lua/plugin-config/indent-blankline.lua +++ b/lua/plugin-config/indent-blankline.lua @@ -1,7 +1,39 @@ -require("indent_blankline").setup({ - -- for example, context is off by default, use this to turn it on - show_current_context = true, - indent_blankline_use_treesitter = true, - indent_blankline_use_treesitter_scope = true, - indent_blankline_char = "¦", +local highlight = { + "RainbowRed", + "RainbowYellow", + "RainbowBlue", + "RainbowOrange", + "RainbowGreen", + "RainbowViolet", + "RainbowCyan", +} + +local hooks = require("ibl.hooks") +-- create the highlight groups in the highlight setup hook, so they are reset +-- every time the colorscheme changes +hooks.register(hooks.type.HIGHLIGHT_SETUP, function() + vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" }) + vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" }) + vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" }) + vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" }) + vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" }) + vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" }) + vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" }) +end) + +require("ibl").setup({ + indent = { highlight = highlight }, + exclude = { + filetypes = { + "lspinfo", + "packer", + "checkhealth", + "help", + "man", + "gitcommit", + "TelescopePrompt", + "TelescopeResults", + "dashboard", + }, + }, }) diff --git a/lua/plugin-config/lua_snip.lua b/lua/plugin-config/lua_snip.lua index 0b79f68..53ed477 100644 --- a/lua/plugin-config/lua_snip.lua +++ b/lua/plugin-config/lua_snip.lua @@ -55,14 +55,54 @@ ls.add_snippets("markdown", { t({ "", "", "---", "" }), i(0), }), + s("$", { -- inline formula + t("$"), + i(1), + t("$"), + }), + s("formula", { -- outline formula + t("$$"), + t({ "", "" }), + i(1), + t({ "", "" }), + t("$$"), + }), + s("mathbf", { + t("\\mathbf{"), + i(1), + t("}"), + }), + s("betahat", { + t("\\hat{\\beta}"), + }), }) ls.add_snippets("tex", { + s("formula", { + t("\\("), -- 输出 \( + i(1), -- 输入补全内容 + t("\\)"), -- 输出 \) + }), s("usepackage", { t("\\usepackage{"), i(1), t("}"), }), + s("Italic", { + t("\\textit{"), + i(1), + t("}"), + }), + s("bold", { + t("\\textbf{"), + i(1), + t("}"), + }), + s("underline", { + t("\\underline{"), + i(1), + t("}"), + }), s("begin", { t("\\begin{"), i(1, "enumerate"), diff --git a/lua/plugin-config/vimtex.lua b/lua/plugin-config/vimtex.lua index 4367b52..8d18ea7 100644 --- a/lua/plugin-config/vimtex.lua +++ b/lua/plugin-config/vimtex.lua @@ -7,7 +7,7 @@ vim.cmd("syntax enable") -- Viewer options: One may configure the viewer either by specifying a built-in -- viewer method: -vim.g.vimtex_view_method = "skim" +vim.g.vimtex_view_method = "sioyek" -- vim.g.vimtex_view_general_options = "--unique file:@pdf\\#src:@line@tex" vim.g.vimtex_complete_close_braces = 1