From f9808c01a02eda2940e64e9868df24eb14c00cad Mon Sep 17 00:00:00 2001 From: d0zingcat Date: Wed, 4 Mar 2026 21:35:08 +0800 Subject: [PATCH] refactor(nvim): simplify fold config and remove statuscol Switch to manual folding, remove treesitter foldexpr and statuscol.nvim dependency, simplify snacks statuscolumn config. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus --- nvim/lua/config/options.lua | 6 +++--- nvim/lua/plugins/editor.lua | 20 +------------------- nvim/lua/plugins/snacks.lua | 8 +------- 3 files changed, 5 insertions(+), 29 deletions(-) diff --git a/nvim/lua/config/options.lua b/nvim/lua/config/options.lua index a98409f..f6984df 100644 --- a/nvim/lua/config/options.lua +++ b/nvim/lua/config/options.lua @@ -44,9 +44,9 @@ opt.autoindent = true -- 自动缩进 opt.cindent = true -- C语言缩进规则 opt.textwidth = 120 -- 文本宽度 opt.formatoptions = "jcroqlnt" -- 格式化选项 -opt.foldenable = false -- 默认不折叠 -opt.foldmethod = "expr" -- 使用表达式进行折叠 -opt.foldexpr = "nvim_treesitter#foldexpr()" -- 使用treesitter进行折叠 +opt.foldenable = false +opt.foldcolumn = "0" +opt.foldmethod = "manual" -- 搜索设置 opt.ignorecase = true -- 搜索忽略大小写 diff --git a/nvim/lua/plugins/editor.lua b/nvim/lua/plugins/editor.lua index 7f98079..aa2da88 100644 --- a/nvim/lua/plugins/editor.lua +++ b/nvim/lua/plugins/editor.lua @@ -272,20 +272,6 @@ return { "kevinhwang91/nvim-ufo", dependencies = { "kevinhwang91/promise-async", - { - "luukvbaal/statuscol.nvim", - config = function() - local builtin = require("statuscol.builtin") - require("statuscol").setup({ - relculright = true, - segments = { - { text = { builtin.foldfunc }, click = "v:lua.ScFa" }, - { text = { "%s" }, click = "v:lua.ScSa" }, - { text = { builtin.lnumfunc, " " }, click = "v:lua.ScLa" }, - }, - }) - end, - }, }, event = "BufReadPost", opts = { @@ -293,11 +279,7 @@ return { return { "treesitter", "indent" } end, open_fold_hl_timeout = 150, - close_fold_kinds_for_ft = { - default = { "imports", "comment" }, - json = { "array" }, - yaml = { "sequence" }, - }, + close_fold_kinds_for_ft = {}, preview = { win_config = { border = { "", "─", "", "", "", "─", "", "" }, diff --git a/nvim/lua/plugins/snacks.lua b/nvim/lua/plugins/snacks.lua index 78018e2..4ebd0af 100644 --- a/nvim/lua/plugins/snacks.lua +++ b/nvim/lua/plugins/snacks.lua @@ -31,13 +31,7 @@ return { -- Enhanced statuscolumn statuscolumn = { - enabled = true, - left = { "mark", "sign" }, - right = { "fold", "git" }, - folds = { - open = true, - git_hl = false, - }, + enabled = false, }, -- Word highlighting and jumping