nvim: fix indent highlighting

This commit is contained in:
Mark Riedesel 2024-07-24 18:49:27 -05:00
parent c759257ead
commit b18beb9aca
4 changed files with 25 additions and 2 deletions

View file

@ -4,5 +4,6 @@ return {
main = "ibl",
opts = {
indent = { char = "" },
scope = { char = "" },
},
}

View file

@ -3,7 +3,7 @@ return {
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-nvim-lsp-signature-help",
"hrsh7th/cmp-nvim-lsp-signature-help",
{ "antosha417/nvim-lsp-file-operations", config = true },
{ "folke/neodev.nvim", opts = {} },
},

View file

@ -56,7 +56,7 @@ return {
{ name = "luasnip" }, -- snippets
{ name = "buffer" }, -- text within current buffer
{ name = "path" }, -- file system paths
{ name = "nvim_lsp_signature_help" }, -- function parameters
{ name = "nvim_lsp_signature_help" }, -- function parameters
}),
-- configure lspkind for vs-code like pictograms in completion menu

View file

@ -1,6 +1,28 @@
local function get_color(name, attr)
return vim.fn.synIDattr(vim.fn.synIDtrans(vim.fn.hlID(name)), attr):gsub('#','')
end
local function clamp(value)
return math.min(math.max(value, 0), 255)
end
local function brightness(color, amount)
local num = tonumber(color, 16)
local r = (math.floor(num / 0x10000)) + amount
local g = (math.floor(num / 0x100) % 0x100) + amount
local b = (math.floor(num % 0x100)) + amount
return string.format("#%x", clamp(r) * 0x10000 + clamp(g) * 0x100 + clamp(b))
end
local function add_tweaks()
-- always set IblIndent to a slightly brighter version of the background color
vim.cmd('hi IblIndent guifg=' .. brightness(get_color('Normal', 'bg'), 20))
end
return {
'AlphaTechnolog/pywal.nvim',
config = function ()
vim.cmd('colorscheme pywal')
add_tweaks()
end,
}