return { "stevearc/dressing.nvim", event = "VeryLazy", opts = { -- ===================================================== -- Input Configuration - Enhanced vim.ui.input -- ===================================================== input = { enabled = true, default_prompt = "󰘳 Input:", prompt_align = "center", insert_only = true, start_in_insert = true, -- ========== Window Styling ========== border = "rounded", relative = "editor", -- ========== Size Configuration ========== prefer_width = 50, width = nil, max_width = { 140, 0.8 }, min_width = { 30, 0.3 }, -- ========== Window Options ========== win_options = { winblend = 0, -- No transparency for better readability wrap = false, cursorline = true, cursorlineopt = "both", -- Better highlighting winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:PmenuSel", }, -- ========== Enhanced Key Mappings ========== mappings = { n = { [""] = "Close", [""] = "Confirm", ["q"] = "Close", [""] = "Close", }, i = { [""] = "Close", [""] = "Confirm", [""] = "HistoryPrev", [""] = "HistoryNext", [""] = "HistoryPrev", [""] = "HistoryNext", [""] = function() vim.api.nvim_del_current_line() end, [""] = "Close", }, }, -- ========== Custom Configuration Function ========== get_config = function(opts) -- Customize based on prompt type if opts.prompt and opts.prompt:find("rename", 1, true) then return { relative = "cursor", row = 1, col = 0, } end -- For file operations, make window larger if opts.prompt and (opts.prompt:find("file", 1, true) or opts.prompt:find("path", 1, true)) then return { prefer_width = 80, } end end, }, -- ===================================================== -- Select Configuration - Enhanced vim.ui.select -- ===================================================== select = { enabled = true, -- Enable for better selection UI -- ========== Backend Priority ========== backend = { "telescope", "builtin", "nui" }, trim_prompt = true, -- ========== Telescope Integration ========== telescope = require('telescope.themes').get_dropdown({ layout_config = { width = 0.6, height = 0.6, }, borderchars = { prompt = { "─", "│", " ", "│", "┌", "┐", "│", "│" }, results = { "─", "│", "─", "│", "├", "┤", "┘", "└" }, preview = { "─", "│", "─", "│", "┌", "┐", "┘", "└" }, }, }), -- ========== FZF Configuration ========== fzf = { window = { width = 0.7, height = 0.6, }, }, -- ========== NUI Configuration ========== nui = { position = "50%", size = nil, relative = "editor", border = { style = "rounded", text = { top = " Select ", top_align = "center", }, }, buf_options = { swapfile = false, filetype = "DressingSelect", }, win_options = { winblend = 0, winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:PmenuSel", }, max_width = 100, max_height = 50, min_width = 50, min_height = 15, }, -- ========== Built-in Selector Configuration ========== builtin = { border = "rounded", relative = "editor", -- ========== Enhanced Window Options ========== win_options = { winblend = 0, cursorline = true, winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:PmenuSel", }, -- ========== Size Configuration ========== width = nil, max_width = { 120, 0.8 }, min_width = { 50, 0.4 }, height = nil, max_height = 0.8, min_height = { 15, 0.3 }, -- ========== Enhanced Key Mappings ========== mappings = { [""] = "Close", [""] = "Close", [""] = "Confirm", ["q"] = "Close", ["j"] = "Next", ["k"] = "Prev", [""] = "Next", [""] = "Prev", [""] = "Next", [""] = "Prev", }, }, -- ========== Format Item Override ========== format_item_override = { -- Add icons for common items codeaction = function(action_tuple) local title = action_tuple[2].title:gsub("\r\n", "\\r\\n") local client = action_tuple[1] return string.format(" %s - %s", title, client) end, }, -- ========== Dynamic Configuration ========== get_config = function(opts) -- For code actions, use telescope if available if opts.kind == "codeaction" then return { backend = { "telescope", "builtin" }, telescope = require('telescope.themes').get_cursor({ layout_config = { width = 0.6, height = 0.4, }, }), } end -- For LSP references/definitions, prefer telescope if opts.kind == "references" or opts.kind == "definitions" then return { backend = { "telescope" }, } end -- For simple selections, use builtin return { backend = { "builtin", "telescope" }, } end, }, }, }