removed flash

This commit is contained in:
2026-06-08 12:36:22 +02:00
parent 6e8b327320
commit f00317a6a6
2 changed files with 30 additions and 10 deletions
+30 -3
View File
@@ -19,7 +19,6 @@ vim.pack.add({
{ src = "https://github.com/windwp/nvim-ts-autotag" },
{ src = "https://github.com/folke/todo-comments.nvim" },
{ src = "https://github.com/stevearc/conform.nvim" },
{ src = "https://github.com/folke/flash.nvim" },
{ src = "https://github.com/lewis6991/gitsigns.nvim" },
{ src = "https://github.com/MeanderingProgrammer/render-markdown.nvim" },
{ src = "https://github.com/folke/trouble.nvim" },
@@ -38,7 +37,7 @@ vim.api.nvim_set_hl(0, "FlashLabel", { fg = "#1d2021", bg = "#fe8019", bold = tr
for _, name in ipairs({
"oil", "mini.pick", "mini.extra", "mason", "typst-preview", "nvim-autopairs",
"trouble", "gitsigns", "nvim-web-devicons",
"mini.ai", "nvim-ts-autotag", "todo-comments", "flash", "cssview",
"mini.ai", "nvim-ts-autotag", "todo-comments", "cssview",
}) do
pcall(function() require(name).setup() end)
end
@@ -152,8 +151,36 @@ require("nvim-silicon").setup({
return vim.fn.fnamemodify(vim.api.nvim_buf_get_name(0), ":t")
end,
})
-- silicon's --tab-width replaces each tab with a fixed number of spaces
-- instead of advancing to the next tab stop, so tab-indented files (e.g.
-- assembly) come out misaligned. Expand tabs ourselves before shooting.
local s = require("nvim-silicon")
local function expand_tabs(line, ts)
local out, col = {}, 0
for i = 1, #line do
local ch = line:sub(i, i)
if ch == "\t" then
local n = ts - (col % ts)
out[#out + 1] = string.rep(" ", n)
col = col + n
else
out[#out + 1] = ch
col = col + 1
end
end
return table.concat(out)
end
local orig_format_lines = s.format_lines
s.format_lines = function(cmdline, args, options)
local lines, cl = orig_format_lines(cmdline, args, options)
local ts = vim.bo.tabstop
for i, line in ipairs(lines) do
lines[i] = expand_tabs(line, ts)
end
return lines, cl
end
local function silicon_shot(to_clipboard)
local s = require("nvim-silicon")
s.options.background = silicon_bg[vim.bo.filetype] or "#1d2021"
if to_clipboard then s.clip() else s.file() end
end