From f00317a6a64ca0218054a4190d02274060f79806 Mon Sep 17 00:00:00 2001 From: Jannik Donker Date: Mon, 8 Jun 2026 12:36:22 +0200 Subject: [PATCH] removed flash --- lua/keymaps.lua | 7 ------- lua/plugins.lua | 33 ++++++++++++++++++++++++++++++--- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/lua/keymaps.lua b/lua/keymaps.lua index d41cb87..efc4887 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -68,13 +68,6 @@ for i = 1, 9 do map("n", ("%d"):format(i), ("BufferLineGoToBuffer %d"):format(i), silent) end --- Flash -map({ "n", "x", "o" }, "s", function() require("flash").jump() end, { desc = "Flash" }) -map({ "n", "x", "o" }, "S", function() require("flash").treesitter() end, { desc = "Flash Treesitter" }) -map("o", "r", function() require("flash").remote() end, { desc = "Remote Flash" }) -map({ "o", "x" }, "R", function() require("flash").treesitter_search() end, { desc = "Treesitter Search" }) -map("c", "", function() require("flash").toggle() end, { desc = "Toggle Flash Search" }) - -- Spell map("n", "sc", function() vim.wo.spell = not vim.wo.spell diff --git a/lua/plugins.lua b/lua/plugins.lua index 6ba2ea9..e89718a 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -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