feat: Add kevinhwang91/nvim-ufo as an option
This commit is contained in:
parent
4120893b8a
commit
efdad344b8
1
init.lua
1
init.lua
|
@ -922,6 +922,7 @@ require('lazy').setup({
|
|||
-- require 'kickstart.plugins.lint',
|
||||
-- require 'kickstart.plugins.autopairs',
|
||||
-- require 'kickstart.plugins.neo-tree',
|
||||
-- require 'kickstart.plugins.nvim-ufo',
|
||||
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
|
||||
|
||||
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
-- Makes folding look modern and keep high performance
|
||||
return {
|
||||
'kevinhwang91/nvim-ufo',
|
||||
dependencies = { 'kevinhwang91/promise-async' },
|
||||
config = function()
|
||||
vim.opt.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
|
||||
vim.opt.foldlevelstart = 99
|
||||
|
||||
-- treesitter as a main provider instead
|
||||
-- (Note: the `nvim-treesitter` plugin is *not* needed.)
|
||||
-- ufo uses the same query files for folding (queries/<lang>/folds.scm)
|
||||
-- performance and stability are better than `foldmethod=nvim_treesitter#foldexpr()`
|
||||
require('ufo').setup {
|
||||
provider_selector = function(bufnr, filetype, buftype)
|
||||
return { 'treesitter', 'indent' }
|
||||
end,
|
||||
}
|
||||
end,
|
||||
}
|
Loading…
Reference in New Issue