markdown hover fix

This commit is contained in:
2026-05-19 15:46:50 +02:00
parent 66bec6bde3
commit 138dd2d924
2 changed files with 70 additions and 14 deletions
+50 -3
View File
@@ -2,6 +2,7 @@ vim.pack.add({
{ src = "https://github.com/ellisonleao/gruvbox.nvim" },
{ src = "https://github.com/stevearc/oil.nvim" },
{ src = "https://github.com/echasnovski/mini.pick" },
{ src = "https://github.com/echasnovski/mini.extra" },
{ src = "https://github.com/neovim/nvim-lspconfig" },
{ src = "https://github.com/nvim-treesitter/nvim-treesitter", version = "main" },
{ src = "https://github.com/nvim-treesitter/nvim-treesitter-textobjects", version = "main" },
@@ -12,7 +13,7 @@ vim.pack.add({
{ src = "https://codeberg.org/mfussenegger/nvim-jdtls.git" },
{ src = "https://github.com/windwp/nvim-autopairs" },
{ src = "https://codeberg.org/mfussenegger/nvim-dap.git" },
{ src = "https://github.com/romgrk/barbar.nvim" },
{ src = "https://github.com/akinsho/bufferline.nvim" },
{ src = "https://github.com/nvim-tree/nvim-web-devicons" },
{ src = "https://github.com/echasnovski/mini.ai" },
{ src = "https://github.com/windwp/nvim-ts-autotag" },
@@ -33,8 +34,8 @@ vim.api.nvim_set_hl(0, "FlashLabel", { fg = "#1d2021", bg = "#fe8019", bold = tr
-- Simple setup({}) plugins
for _, name in ipairs({
"oil", "mini.pick", "mason", "typst-preview", "nvim-autopairs",
"trouble", "gitsigns", "nvim-web-devicons", "barbar",
"oil", "mini.pick", "mini.extra", "mason", "typst-preview", "nvim-autopairs",
"trouble", "gitsigns", "nvim-web-devicons",
"mini.ai", "nvim-ts-autotag", "todo-comments", "flash", "cssview",
}) do
pcall(function() require(name).setup() end)
@@ -68,6 +69,29 @@ require("render-markdown").setup({
code = { inline_pad = 0, highlight_inline = "RenderMarkdownCode" },
})
vim.api.nvim_create_autocmd("FileType", {
pattern = "markdown",
callback = function(ev)
local win = vim.api.nvim_get_current_win()
if vim.api.nvim_win_get_config(win).relative == "" then return end
local buf = ev.buf
local lines = vim.api.nvim_buf_get_lines(buf, 0, -1, false)
local changed = false
for i, line in ipairs(lines) do
local new = line:gsub("`(\\[^`]-)`", "$%1$")
if new ~= line then
lines[i] = new
changed = true
end
end
if changed then
vim.bo[buf].modifiable = true
vim.api.nvim_buf_set_lines(buf, 0, -1, false, lines)
vim.bo[buf].modifiable = false
end
end,
})
local silicon_bg = {
typescript = "#1e3a5f",
javascript = "#5c4a1a",
@@ -117,6 +141,29 @@ vim.keymap.set("x", "<leader>cs", function() silicon_shot(false) end,
{ desc = "Silicon save" })
require("lualine").setup({ options = { theme = "gruvbox_dark" } })
local bl_bg = "#3c3836" -- lualine statusline bg
local bl_sel_bg = "#504945" -- lualine section_b bg (git branch)
local bl_fg = "#a89984"
local bl_sel_fg = "#ebdbb2"
require("bufferline").setup({
highlights = {
fill = { bg = bl_bg },
background = { bg = bl_bg, fg = bl_fg },
buffer_visible = { bg = bl_bg, fg = bl_fg },
buffer_selected = { bg = bl_sel_bg, fg = bl_sel_fg, bold = true, italic = false },
separator = { bg = bl_bg, fg = bl_bg },
separator_visible = { bg = bl_bg, fg = bl_bg },
separator_selected = { bg = bl_sel_bg, fg = bl_bg },
indicator_selected = { bg = bl_sel_bg, fg = bl_sel_bg },
modified = { bg = bl_bg },
modified_visible = { bg = bl_bg },
modified_selected = { bg = bl_sel_bg },
close_button = { bg = bl_bg, fg = bl_fg },
close_button_visible = { bg = bl_bg, fg = bl_fg },
close_button_selected= { bg = bl_sel_bg, fg = bl_sel_fg },
},
})
require("blink.cmp").setup({ keymap = { preset = "super-tab" } })
-- Treesitter (main branch: no configs.setup; install parsers manually)