Bryley / neoai.nvim

Neovim plugin for intracting with GPT models from OpenAI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[suggestion]: automatically enter insert mode for neoai-prompt (when running :NeoAI)

bcp-dev-ops opened this issue · comments

This would be a huge ergonomic improvement.

Been struggling this morning trying to write an autocommand that enters in insert mode on BufEnter for neoai-prompt buffers; however, have not been fruitful. It seems like there is something async happening that makes this difficult.

Thanks for your consideration

This works for me, define a mapping to open NeoAI and then type 'i' afterwards to enter insert mode:
["<leader>na"] = { ":NeoAI<CR>i", "Smart toggle NeoAI window" },

(I use NVChad)

I think the raw lua to use would be:

vim.api.nvim_set_keymap('n', '<leader>na', ':NeoAI<CR>i', { noremap = true, desc = 'Smart toggle NeoAI window' })