chore(nvim): re-order plugins definition
Try to keep alphabetical order, by plugin name.
This commit is contained in:
parent
1b8e518623
commit
7151b3a710
@ -32,6 +32,65 @@ return {
|
||||
})
|
||||
end
|
||||
},
|
||||
'nvim-treesitter/nvim-treesitter-context',
|
||||
{
|
||||
'kevinhwang91/nvim-ufo',
|
||||
dependencies = { 'kevinhwang91/promise-async' },
|
||||
event = 'BufRead',
|
||||
keys = function ()
|
||||
local ufo = require('ufo')
|
||||
return {
|
||||
{ 'zR', ufo.openAllFolds, { desc = "Open all folds" } },
|
||||
{ 'zM', ufo.closeAllFolds, { desc = "Close all folds" } },
|
||||
{ 'zr', ufo.openFoldsExceptKinds, { desc = "Open fold" } },
|
||||
{ 'zm', ufo.closeFoldsWith, { desc = "Close fold" } },
|
||||
}
|
||||
end,
|
||||
opts = function ()
|
||||
local handler = function (virtText, lnum, endLnum, width, truncate)
|
||||
local newVirtText = {}
|
||||
local suffix = (' %d '):format(endLnum - lnum)
|
||||
local sufWidth = vim.fn.strdisplaywidth(suffix)
|
||||
local targetWidth = width - sufWidth
|
||||
local curWidth = 0
|
||||
for _, chunk in ipairs(virtText) do
|
||||
local chunkText = chunk[1]
|
||||
local chunkWidth = vim.fn.strdisplaywidth(chunkText)
|
||||
if targetWidth > curWidth + chunkWidth then
|
||||
table.insert(newVirtText, chunk)
|
||||
else
|
||||
chunkText = truncate(chunkText, targetWidth - curWidth)
|
||||
local hlGroup = chunk[2]
|
||||
table.insert(newVirtText, {chunkText, hlGroup})
|
||||
chunkWidth = vim.fn.strdisplaywidth(chunkText)
|
||||
-- str width returned from truncate() may less than 2nd argument, need padding
|
||||
if curWidth + chunkWidth < targetWidth then
|
||||
suffix = suffix .. (' '):rep(targetWidth - curWidth - chunkWidth)
|
||||
end
|
||||
break
|
||||
end
|
||||
curWidth = curWidth + chunkWidth
|
||||
end
|
||||
table.insert(newVirtText, { suffix, 'MoreMsg' })
|
||||
return newVirtText
|
||||
end
|
||||
|
||||
return {
|
||||
fold_virt_text_handler = handler,
|
||||
provider_selector = function (_, _, _)
|
||||
return { 'treesitter', 'indent' }
|
||||
end
|
||||
}
|
||||
end,
|
||||
},
|
||||
{
|
||||
'stevearc/oil.nvim',
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
keys = {
|
||||
{ '-', '<cmd>Oil<cr>', desc = "Open parent directory" },
|
||||
},
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
'rest-nvim/rest.nvim',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
@ -77,7 +136,6 @@ return {
|
||||
}
|
||||
end
|
||||
},
|
||||
'nvim-treesitter/nvim-treesitter-context',
|
||||
{
|
||||
'akinsho/toggleterm.nvim',
|
||||
opts = {
|
||||
@ -118,12 +176,4 @@ return {
|
||||
}
|
||||
end
|
||||
},
|
||||
{
|
||||
'stevearc/oil.nvim',
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
keys = {
|
||||
{ '-', '<cmd>Oil<cr>', desc = "Open parent directory" },
|
||||
},
|
||||
opts = {},
|
||||
},
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user