diff options
Diffstat (limited to 'lua/plugins')
| -rw-r--r-- | lua/plugins/close-buffer.lua | 2 | ||||
| -rw-r--r-- | lua/plugins/codecompanion.lua | 260 | ||||
| -rw-r--r-- | lua/plugins/colorscheme.lua | 176 | ||||
| -rw-r--r-- | lua/plugins/completition.lua | 115 | ||||
| -rw-r--r-- | lua/plugins/dap.lua | 15 | ||||
| -rw-r--r-- | lua/plugins/database.lua | 26 | ||||
| -rw-r--r-- | lua/plugins/deadcolumn.lua | 5 | ||||
| -rw-r--r-- | lua/plugins/dressing.lua | 228 | ||||
| -rw-r--r-- | lua/plugins/duck.lua | 12 | ||||
| -rw-r--r-- | lua/plugins/easy-align.lua | 4 | ||||
| -rw-r--r-- | lua/plugins/llm.lua | 55 | ||||
| -rw-r--r-- | lua/plugins/markview.lua | 3 | ||||
| -rw-r--r-- | lua/plugins/menu.lua | 45 | ||||
| -rw-r--r-- | lua/plugins/minty.lua | 10 | ||||
| -rw-r--r-- | lua/plugins/orgmode.lua | 17 | ||||
| -rw-r--r-- | lua/plugins/vimtex.lua | 17 |
16 files changed, 519 insertions, 471 deletions
diff --git a/lua/plugins/close-buffer.lua b/lua/plugins/close-buffer.lua index 947f31a..64a6a82 100644 --- a/lua/plugins/close-buffer.lua +++ b/lua/plugins/close-buffer.lua @@ -6,7 +6,7 @@ return { event = "VeryLazy", opts = { -- if a buffer has been inactive for this many minutes, close it - retirementAgeMins = 30, + retirementAgeMins = 120, }, }, } diff --git a/lua/plugins/codecompanion.lua b/lua/plugins/codecompanion.lua index e5f087f..ddd209b 100644 --- a/lua/plugins/codecompanion.lua +++ b/lua/plugins/codecompanion.lua @@ -1,27 +1,3 @@ --- Choose default model from a list of preferred models. Fall back to first --- available. -local function preferred_model_picker(preferred) - return function(self) - if self == nil then - -- Debug:render() calls Adapter.schema.model.default() but doesn't pass - -- in `self`. Just return an empty string in this case. - return "" - end - - local choices = self.schema.model.choices(self) - - for _, best in ipairs(preferred) do - for _, choice in ipairs(choices) do - if choice:find(best, 1, true) then - return choice - end - end - end - - return choices[1] - end -end - local IS_DEV = false return { { @@ -53,148 +29,112 @@ return { opts = { log_level = "TRACE", -- or "DEBUG" adapters = { - ollama = function() - return require("codecompanion.adapters").extend("ollama", { - name = "tinyllama", - env = { - url = "http://127.0.0.1:11434", - -- api_key = "", - }, - headers = { - ["Content-Type"] = "application/json", - -- ["Authorization"] = "Bearer ${api_key}", - }, - parameters = { - sync = true, - }, - schema = { - model = { - default = preferred_model_picker { - "qwen2.5-coder:14b", - "qwen2.5-coder:7b", - "qwen2.5-coder:3b", - "qwen2.5-coder:1.5b", - "qwen2.5-coder:0.5b", + http = { + ollama = function() + return require("codecompanion.adapters").extend("ollama", { + name = "tinyllama", + env = { + url = "http://127.0.0.1:11434", + -- api_key = "", + }, + headers = { + ["Content-Type"] = "application/json", + -- ["Authorization"] = "Bearer ${api_key}", + }, + parameters = { + sync = true, + }, + schema = { + model = { + default = "qwen2.5-coder:0.5b", }, }, - }, - }) - end, - anthropic = function() - return require("codecompanion.adapters").extend("anthropic", { - env = { - api_key = "cmd:echo $ANTHROPIC_API_KEY", - }, - schema = { - model = { - default = "claude-3-opus-20240229", + }) + end, + anthropic = function() + return require("codecompanion.adapters").extend("anthropic", { + env = { + api_key = "cmd:echo $ANTHROPIC_API_KEY", }, - }, - }) - end, - copilot = function() - return require("codecompanion.adapters").extend("copilot", { - schema = { - model = { - default = "gpt-4.1", + schema = { + model = { + default = "claude-3-opus-20240229", + }, }, - }, - }) - end, - gemini = function() - return require("codecompanion.adapters").extend("gemini", { - env = { - api_key = "cmd:op read op://personal/Gemini_API/credential --no-newline", - }, - }) - end, - openai = function() - return require("codecompanion.adapters").extend("openai", { - env = { - api_key = "cmd:echo $OPENAI_API_KEY", - chat_url = "/v1/chat/completions", - url = "https://api.openai.com", - }, - schema = { - model = { - default = function() - return "gpt-4o-mini" - end, + }) + end, + copilot = function() + return require("codecompanion.adapters").extend("copilot", { + schema = { + model = { + default = "gpt-4.1", + }, }, - }, - }) - end, - openai_compatible = function() - return require("codecompanion.adapters").extend("openai_compatible", { - env = { - api_key = "cmd:echo $OPENAI_API_KEY", - chat_url = "/v1/chat/completions", - url = "http://127.0.0.1:8012", - }, - headers = { - ["Content-Type"] = "application/json", - }, - schema = { - model = { - default = function() - return "davinci" - end, + }) + end, + gemini = function() + return require("codecompanion.adapters").extend("gemini", { + env = { + api_key = "cmd:op read op://personal/Gemini_API/credential --no-newline", }, - }, - }) - end, - xai = function() - return require("codecompanion.adapters").extend("xai", { - env = { - api_key = "cmd:op read op://personal/xAI_API/credential --no-newline", - }, - }) - end, - deepseek = function() - return require("codecompanion.adapters").extend("openai_compatible", { - env = { - api_key = "cmd:echo $AZ_DS_API_KEY", - url = "https://DeepSeek-R1-ajfsk.eastus2.models.ai.azure.com", - }, - schema = { - model = { - default = "deepseek-chat", + }) + end, + openai = function() + return require("codecompanion.adapters").extend("openai", { + env = { + api_key = "cmd:echo $OPENAI_API_KEY", + chat_url = "/v1/chat/completions", + url = "https://api.openai.com", }, - }, - }) - end, - -- deepseek = function() - -- return require("codecompanion.adapters").extend("deepseek", { - -- env = { - -- api_key = "cmd:echo $OPENAI_API_KEY", - -- chat_url = "/v1/chat/completions", - -- url = "http://127.0.0.1:8012", - -- }, - -- headers = { - -- ["Content-Type"] = "application/json", - -- }, - -- schema = { - -- model = { - -- default = function() - -- return "davinci" - -- end, - -- }, - -- }, - -- }) - -- end, - azure_openai = function() - return require("codecompanion.adapters").extend("azure_openai", { - env = { - api_key = "cmd:echo $AZ_DS_API_KEY", - endpoint = "https://DeepSeek-R1-nphob.eastus2.models.ai.azure.com", - }, - schema = { - model = { - default = "DeepSeek-R1-nphob", + schema = { + model = { + default = function() + return "gpt-4o-mini" + end, + }, }, - }, - }) - end, + }) + end, + openai_compatible = function() + return require("codecompanion.adapters").extend("openai_compatible", { + env = { + api_key = "cmd:echo $OPENAI_API_KEY", + chat_url = "/v1/chat/completions", + url = "http://127.0.0.1:8012", + }, + headers = { + ["Content-Type"] = "application/json", + }, + schema = { + model = { + default = function() + return "davinci" + end, + }, + }, + }) + end, + xai = function() + return require("codecompanion.adapters").extend("xai", { + env = { + api_key = "cmd:op read op://personal/xAI_API/credential --no-newline", + }, + }) + end, + azure_openai = function() + return require("codecompanion.adapters").extend("azure_openai", { + env = { + api_key = "cmd:echo $AZ_DS_API_KEY", + endpoint = "https://DeepSeek-R1-nphob.eastus2.models.ai.azure.com", + }, + schema = { + model = { + default = "DeepSeek-R1-nphob", + }, + }, + }) + end, + }, }, display = { diff = { @@ -208,11 +148,15 @@ return { }, inline = { adapter = "copilot" }, agent = { adapter = "copilot" }, + cmd = { adapter = "copilot" }, }, }, config = function(_, options) require("codecompanion").setup(options) require("codecompanion").setup { + opts = { + language = "English", + }, extensions = { mcphub = { callback = "mcphub.extensions.codecompanion", diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua index 376feee..aaae1db 100644 --- a/lua/plugins/colorscheme.lua +++ b/lua/plugins/colorscheme.lua @@ -4,78 +4,142 @@ return { priority = 1000, opts = {}, config = function() - - -- Colorscheme Solarized Osaka by Takuya Matsuyama (https://github.com/craftzdog/solarized-osaka.nvim) + -- ===================================================== + -- Solarized Osaka Colorscheme Configuration + -- Enhanced setup with better customization + -- ===================================================== + require("solarized-osaka").setup({ - -- your configuration comes here - -- or leave it empty to use the default settings - transparent = true, -- Enable this to disable setting the background color - terminal_colors = true, -- Configure the colors used when opening a `:terminal` in [Neovim](https://github.com/neovim/neovim) + -- ========== Core Settings ========== + transparent = true, -- Enable transparent background + terminal_colors = true, -- Configure terminal colors + + -- ========== Syntax Highlighting Styles ========== styles = { - -- Style to be applied to different syntax groups - -- Value is any valid attr-list value for `:help nvim_set_hl` comments = { italic = true }, - keywords = { italic = true }, - functions = { italic = true }, - variables = { bold = true}, - -- Background styles. Can be "dark", "transparent" or "normal" - sidebars = "dark", -- style for sidebars, see below - floats = "dark", -- style for floating windows + keywords = { italic = true, bold = false }, + functions = { italic = false, bold = true }, + variables = { bold = false }, + conditionals = { italic = true }, + loops = { italic = true }, + constants = { bold = true }, + strings = { italic = false }, + types = { bold = true }, + + -- ========== UI Element Styles ========== + sidebars = "dark", -- Sidebar style: "dark", "transparent", "normal" + floats = "dark", -- Floating window style + }, + + -- ========== UI Configuration ========== + sidebars = { + "qf", "help", "vista_kind", "terminal", + "packer", "spectre_panel", "toggleterm", + "Trouble", "NvimTree", "neo-tree" }, - sidebars = { "qf", "help" }, -- Set a darker background on sidebar-like windows. For example: `["qf", "vista_kind", "terminal", "packer"]` - day_brightness = 0.3, -- Adjusts the brightness of the colors of the **Day** style. Number between 0 and 1, from dull to vibrant colors - hide_inactive_statusline = false, -- Enabling this option, will hide inactive statuslines and replace them with a thin border instead. Should work with the standard **StatusLine** and **LuaLine**. - dim_inactive = false, -- dims inactive windows - lualine_bold = true, -- When `true`, section headers in the lualine theme will be bold + day_brightness = 0.4, -- Better brightness for day variant + hide_inactive_statusline = false, + dim_inactive = true, -- Dim inactive windows for better focus + lualine_bold = true, - --- You can override specific color groups to use other groups or a hex color - --- function will be called with a ColorScheme table + -- ========== Color Customization ========== ---@param colors ColorScheme - on_colors = function(colors) end, + on_colors = function(colors) + -- Enhance base colors for better readability + colors.bg_dark = "#16161e" + colors.bg_float = "#1a1a23" + colors.border = "#27a1b9" + colors.comment = "#565f89" + colors.gitSigns = { + add = "#449dab", + change = "#6183bb", + delete = "#f7768e", + } + end, - --- You can override specific highlights to use other groups or a hex color - --- function will be called with a Highlights and ColorScheme table + -- ========== Highlight Customization ========== ---@param highlights Highlights ---@param colors ColorScheme on_highlights = function(hl, c) + -- ========== Indent Guides ========== hl.IblIndent = { fg = c.base03, nocombine = true } hl.IndentBlanklineChar = { fg = c.blue, nocombine = true } hl.IndentBlanklineContextChar = { fg = c.orange500, nocombine = true } - + + -- ========== Telescope Enhanced Styling ========== local prompt = "#2d3149" - hl.TelescopeNormal = { - bg = c.bg_dark, - fg = c.fg_dark, - } - hl.TelescopeBorder = { - bg = c.bg_dark, - fg = c.bg_dark, - } - hl.TelescopePromptNormal = { - bg = prompt, - } - hl.TelescopePromptBorder = { - bg = prompt, - fg = prompt, - } - hl.TelescopePromptTitle = { - bg = prompt, - fg = prompt, - } - hl.TelescopePreviewTitle = { - bg = c.bg_dark, - fg = c.bg_dark, - } - hl.TelescopeResultsTitle = { - bg = c.bg_dark, - fg = c.bg_dark, - } + local results = "#1f2335" + local preview = "#24283b" + + hl.TelescopeNormal = { bg = c.bg_dark, fg = c.fg_dark } + hl.TelescopeBorder = { bg = c.bg_dark, fg = c.border } + hl.TelescopePromptNormal = { bg = prompt } + hl.TelescopePromptBorder = { bg = prompt, fg = c.border } + hl.TelescopePromptTitle = { bg = c.blue, fg = c.bg_dark, bold = true } + hl.TelescopePreviewTitle = { bg = c.green, fg = c.bg_dark, bold = true } + hl.TelescopeResultsTitle = { bg = c.purple, fg = c.bg_dark, bold = true } + hl.TelescopeSelection = { bg = "#364A82", fg = c.fg } + hl.TelescopeSelectionCaret = { fg = c.red } + + -- ========== Enhanced UI Elements ========== + -- Better cursor line + hl.CursorLine = { bg = "#1e202a" } + hl.CursorLineNr = { fg = c.orange, bold = true } + + -- Improved visual selection + hl.Visual = { bg = "#33467c" } + + -- Better search highlights + hl.Search = { bg = c.yellow, fg = c.bg_dark } + hl.IncSearch = { bg = c.orange, fg = c.bg_dark } + + -- Enhanced diagnostics + hl.DiagnosticError = { fg = c.red } + hl.DiagnosticWarn = { fg = c.yellow } + hl.DiagnosticInfo = { fg = c.blue } + hl.DiagnosticHint = { fg = c.cyan } + + -- ========== Plugin-specific Highlights ========== + -- Neo-tree + hl.NeoTreeNormal = { bg = c.bg_dark } + hl.NeoTreeNormalNC = { bg = c.bg_dark } + + -- Which-key + hl.WhichKey = { fg = c.blue } + hl.WhichKeyGroup = { fg = c.purple } + hl.WhichKeyDesc = { fg = c.fg } + + -- Notify + hl.NotifyBackground = { bg = c.bg_dark } + + -- GitSigns + hl.GitSignsAdd = { fg = c.green } + hl.GitSignsChange = { fg = c.yellow } + hl.GitSignsDelete = { fg = c.red } end, }) + -- ===================================================== + -- Apply Colorscheme + -- ===================================================== + vim.cmd.colorscheme("solarized-osaka") + + -- ===================================================== + -- Additional UI Enhancements + -- ===================================================== + -- Better cursor visibility + vim.opt.guicursor = "n-v-c:block,i-ci-ve:ver25,r-cr:hor20,o:hor50" + + -- Enhanced visual feedback + vim.opt.cursorline = true + vim.opt.number = true + vim.opt.relativenumber = true + vim.opt.signcolumn = "yes" + + -- Better terminal colors + if vim.fn.has("termguicolors") == 1 then + vim.opt.termguicolors = true + end - -- setup must be called before loading - vim.cmd.colorscheme "solarized-osaka" - - end + end, } diff --git a/lua/plugins/completition.lua b/lua/plugins/completition.lua index 173cb54..bfe51d5 100644 --- a/lua/plugins/completition.lua +++ b/lua/plugins/completition.lua @@ -1,38 +1,97 @@ return { - "hrsh7th/nvim-cmp", + "saghen/blink.cmp", + -- optional: provides snippets for the snippet source dependencies = { - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-nvim-lua", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-cmdline", - "hrsh7th/cmp-git", - "saadparwaiz1/cmp_luasnip", - "onsails/lspkind-nvim", + "rafamadriz/friendly-snippets", { "L3MON4D3/LuaSnip", version = "v1.*" }, "windwp/nvim-autopairs", { - "zbirenbaum/copilot-cmp", - dependencies = { - "zbirenbaum/copilot.lua", - cmd = { "Copilot" }, - event = { "VeryLazy" }, - opts = { suggestion = { enabled = false }, panel = { enabled = false } }, + "zbirenbaum/copilot.lua", + cmd = { "Copilot" }, + event = { "VeryLazy" }, + opts = { suggestion = { enabled = false }, panel = { enabled = false } }, + }, + -- Add blink.cmp copilot source + "giuxtaposition/blink-cmp-copilot", + -- Add blink.cmp latex source for LaTeX/VimTeX support + "erooke/blink-cmp-latex", + }, + + -- use a release tag to download pre-built binaries + version = "1.*", + -- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust + -- build = 'cargo build --release', + + event = "VeryLazy", + + ---@module 'blink.cmp' + ---@type blink.cmp.Config + opts = { + -- Opciones de keymap disponibles: + -- 'default' (actual) - Ctrl+y para aceptar, similar a built-in completions + -- 'super-tab' - Tab para aceptar, similar a VSCode + -- 'enter' - Enter para aceptar + -- 'none' - Sin atajos automáticos (defines los tuyos) + keymap = { preset = "default" }, + + -- Todas las configuraciones de preset 'default' incluyen: + -- Ctrl+space: Abrir menú o mostrar docs si ya está abierto + -- Ctrl+n/Ctrl+p o ↑/↓: Seleccionar siguiente/anterior + -- Ctrl+e: Ocultar menú + -- Ctrl+k: Toggle signature help (si signature.enabled = true) + + appearance = { + -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font' + nerd_font_variant = "mono", + }, + + completion = { + documentation = { + auto_show = true, + auto_show_delay_ms = 500, + window = { border = "rounded" }, + }, + menu = { + border = "rounded", + draw = { + columns = { + { "label", "label_description", gap = 1 }, + { "kind_icon", "kind" }, + }, + }, }, - config = true, + ghost_text = { enabled = false }, }, - { - "uga-rosa/cmp-dictionary", - config = function() - local dict_fl = { ["*"] = { "/usr/share/dict/words" }, ft = { foo = { "./../../spell/dict_es_en.dict" } } } - local dict = require "cmp_dictionary" - dict.setup { paths = dict_fl["*"], exact_length = 3, first_case_insensitive = false } - end, + + -- Default list of enabled providers + sources = { + default = { "lsp", "path", "snippets", "buffer", "copilot" }, + per_filetype = { + tex = { "lsp", "path", "snippets", "buffer", "latex" }, + bib = { "lsp", "path", "snippets", "buffer", "latex" }, + codecompanion = { "codecompanion" }, + }, + providers = { + copilot = { + name = "copilot", + module = "blink-cmp-copilot", + score_offset = 100, + async = true, + }, + latex = { + name = "latex", + module = "blink-cmp-latex", + }, + }, }, - { "Jezda1337/nvim-html-css" }, + + snippets = { preset = "luasnip" }, + + -- Experimental signature help support + signature = { enabled = true }, + + -- (Default) Rust fuzzy matcher for typo resistance and significantly better performance + fuzzy = { implementation = "prefer_rust_with_warning" }, }, - event = "VeryLazy", - config = function() - require "pi.completition" - end, + opts_extend = { "sources.default" }, } diff --git a/lua/plugins/dap.lua b/lua/plugins/dap.lua index 921c560..01e6567 100644 --- a/lua/plugins/dap.lua +++ b/lua/plugins/dap.lua @@ -7,7 +7,8 @@ return { "mxsdev/nvim-dap-vscode-js", "anuvyklack/hydra.nvim", "nvim-telescope/telescope-dap.nvim", - "rcarriga/cmp-dap", + -- Note: cmp-dap removed due to migration to blink.cmp + -- blink.cmp handles DAP completions automatically }, keys = { { "<leader>d", desc = "Open Debug menu" } }, config = function() @@ -17,15 +18,7 @@ return { telescope.load_extension "dap" end - local ok_cmp, cmp = pcall(require, "cmp") - if ok_cmp then - cmp.setup.filetype({ "dap-repl", "dapui_watches" }, { - sources = cmp.config.sources({ - { name = "dap" }, - }, { - { name = "buffer" }, - }), - }) - end + -- Note: DAP completions are handled automatically by blink.cmp + -- No additional configuration needed end, } diff --git a/lua/plugins/database.lua b/lua/plugins/database.lua deleted file mode 100644 index e156510..0000000 --- a/lua/plugins/database.lua +++ /dev/null @@ -1,26 +0,0 @@ -return { - "kristijanhusak/vim-dadbod-ui", - dependencies = { - "tpope/vim-dadbod", - "kristijanhusak/vim-dadbod-completion", - "tpope/vim-dotenv", - }, - keys = { { "<leader><leader>db", ":tab DBUI<cr>", desc = "Open Database client" } }, - init = function() - vim.g.db_ui_use_nerd_fonts = 1 - vim.g.db_ui_show_database_icon = 1 - vim.g.db_ui_force_echo_notifications = 1 - vim.g.db_ui_win_position = "left" - vim.g.db_ui_winwidth = 80 - - vim.g.db_ui_table_helpers = { - mysql = { - Count = "select count(1) from {optional_schema}{table}", - Explain = "EXPLAIN {last_query}", - }, - sqlite = { - Describe = "PRAGMA table_info({table})", - }, - } - end, -} diff --git a/lua/plugins/deadcolumn.lua b/lua/plugins/deadcolumn.lua deleted file mode 100644 index 26457c2..0000000 --- a/lua/plugins/deadcolumn.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - "Bekaboo/deadcolumn.nvim", - enabled = false, - event = { "VeryLazy" }, -} diff --git a/lua/plugins/dressing.lua b/lua/plugins/dressing.lua index 5cfb6cf..edf6806 100644 --- a/lua/plugins/dressing.lua +++ b/lua/plugins/dressing.lua @@ -2,159 +2,213 @@ return { "stevearc/dressing.nvim", event = "VeryLazy", opts = { + -- ===================================================== + -- Input Configuration - Enhanced vim.ui.input + -- ===================================================== input = { - -- Set to false to disable the vim.ui.input implementation enabled = true, - - -- Default prompt string - default_prompt = "Input:", - - -- Can be 'left', 'right', or 'center' + default_prompt = " Input:", prompt_align = "center", - - -- When true, <Esc> will close the modal insert_only = true, - - -- When true, input will start in insert mode. start_in_insert = true, - - -- These are passed to nvim_open_win - -- anchor = "SW", + + -- ========== Window Styling ========== border = "rounded", - -- 'editor' and 'win' will default to being centered relative = "editor", - - -- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) - prefer_width = 40, + + -- ========== Size Configuration ========== + prefer_width = 50, width = nil, - -- min_width and max_width can be a list of mixed types. - -- min_width = {20, 0.2} means "the greater of 20 columns or 20% of total" - max_width = { 140, 0.9 }, - min_width = { 20, 0.2 }, + max_width = { 140, 0.8 }, + min_width = { 30, 0.3 }, + + -- ========== Window Options ========== win_options = { - -- Window transparency (0-100) - winblend = 10, - -- Disable line wrapping + winblend = 0, -- No transparency for better readability wrap = false, + cursorline = true, + cursorlineopt = "both", + -- Better highlighting + winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:PmenuSel", }, - -- Set to `false` to disable + -- ========== Enhanced Key Mappings ========== mappings = { n = { ["<Esc>"] = "Close", ["<CR>"] = "Confirm", + ["q"] = "Close", + ["<C-c>"] = "Close", }, i = { ["<C-c>"] = "Close", ["<CR>"] = "Confirm", ["<Up>"] = "HistoryPrev", ["<Down>"] = "HistoryNext", + ["<C-p>"] = "HistoryPrev", + ["<C-n>"] = "HistoryNext", + ["<C-u>"] = function() vim.api.nvim_del_current_line() end, + ["<Esc>"] = "Close", }, }, - - override = function(conf) - -- This is the config that will be passed to nvim_open_win. - -- Change values here to customize the layout - return conf + + -- ========== 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, - - -- see :help dressing_get_config - get_config = nil, }, + + -- ===================================================== + -- Select Configuration - Enhanced vim.ui.select + -- ===================================================== select = { - -- Set to false to disable the vim.ui.select implementation - enabled = false, - - -- Priority list of preferred vim.select implementations - backend = { "telescope", "fzf_lua", "fzf", "builtin", "nui" }, - - -- Trim trailing `:` from prompt + enabled = true, -- Enable for better selection UI + + -- ========== Backend Priority ========== + backend = { "telescope", "fzf_lua", "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 = { "─", "│", "─", "│", "┌", "┐", "┘", "└" }, + }, + }), - -- Options for telescope selector - -- These are passed into the telescope picker directly. Can be used like: - -- telescope = require('telescope.themes').get_ivy({...}) - telescope = nil, - - -- Options for fzf selector + -- ========== FZF Configuration ========== fzf = { window = { - width = 0.5, - height = 0.4, + width = 0.7, + height = 0.6, }, }, - - -- Options for fzf_lua selector + + -- ========== FZF Lua Configuration ========== fzf_lua = { winopts = { - width = 0.5, - height = 0.4, + width = 0.7, + height = 0.6, + border = "rounded", }, }, - - -- Options for nui Menu + + -- ========== 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 = 10, + winblend = 0, + winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:PmenuSel", }, - max_width = 80, - max_height = 40, - min_width = 40, - min_height = 10, + max_width = 100, + max_height = 50, + min_width = 50, + min_height = 15, }, - -- Options for built-in selector + -- ========== Built-in Selector Configuration ========== builtin = { - -- These are passed to nvim_open_win - -- anchor = "NW", border = "rounded", - -- 'editor' and 'win' will default to being centered relative = "editor", - + + -- ========== Enhanced Window Options ========== win_options = { - -- Window transparency (0-100) - winblend = 10, + winblend = 0, + cursorline = true, + winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:PmenuSel", }, - - -- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) - -- the min_ and max_ options can be a list of mixed types. - -- max_width = {140, 0.8} means "the lesser of 140 columns or 80% of total" + + -- ========== Size Configuration ========== width = nil, - max_width = { 140, 0.8 }, - min_width = { 40, 0.2 }, + max_width = { 120, 0.8 }, + min_width = { 50, 0.4 }, height = nil, - max_height = 0.9, - min_height = { 10, 0.2 }, - - -- Set to `false` to disable + max_height = 0.8, + min_height = { 15, 0.3 }, |