diff --git a/dots/.config/nvim/after/ftplugin/orgagenda.lua b/dots/.config/nvim/after/ftplugin/orgagenda.lua new file mode 100644 index 00000000..c246b830 --- /dev/null +++ b/dots/.config/nvim/after/ftplugin/orgagenda.lua @@ -0,0 +1 @@ +vim.b.ufo_foldlevel_max = 1 diff --git a/dots/.config/nvim/lua/plugins/configs/nvim-ufo.lua b/dots/.config/nvim/lua/plugins/configs/nvim-ufo.lua index 235a1ef1..3aab1827 100644 --- a/dots/.config/nvim/lua/plugins/configs/nvim-ufo.lua +++ b/dots/.config/nvim/lua/plugins/configs/nvim-ufo.lua @@ -19,6 +19,9 @@ local change_buf_foldlevel_by = function(num) else foldlevel = 0 end + if vim.b.ufo_foldlevel and foldlevel > vim.b.ufo_foldlevel_max then + return + end set_buf_foldlevel(foldlevel) end