Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<Enter> still submits even when configuring a new submit keybinding #47

Open
alextes opened this issue Jul 10, 2023 · 0 comments
Open

Comments

@alextes
Copy link

alextes commented Jul 10, 2023

For whatever reason doesn't insert a newline for me (macos, kitty) not sure why but that's okay, I'd prefer the editing I'm used to in neovim, enter being newline in insert mode. So I updated my config like so:

return {
	"Bryley/neoai.nvim",
	dependencies = {
		"MunifTanjim/nui.nvim",
	},
	cmd = {
		"NeoAI",
		"NeoAIOpen",
		"NeoAIClose",
		"NeoAIToggle",
		"NeoAIContext",
		"NeoAIContextOpen",
		"NeoAIContextClose",
		"NeoAIInject",
		"NeoAIInjectCode",
		"NeoAIInjectContext",
		"NeoAIInjectContextCode",
	},
	keys = {
		{ "<leader>as", desc = "summarize text" },
		{ "<leader>ag", desc = "generate git message" },
	},
	config = function()
		require("neoai").setup({
			ui = {
				submit = "<C-m>",
				quit = "<C-c>",
				quit_context = "<C-c>",
				width = 30,
			},
			models = {
				{
					name = "openai",
					model = "gpt-4",
					-- model = "gpt-3.5-turbo",
					params = nil,
				},
			},
		})
	end,
}

Although works, also still works and what I really want is normal newlines on enter. So maybe this is a feature request to have an option for normal newline on enter behavior, or maybe it's an issue where setting the submit key doesn't control the submit key, either way, I'd really like the normal neovim behavior, any ideas for how to handle this best?

Thanks for this great plugin. Kinda crazy that all the others I've seen require to manually yank anything you want to talk to the AI about. NeoAIContext is a great improvement 👏 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant