change indent-blankline from v2 to v3 and add some lua_snippets

This commit is contained in:
gameloader 2023-10-19 10:29:57 +08:00
parent c6d1d071d3
commit feea10f74a
4 changed files with 80 additions and 8 deletions

View File

@ -82,5 +82,5 @@ local cmp_autopairs = require("nvim-autopairs.completion.cmp")
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
-- use friendly snippet -- 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" }) require("luasnip.loaders.from_vscode").lazy_load({ paths = "~/.config/nvim/snippets" })

View File

@ -1,7 +1,39 @@
require("indent_blankline").setup({ local highlight = {
-- for example, context is off by default, use this to turn it on "RainbowRed",
show_current_context = true, "RainbowYellow",
indent_blankline_use_treesitter = true, "RainbowBlue",
indent_blankline_use_treesitter_scope = true, "RainbowOrange",
indent_blankline_char = "¦", "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",
},
},
}) })

View File

@ -55,14 +55,54 @@ ls.add_snippets("markdown", {
t({ "", "", "---", "" }), t({ "", "", "---", "" }),
i(0), 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", { ls.add_snippets("tex", {
s("formula", {
t("\\("), -- 输出 \(
i(1), -- 输入补全内容
t("\\)"), -- 输出 \)
}),
s("usepackage", { s("usepackage", {
t("\\usepackage{"), t("\\usepackage{"),
i(1), i(1),
t("}"), t("}"),
}), }),
s("Italic", {
t("\\textit{"),
i(1),
t("}"),
}),
s("bold", {
t("\\textbf{"),
i(1),
t("}"),
}),
s("underline", {
t("\\underline{"),
i(1),
t("}"),
}),
s("begin", { s("begin", {
t("\\begin{"), t("\\begin{"),
i(1, "enumerate"), i(1, "enumerate"),

View File

@ -7,7 +7,7 @@ vim.cmd("syntax enable")
-- Viewer options: One may configure the viewer either by specifying a built-in -- Viewer options: One may configure the viewer either by specifying a built-in
-- viewer method: -- 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_view_general_options = "--unique file:@pdf\\#src:@line@tex"
vim.g.vimtex_complete_close_braces = 1 vim.g.vimtex_complete_close_braces = 1