Skip to content

How can folds persist after a session? #312

@FIREBAT-66

Description

@FIREBAT-66

Feature description

Hello @kevinhwang91 , nvim-ufo folds don't seem to persist after exiting an nvim session. I wanted to ask if you might know how this can be done, because some cursory research led me to attempt to make autocommands in nvim, and this is all I could come up with:

`vim.api.nvim_create_autocmd({ "BufWinLeave" }, {
pattern = { "*" },
desc = "save folds on exit",
command = "mkview",
})

vim.api.nvim_create_autocmd({ "BufWinEnter" }, {
pattern = { "*" },
desc = "load folds on entry",
command = "silent! loadview",
})
`

However, I keep getting errors and am unable to open files after starting nvim:

Image Image

Describe the solution you'd like

I would like to know if nvim-ufo has a abuilt-in way to save the state of every file with folds so that the next time I open a file, it is folded to the last folded state

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions