diff --git a/lua/core/init.lua b/lua/core/init.lua index 1d0e7c8..5e9681b 100644 --- a/lua/core/init.lua +++ b/lua/core/init.lua @@ -105,10 +105,10 @@ vim.api.nvim_create_autocmd("FileType", { end -- 版本号匹配 vim.fn.matchadd("LogVersion", [[v\d\+\.\d\+\.\d\+]]) - -- \V 表示 "very nomagic",即不使用正则特殊字符,直接匹配字面量 - vim.fn.matchadd("LogDownloaded", [[\VDownloaded]]) + -- \V 表示 "very nomagic"直接匹配字面量,\c 表示不区分大小写,\S* 匹配零个或多个“非空白”字符 + vim.fn.matchadd("LogDownloaded", [[\c\S*download\S*]]) vim.fn.matchadd("LogCompiling", [[\VCompiling]]) - vim.fn.matchadd("LogFinished", [[\VFinished]]) + vim.fn.matchadd("LogFinished", [[\c\S*finish\S*]]) end, }) diff --git a/lua/pack/configs/indentblankline.lua b/lua/pack/configs/indentblankline.lua index ad335d0..8d9cd0e 100644 --- a/lua/pack/configs/indentblankline.lua +++ b/lua/pack/configs/indentblankline.lua @@ -6,7 +6,7 @@ local P = { -- 懒加载触发器 vim.api.nvim_create_autocmd({ - "FileType", + "BufReadPost", "BufNewFile" -- 处理普通的文本文件时也能显示基础线条 }, { callback = function() PackUtils.load(P, function() @@ -32,7 +32,10 @@ vim.api.nvim_create_autocmd({ vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" }) end) require("ibl").setup({ - indent = { highlight = highlight } + indent = { highlight = highlight }, + exclude = { + filetypes = { "dashboard" }, + }, }) end) end diff --git a/lua/pack/configs/stickscroll.lua b/lua/pack/configs/stickscroll.lua index 85dc5d1..9abe4a7 100644 --- a/lua/pack/configs/stickscroll.lua +++ b/lua/pack/configs/stickscroll.lua @@ -7,31 +7,29 @@ local P = { -- 懒加载触发器 vim.api.nvim_create_autocmd({ - "UIEnter", -- vim.schedule(function() + "FileType" }, { callback = function() - vim.schedule(function() - PackUtils.load(P, function() - -- 前往上下文开始处 - vim.keymap.set("n", "[c", function() - require("treesitter-context").go_to_context(vim.v.count1) - end, { silent = true }) - require("treesitter-context").setup({ - enable = true, -- Enable this plugin (Can be enabled/disabled later via commands) - multiwindow = true, -- 固定多个层级. - max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit. - min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit. - line_numbers = true, - multiline_threshold = 20, -- Maximum number of lines to show for a single context - trim_scope = "outer", -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer' - mode = "cursor", -- Line used to calculate context. Choices: 'cursor', 'topline' - -- Separator between context and content. Should be a single character string, like '-'. - -- When separator is set, the context will only show up when there are at least 2 lines above cursorline. - separator = nil, - zindex = 20, -- The Z-index of the context window - on_attach = nil, -- (fun(buf: integer): boolean) return false to disable attaching - }) - end) + PackUtils.load(P, function() + -- 前往上下文开始处 + vim.keymap.set("n", "[c", function() + require("treesitter-context").go_to_context(vim.v.count1) + end, { silent = true }) + require("treesitter-context").setup({ + enable = true, -- Enable this plugin (Can be enabled/disabled later via commands) + multiwindow = true, -- 固定多个层级. + max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit. + min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit. + line_numbers = true, + multiline_threshold = 20, -- Maximum number of lines to show for a single context + trim_scope = "outer", -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer' + mode = "cursor", -- Line used to calculate context. Choices: 'cursor', 'topline' + -- Separator between context and content. Should be a single character string, like '-'. + -- When separator is set, the context will only show up when there are at least 2 lines above cursorline. + separator = nil, + zindex = 20, -- The Z-index of the context window + on_attach = nil, -- (fun(buf: integer): boolean) return false to disable attaching + }) end) end }) diff --git a/lua/pack/configs/treesitter.lua b/lua/pack/configs/treesitter.lua index 2ab1e2b..8ac6456 100644 --- a/lua/pack/configs/treesitter.lua +++ b/lua/pack/configs/treesitter.lua @@ -20,6 +20,7 @@ local ensure_installed = { -- 在 FileType 确定时,检查、安装并启动 vim.api.nvim_create_autocmd("FileType", { + pattern = ensure_installed, group = vim.api.nvim_create_augroup("NativeTreesitter", { clear = true }), callback = function(args) local buf = args.buf