debug completion
This commit is contained in:
parent
bfa9a35040
commit
541607cfbc
@ -319,7 +319,10 @@ function M.setup()
|
|||||||
vim.api.nvim_create_autocmd("TextChangedI", {
|
vim.api.nvim_create_autocmd("TextChangedI", {
|
||||||
pattern = "*",
|
pattern = "*",
|
||||||
callback = function()
|
callback = function()
|
||||||
M.trigger_completion()
|
-- Only trigger if enabled
|
||||||
|
if vim.b.gemini_completion_enabled then
|
||||||
|
M.trigger_completion()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -43,21 +43,10 @@ function M.setup(opts)
|
|||||||
config.setup(opts)
|
config.setup(opts)
|
||||||
pcall(vim.treesitter.language.require_language, "markdown")
|
pcall(vim.treesitter.language.require_language, "markdown")
|
||||||
|
|
||||||
-- Remove this duplicate keymap setup
|
-- Set up completion
|
||||||
-- require("gemini.completion").setup()
|
completion.setup()
|
||||||
|
|
||||||
-- Remove this duplicate keymap
|
|
||||||
-- vim.keymap.set('i', '<C-g><C-g>', function()
|
|
||||||
-- require("gemini.completion").trigger_completion()
|
|
||||||
-- end, { desc = 'Trigger Gemini completion' })
|
|
||||||
|
|
||||||
-- Keep only this completion keymap
|
|
||||||
vim.keymap.set('i', '<C-g><C-g>', function()
|
|
||||||
-- Force Gemini's omnifunc
|
|
||||||
vim.api.nvim_command('set omnifunc=v:lua.require\'gemini\'.complete')
|
|
||||||
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes('<C-x><C-o>', true, true, true), 'n', true)
|
|
||||||
end, { desc = 'Trigger Gemini completion' })
|
|
||||||
|
|
||||||
|
-- Set up commands
|
||||||
vim.api.nvim_create_user_command("Gemini", function(opts)
|
vim.api.nvim_create_user_command("Gemini", function(opts)
|
||||||
if opts.args == "" then
|
if opts.args == "" then
|
||||||
vim.notify("Please provide a prompt for Gemini.", vim.log.levels.WARN)
|
vim.notify("Please provide a prompt for Gemini.", vim.log.levels.WARN)
|
||||||
@ -78,6 +67,7 @@ function M.setup(opts)
|
|||||||
desc = "Clear Gemini chat history"
|
desc = "Clear Gemini chat history"
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Chat keymaps
|
||||||
vim.keymap.set("n", "<leader>gc", function()
|
vim.keymap.set("n", "<leader>gc", function()
|
||||||
M.prompt_query()
|
M.prompt_query()
|
||||||
end, { desc = "Chat with Gemini AI" })
|
end, { desc = "Chat with Gemini AI" })
|
||||||
@ -92,11 +82,9 @@ function M.setup(opts)
|
|||||||
vim.notify("Chat history cleared", vim.log.levels.INFO)
|
vim.notify("Chat history cleared", vim.log.levels.INFO)
|
||||||
end, { desc = "Clear Gemini chat history" })
|
end, { desc = "Clear Gemini chat history" })
|
||||||
|
|
||||||
-- Change the completion keymap to a more unique combination
|
-- Completion keymaps
|
||||||
vim.keymap.set('i', '<C-g><C-g>', function()
|
vim.keymap.set('i', '<leader>gg', function()
|
||||||
-- Force Gemini's omnifunc
|
completion.trigger_completion()
|
||||||
vim.api.nvim_command('set omnifunc=v:lua.require\'gemini\'.complete')
|
|
||||||
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes('<C-x><C-o>', true, true, true), 'n', true)
|
|
||||||
end, { desc = 'Trigger Gemini completion' })
|
end, { desc = 'Trigger Gemini completion' })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user