vim-ai
vim-ai copied to clipboard
How to get shortcut key for AIChat working in insert mode
I'm trying to get AIChat to work with a shortcut so that after typing in a chat message and pressing the hotkey in insert mode it would run AIChat.
So far I have tried this:
inoremap <c-g> <c-o>:AIChat<CR>
But it doesn't work. Instead I tried this:
nnoremap <c-g> :AIChat<CR>i
Which requires me to exit insert mode and then press <c-g> and for some reason it adds a ':' to the start of the next user message.
Has anyone managed to get a kind of seamless chat working?
That inoremap <c-g> <c-o>:AIChat<CR> does not work is likely a peculiarity of your set up. You could try inoremap <c-g> <cmd>AIChat<cr> as well on a relatively recent version of Vim.