1
0
mirror of https://github.com/jdhao/nvim-config.git synced 2025-06-08 14:14:33 +02:00

update ufo conf (preview)

This commit is contained in:
jdhao 2022-08-18 13:09:04 +08:00
parent 20964853a4
commit 2a6267bfde

View File

@ -7,6 +7,15 @@ vim.o.foldenable = true
vim.keymap.set('n', 'zR', require('ufo').openAllFolds)
vim.keymap.set('n', 'zM', require('ufo').closeAllFolds)
-- preview the foled lines in floating window
vim.keymap.set('n', '<tab>p', function()
local winid = require('ufo').peekFoldedLinesUnderCursor()
if not winid then
-- nvimlsp
vim.lsp.buf.hover()
end
end)
local handler = function(virtText, lnum, endLnum, width, truncate)
local newVirtText = {}
local suffix = ('  %d '):format(endLnum - lnum)