moar
This commit is contained in:
parent
511e06bc54
commit
5d96e9349b
5 changed files with 93 additions and 11 deletions
25
lua/custom/plugins/nvim-ufo.lua
Normal file
25
lua/custom/plugins/nvim-ufo.lua
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
return {
|
||||
"kevinhwang91/nvim-ufo",
|
||||
dependencies = "kevinhwang91/promise-async",
|
||||
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.keymap.set("n", "zR", require("ufo").openAllFolds, { desc = "Open all folds" })
|
||||
vim.keymap.set("n", "zM", require("ufo").closeAllFolds, { desc = "Close all folds" })
|
||||
vim.keymap.set("n", "zK", function()
|
||||
local winid = require("ufo").peekFoldedLinesUnderCursor()
|
||||
if not winid then
|
||||
vim.lsp.buf.hover()
|
||||
end
|
||||
end, { desc = "Peek Fold" })
|
||||
|
||||
require("ufo").setup({
|
||||
provider_selector = function(bufnr, filetype, buftype)
|
||||
return { "lsp", "indent" }
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue