-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathfold-preview.lua
41 lines (41 loc) · 1.21 KB
/
fold-preview.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
return {
-- Folding preview, by default h and l keys are used.
-- On first press of h key, when cursor is on a closed fold, the preview will be shown.
-- On second press the preview will be closed and fold will be opened.
-- When preview is opened, the l key will close it and open fold. In all other cases these keys will work as usual.
{
"anuvyklack/fold-preview.nvim",
event = "BufReadPost",
dependencies = "anuvyklack/keymap-amend.nvim",
config = true,
},
-- Custom fold text with line count
{
"bbjornstad/pretty-fold.nvim",
event = "BufReadPost",
config = function()
require("pretty-fold").setup({
keep_indentation = false,
fill_char = " ",
sections = {
left = {
function()
-- Calculate the fold level and return the appropriate string
local level = vim.v.foldlevel
if level == 0 then
return " "
else
return string.rep(" ", level - 1) .. " "
end
end,
"content",
},
right = {
" ",
"number_of_folded_lines",
},
},
})
end,
},
}