mirror of
https://github.com/kogakure/dotfiles.git
synced 2026-02-04 04:35:29 +00:00
45 lines
938 B
Lua
45 lines
938 B
Lua
-- Not UFO in the sky, but an ultra fold in Neovim.
|
|
-- https://github.com/kevinhwang91/nvim-ufo
|
|
return {
|
|
"kevinhwang91/nvim-ufo",
|
|
dependencies = "kevinhwang91/promise-async",
|
|
config = function()
|
|
vim.o.foldcolumn = "1"
|
|
vim.o.foldlevel = 99
|
|
vim.o.foldlevelstart = 99
|
|
vim.o.foldenable = true
|
|
|
|
require("ufo").setup({
|
|
provider_selector = function(bufnr, filetype, bufftype)
|
|
return { "lsp", "indent" }
|
|
end,
|
|
})
|
|
end,
|
|
keys = {
|
|
{
|
|
"zR",
|
|
function()
|
|
require("ufo").openAllFolds()
|
|
end,
|
|
desc = "Open all folds",
|
|
},
|
|
{
|
|
"zM",
|
|
function()
|
|
require("ufo").closeAllFolds()
|
|
end,
|
|
desc = "Close all folds",
|
|
},
|
|
{
|
|
"zK",
|
|
function()
|
|
local winid = require("ufo").peekFoldedLinesUnderCursor()
|
|
if not winid then
|
|
vim.lsp.buf.hover()
|
|
end
|
|
end,
|
|
desc = "Peek fold",
|
|
},
|
|
},
|
|
}
|