mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-24 17:58:46 +02:00
add: update plugins
This commit is contained in:
parent
7d9072b9d6
commit
cd9dcc6c26
2 changed files with 46 additions and 2 deletions
41
lua/custom/plugins/nvimufo.lua
Normal file
41
lua/custom/plugins/nvimufo.lua
Normal file
|
@ -0,0 +1,41 @@
|
|||
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 = "BufRead",
|
||||
config = function()
|
||||
vim.o.foldcolumn = "1" -- '0' is not bad
|
||||
vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
|
||||
vim.o.foldlevelstart = 99
|
||||
vim.o.foldenable = true
|
||||
vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
|
||||
|
||||
-- these are "extra", change them as you like
|
||||
vim.keymap.set("n", "zR", require("ufo").openAllFolds)
|
||||
vim.keymap.set("n", "zM", require("ufo").closeAllFolds)
|
||||
|
||||
-- Option 3: treesitter as a main provider instead
|
||||
-- Only depend on `nvim-treesitter/queries/filetype/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…
Add table
Add a link
Reference in a new issue