diff --git a/lazy-lock.json b/lazy-lock.json index ec98621..8d48e74 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -17,9 +17,11 @@ "nvim-surround": { "branch": "main", "commit": "1098d7b3c34adcfa7feb3289ee434529abd4afd1" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-treesitter-textobjects": { "branch": "main", "commit": "a0e182ae21fda68c59d1f36c9ed45600aef50311" }, + "nvim-ufo": { "branch": "main", "commit": "ab3eb124062422d276fae49e0dd63b3ad1062cfc" }, "nvim-web-devicons": { "branch": "master", "commit": "746ffbb17975ebd6c40142362eee1b0249969c5c" }, "oil.nvim": { "branch": "master", "commit": "f55b25e493a7df76371cfadd0ded5004cb9cd48a" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, "snacks.nvim": { "branch": "main", "commit": "fe7cfe9800a182274d0f868a74b7263b8c0c020b" }, "supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" }, "vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" }, diff --git a/lua/plugins/editor.lua b/lua/plugins/editor.lua index 9984ef4..63ecc89 100644 --- a/lua/plugins/editor.lua +++ b/lua/plugins/editor.lua @@ -52,6 +52,22 @@ return { opts = {}, }, + -- Folds + { + "kevinhwang91/nvim-ufo", + dependencies = { "kevinhwang91/promise-async" }, + event = "BufReadPost", + opts = { + provider_selector = function() + return { "treesitter", "indent" } + end, + }, + keys = { + { "zR", function() require("ufo").openAllFolds() end, desc = "Open all folds" }, + { "zM", function() require("ufo").closeAllFolds() end, desc = "Close all folds" }, + }, + }, + -- Supermaven AI completion { "supermaven-inc/supermaven-nvim", diff --git a/plugin/options.lua b/plugin/options.lua index adc5a86..60c4227 100644 --- a/plugin/options.lua +++ b/plugin/options.lua @@ -41,6 +41,11 @@ o.backup = false o.undofile = true o.undodir = vim.fn.stdpath("data") .. "/undo" +-- Folds (nvim-ufo) +o.foldlevel = 99 +o.foldlevelstart = 99 +o.foldenable = true + -- Misc o.updatetime = 250 o.mouse = "a"