From 3496a05674dec37097cf7aba76f6dc0dd0de650f Mon Sep 17 00:00:00 2001 From: kiskaadee Date: Tue, 14 Jul 2026 08:12:35 -0500 Subject: [PATCH] refactor(nvim): update completion behavior and map Tab for selection - Update `completeopt` to `noinsert` to prevent automatic suggestion injection. - Add `` keymap to accept completion selections when the popup menu is visible. --- modules/user/config/nvim/init.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/user/config/nvim/init.lua b/modules/user/config/nvim/init.lua index bc7d09d..0202da0 100644 --- a/modules/user/config/nvim/init.lua +++ b/modules/user/config/nvim/init.lua @@ -6,4 +6,14 @@ vim.opt.expandtab = true -- Convert tabs to spaces vim.opt.smartindent = true -- Intelligent auto-indenting based on file syntax vim.opt.wrap = false -- Disable automatic line wrapping vim.opt.termguicolors = true -- Enable 24-bit RGB terminal colors -vim.opt.completeopt = { "menu", "menuone", "noselect" } -- Smooth auto-completion behavior +vim.opt.completeopt = { "menu", "menuone", "noinsert" } -- Smooth auto-completion behavior + +-- Accept completion with Tab when the completion menu is visible +vim.keymap.set('i', '', function() + if vim.fn.pumvisible() == 1 then + return '' + else + return '' + end +end, { expr = true, silent = true }) +