From 1a3c35e59ad90f638d95e393f52826bf692e79ad Mon Sep 17 00:00:00 2001 From: PattyC Date: Mon, 10 Nov 2025 11:48:18 +0930 Subject: [PATCH] feat: add dynamic line length to snacks picker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- nvim/lua/core/configs/snacks_picker.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nvim/lua/core/configs/snacks_picker.lua b/nvim/lua/core/configs/snacks_picker.lua index abe7fb8..b164caa 100644 --- a/nvim/lua/core/configs/snacks_picker.lua +++ b/nvim/lua/core/configs/snacks_picker.lua @@ -1,3 +1,8 @@ +--- Dynamically calculate truncate width based on current window size +local function get_truncate_width() + return (vim.api.nvim_win_get_width(0) * 0.4) - 15 +end + ---@class snacks.picker.Config return { enabled = true, @@ -35,7 +40,7 @@ return { }, file = { filename_first = false, -- display filename before the file path - truncate = 40, -- truncate the file path to (roughly) this length + truncate = get_truncate_width, -- dynamically truncate the file path based on window size filename_only = false, -- only show the filename icon_width = 2, -- width of the icon (in characters) git_status_hl = true, -- use the git status highlight group for the filename