2024-07-07 16:23:05 +01:00
|
|
|
{
|
2024-07-07 16:24:50 +01:00
|
|
|
programs.nixvim.plugins.nvim-ufo = {
|
2024-07-07 16:23:05 +01:00
|
|
|
enable = true;
|
|
|
|
|
|
|
|
};
|
|
|
|
programs.nixvim.extraConfigLua = ''
|
2024-07-07 16:46:39 +01:00
|
|
|
-- default fold options
|
2024-07-07 16:23:05 +01:00
|
|
|
vim.o.foldcolumn = '1'
|
|
|
|
vim.o.foldlevel = 99
|
|
|
|
vim.o.foldlevelstart = 99
|
|
|
|
vim.o.foldenable = true
|
|
|
|
|
2024-07-07 16:46:39 +01:00
|
|
|
-- nvim_ufo options
|
2024-07-07 16:23:05 +01:00
|
|
|
vim.keymap.set('n', 'zR', require('ufo').openAllFolds, { desc = "Open all folds" })
|
|
|
|
vim.keymap.set('n', 'zM', require('ufo').closeAllFolds, { desc = "Close all folds" })
|
2024-07-07 16:46:39 +01:00
|
|
|
vim.keymap.set('n', 'zK', function()
|
2024-07-07 16:23:05 +01:00
|
|
|
local winid = require("ufo").peekFoldedLinesUnderCursor()
|
|
|
|
if not winid then
|
|
|
|
vim.lsp.buf.hover()
|
|
|
|
end
|
|
|
|
end , { desc = "Peed fold" })
|
|
|
|
|
|
|
|
require("ufo").setup({
|
|
|
|
provider_selector = function(bufnr, filetype, buftype)
|
|
|
|
return { 'lsp', 'indent' }
|
|
|
|
end
|
|
|
|
})
|
|
|
|
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
|