Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 39 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,46 @@ The goal of nvim-ufo is to make Neovim's fold look modern and keep high performa

### Installation

Install with [Packer.nvim](https://github.com/wbthomason/packer.nvim):
<details><summary>With lazy.nvim</summary>

See [lazy.nvim’s documentation](https://lazy.folke.io/) for details.

```lua
use {'kevinhwang91/nvim-ufo', requires = 'kevinhwang91/promise-async'}
{
"kevinhwang91/nvim-ufo",
dependencies = { "kevinhwang91/promise-async" },
event = "VeryLazy", -- You can make it lazy-loaded via VeryLazy, but comment out if anything doesn’t work
init = function()
vim.o.foldlevel = 99
vim.o.foldlevelstart = 99
end,
config = function()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would prefer opts rather than config see: https://lazy.folke.io/spec#spec-setup

require("ufo").setup({
-- your config goes here
-- open_fold_hl_timeout = ...,
-- provider_selector = function(bufnr, filetype)
-- ...
-- end,
})
end,
}
```

</details>

<details><summary>With packer.nvim</summary>

[packer.nvim](https://github.com/wbthomason/packer.nvim) is unmaintained. See the [readme](https://github.com/wbthomason/packer.nvim/blob/master/README.md) file for suggested alternatives, such as [lazy.nvim](https://lazy.folke.io/).

```lua
use {
'kevinhwang91/nvim-ufo',
requires = 'kevinhwang91/promise-async'
}
```

</details>

### Minimal configuration

```lua
Expand Down Expand Up @@ -262,13 +296,13 @@ hi default link UfoCursorFoldedLine CursorLine
- `UfoFoldedFg`: Foreground for raw text of folded line.
- `UfoFoldedBg`: Background of folded line.
- `UfoPreviewSbar`: Scroll bar of preview window, only take effect if the border is missing right
horizontal line, like `border = 'none'`.
horizontal line, like `border = 'none'`.
- `UfoPreviewCursorLine`: Highlight current line in preview window if it isn't the start of folded
lines.
lines.
- `UfoPreviewWinBar`: Virtual winBar of preview window.
- `UfoPreviewThumb`: Thumb of preview window.
- `UfoFoldedEllipsis`: Ellipsis at the end of folded line, invalid if `fold_virt_text_handler` is
set.
set.
- `UfoCursorFoldedLine`: Highlight the folded line under the cursor

## Advanced configuration
Expand Down