diff --git a/lua/gemini/chat.lua b/lua/gemini/chat.lua index 9c8eaf6..608b26b 100644 --- a/lua/gemini/chat.lua +++ b/lua/gemini/chat.lua @@ -122,6 +122,12 @@ end local function setup_buffer_keymaps(bufnr) local opts = { buffer = bufnr, nowait = true, silent = true } + -- Block ALL leader key combinations + vim.keymap.set({'n', 'v'}, '', function() + vim.notify('Leader key commands are disabled in chat window', vim.log.levels.WARN) + return '' + end, opts) + -- Disable ALL commands vim.keymap.set('n', ':', function() vim.notify('Commands are disabled in chat window', vim.log.levels.WARN) @@ -133,7 +139,9 @@ local function setup_buffer_keymaps(bufnr) 'ZZ', 'ZQ', 'gf', 'f', 'gf', 'F', 'v', 's', 'n', '', '', '^', '6', 'gF', 'gF', - 'o', 'T', 'H', 'J', 'K', 'L' + 'o', 'T', 'H', 'J', 'K', 'L', + -- Add specific telescope/file finder bindings + 'sf', 'ff', 'fg', } for _, key in ipairs(blocked_keys) do @@ -158,11 +166,14 @@ local function setup_buffer_keymaps(bufnr) require("gemini").prompt_query(state.current_context) end, opts) - -- Allow basic navigation + -- Allow only basic navigation local allowed_keys = {'j', 'k', '', '', '', '', 'G', 'gg'} for _, key in ipairs(allowed_keys) do vim.keymap.set('n', key, key, opts) end + + -- Block all other keys + vim.keymap.set({'n', 'v', 'i'}, '', '', opts) end function M.create_window()